Re: Error during execution of testsuites on host OS, for ARM Architecture.

2019-05-02 Thread Gedare Bloom
Try to manually run the executable directly by qemu. Ask if you need more
direction

On Wed, Apr 24, 2019, 2:04 PM Vaibhav Gupta 
wrote:

> Hello,
> I even tried to run rtems-test for the testsuites/samples for ARM
> Architecture,
>
> $ rtems-test --rtems-bsp=xilinx_zynq_a9_qemu
> --rtems-tools=$HOME/development/rtems/5
> ~/development/rtems/kernel/xilinx_zynq_a9_qemu/arm-rtems5/c/xilinx_zynq_a9_qemu/testsuites/samples
> RTEMS Testing - Tester, 5.0.not_released
>  Command Line: /home/varodek/development/rtems/5/bin/rtems-test
> --rtems-bsp=xilinx_zynq_a9_qemu
> --rtems-tools=/home/varodek/development/rtems/5
> /home/varodek/development/rtems/kernel/xilinx_zynq_a9_qemu/arm-rtems5/c/xilinx_zynq_a9_qemu/testsuites/samples
>  Python: 3.7.3 (default, Mar 26 2019, 21:43:19) [GCC 8.2.1 20181127]
> Host: Linux-5.0.5-arch1-1-ARCH-x86_64-with-arch (Linux varodek
> 5.0.5-arch1-1-ARCH #1 SMP PREEMPT Wed Mar 27 17:53:10 UTC 2019 x86_64 )
> [ 1/11] p:0  f:0  u:0  e:0  I:0  B:0  t:0  i:0  W:0  |
> arm/xilinx_zynq_a9_qemu: base_sp.exe
> [ 4/11] p:0  f:0  u:0  e:0  I:0  B:0  t:0  i:0  W:0  |
> arm/xilinx_zynq_a9_qemu: cxx_iostream.exe
> error: qemu.cfg:84: execute failed: qemu-system-arm -no-reboot -serial
> null -serial mon:stdio -nographic -net none -M xilinx-zynq-a9 -m 256M
> -kernel
> /home/varodek/development/rtems/kernel/xilinx_zynq_a9_qemu/arm-rtems5/c/xilinx_zynq_a9_qemu/testsuites/samples/base_sp.exe:
> exit-code:2
> error: qemu.cfg:84: execute failed: qemu-system-arm -no-reboot -serial
> null -serial mon:stdio -nographic -net none -M xilinx-zynq-a9 -m 256M
> -kernel
> /home/varodek/development/rtems/kernel/xilinx_zynq_a9_qemu/arm-rtems5/c/xilinx_zynq_a9_qemu/testsuites/samples/base_sp.exe:
> exit-code:2
> warning: switched to dry run due to errors
> [ 3/11] p:0  f:0  u:0  e:0  I:0  B:0  t:0  i:1  W:0  |
> arm/xilinx_zynq_a9_qemu: cdtest.exe
> error: qemu.cfg:84: execute failed: qemu-system-arm -no-reboot -serial
> null -serial mon:stdio -nographic -net none -M xilinx-zynq-a9 -m 256M
> -kernel
> /home/varodek/development/rtems/kernel/xilinx_zynq_a9_qemu/arm-rtems5/c/xilinx_zynq_a9_qemu/testsuites/samples/cxx_iostream.exe:
> exit-code:2
> error: qemu.cfg:84: execute failed: qemu-system-arm -no-reboot -serial
> null -serial mon:stdio -nographic -net none -M xilinx-zynq-a9 -m 256M
> -kernel
> /home/varodek/development/rtems/kernel/xilinx_zynq_a9_qemu/arm-rtems5/c/xilinx_zynq_a9_qemu/testsuites/samples/cxx_iostream.exe:
> exit-code:2
> warning: switched to dry run due to errors
> [ 2/11] p:0  f:0  u:0  e:0  I:0  B:0  t:0  i:2  W:0  |
> arm/xilinx_zynq_a9_qemu: capture.exe
> error: qemu.cfg:84: execute failed: qemu-system-arm -no-reboot -serial
> null -serial mon:stdio -nographic -net none -M xilinx-zynq-a9 -m 256M
> -kernel
> /home/varodek/development/rtems/kernel/xilinx_zynq_a9_qemu/arm-rtems5/c/xilinx_zynq_a9_qemu/testsuites/samples/cdtest.exe:
> exit-code:2
> error: qemu.cfg:84: execute failed: qemu-system-arm -no-reboot -serial
> null -serial mon:stdio -nographic -net none -M xilinx-zynq-a9 -m 256M
> -kernel
> /home/varodek/development/rtems/kernel/xilinx_zynq_a9_qemu/arm-rtems5/c/xilinx_zynq_a9_qemu/testsuites/samples/cdtest.exe:
> exit-code:2
> warning: switched to dry run due to errors
> error: qemu.cfg:84: execute failed: qemu-system-arm -no-reboot -serial
> null -serial mon:stdio -nographic -net none -M xilinx-zynq-a9 -m 256M
> -kernel
> /home/varodek/development/rtems/kernel/xilinx_zynq_a9_qemu/arm-rtems5/c/xilinx_zynq_a9_qemu/testsuites/samples/capture.exe:
> exit-code:2
> error: qemu.cfg:84: execute failed: qemu-system-arm -no-reboot -serial
> null -serial mon:stdio -nographic -net none -M xilinx-zynq-a9 -m 256M
> -kernel
> /home/varodek/development/rtems/kernel/xilinx_zynq_a9_qemu/arm-rtems5/c/xilinx_zynq_a9_qemu/testsuites/samples/capture.exe:
> exit-code:2
> warning: switched to dry run due to errors
> [ 1/11] p:0  f:0  u:0  e:0  I:0  B:0  t:0  i:0  W:0  |
> arm/xilinx_zynq_a9_qemu: base_sp.exe
> Result: invalidTime: 0:00:00.027521 base_sp.exe
> =>  run: qemu-system-arm -no-reboot -serial null -serial mon:stdio
> -nographic -net none -M xilinx-zynq-a9 -m 256M -kernel
> /home/varodek/development/rtems/kernel/xilinx_zynq_a9_qemu/arm-rtems5/c/xilinx_zynq_a9_qemu/testsuites/samples/base_sp.exe
> [ 2/11] p:0  f:0  u:0  e:0  I:0  B:0  t:0  i:2  W:0  |
> arm/xilinx_zynq_a9_qemu: capture.exe
> Result: invalidTime: 0:00:00.005902 capture.exe
> =>  run: qemu-system-arm -no-reboot -serial null -serial mon:stdio
> -nographic -net none -M xilinx-zynq-a9 -m 256M -kernel
> /home/varodek/development/rtems/kernel/xilinx_zynq_a9_qemu/arm-rtems5/c/xilinx_zynq_a9_qemu/testsuites/samples/capture.exe
> [ 3/11] p:0  f:0  u:0  e:0  I:0  B:0  t:0  i:1  W:0  |
> arm/xilinx_zynq_a9_qemu: cdtest.exe
> Result: invalidTime: 0:00:00.021361 cdtest.exe
> =>  run: qemu-system-arm -no-reboot -serial null -serial mon:stdio
> -nographic -net none -M xilinx-zynq-a9 -m 256M -kernel
> /home/varodek/development/rtems/kernel/xilinx_

[PATCH] libdl: Do not access the ELF file while the allocator is locked.

2019-05-02 Thread chrisj
From: Chris Johns 

- Load symbols before allocation.
- Parse reloc records and place any reloc recs in a cache to use
  while the allocator is locked.
- Relocate symbols after section allocation.
- Split section loading into allocation/locating and loading.
- Update all arch back-ends with a new reloc interface to control
  tramp handling.
- Add `-a` and `-t` to the object list shell command.

Closes #3741
---
 cpukit/include/rtems/rtl/rtl-obj.h|  38 +-
 cpukit/include/rtems/rtl/rtl-unresolved.h |  22 +-
 cpukit/include/rtems/rtl/rtl.h|   2 +-
 cpukit/libdl/rtl-allocator.c  |   2 +-
 cpukit/libdl/rtl-elf.c| 484 +++---
 cpukit/libdl/rtl-elf.h|  73 ++--
 cpukit/libdl/rtl-mdreloc-arm.c| 122 --
 cpukit/libdl/rtl-mdreloc-bfin.c   |  22 +-
 cpukit/libdl/rtl-mdreloc-h8300.c  |  22 +-
 cpukit/libdl/rtl-mdreloc-i386.c   |  18 +-
 cpukit/libdl/rtl-mdreloc-lm32.c   |  21 +-
 cpukit/libdl/rtl-mdreloc-m68k.c   | 174 
 cpukit/libdl/rtl-mdreloc-mips.c   |  24 +-
 cpukit/libdl/rtl-mdreloc-moxie.c  |  20 +-
 cpukit/libdl/rtl-mdreloc-powerpc.c|  69 ++-
 cpukit/libdl/rtl-mdreloc-sparc.c  |  26 +-
 cpukit/libdl/rtl-mdreloc-v850.c   |  20 +-
 cpukit/libdl/rtl-obj.c| 138 --
 cpukit/libdl/rtl-shell.c  |  59 ++-
 cpukit/libdl/rtl-trampoline.h |  94 +
 cpukit/libdl/rtl-unresolved.c | 137 --
 cpukit/libdl/rtl.c|  31 +-
 testsuites/libtests/dl08/init.c   |   2 +-
 testsuites/libtests/dl09/dl-o1.c  |   1 +
 testsuites/libtests/dl09/dl09.doc |   2 +-
 testsuites/libtests/dl09/init.c   |   2 +-
 26 files changed, 1098 insertions(+), 527 deletions(-)
 create mode 100644 cpukit/libdl/rtl-trampoline.h

diff --git a/cpukit/include/rtems/rtl/rtl-obj.h 
b/cpukit/include/rtems/rtl/rtl-obj.h
index 9c2b4f0300..f27ae3259d 100644
--- a/cpukit/include/rtems/rtl/rtl-obj.h
+++ b/cpukit/include/rtems/rtl/rtl-obj.h
@@ -207,7 +207,7 @@ struct rtems_rtl_obj
   size_t  text_size;/**< The size of the text section. */
   void*   const_base;   /**< The base address of the const section
  *   in memory. */
-  size_t  const_size;/**< The size of the const section. */
+  size_t  const_size;   /**< The size of the const section. */
   void*   eh_base;  /**< The base address of the eh section in
  *   memory. */
   size_t  eh_size;  /**< The size of the eh section. */
@@ -227,10 +227,14 @@ struct rtems_rtl_obj
  *   obj. */
   void*   trampoline;   /**< Trampoline memory. Used for fixups or
  *   veneers */
-  size_t  tramp_size;   /**< Size of the tramopline memory. */
+  size_t  tramp_size;   /**< Size of a tramopline slot. */
+  size_t  tramps_size;  /**< Size of the trampoline memory. */
   void*   tramp_brk;/**< Trampoline memory allocator. MD
  *   relocators can take memory from the
  *   break upto the size. */
+  size_t  tramp_relocs; /**< Number of slots reserved for
+ *   relocs. The remainder are for
+ *   unresolved symbols. */
   struct link_map*linkmap;  /**< For GDB. */
   void*   loader;   /**< The file details specific to a
  *   loader. */
@@ -370,11 +374,35 @@ static inline bool rtems_rtl_obj_has_symbol (const 
rtems_rtl_obj* obj,
  * @param size The size to be allocated.
  * @retval bool Returns @true if the space is available.
  */
-static inline bool rtems_rtl_obj_has_ramp_space (const rtems_rtl_obj* obj,
- const size_t size)
+static inline bool rtems_rtl_obj_has_tramp_space (const rtems_rtl_obj* obj,
+  const size_t size)
 {
   return (obj->trampoline != NULL &&
-  ((obj->tramp_brk - obj->trampoline) + size) <= obj->tramp_size);
+  ((obj->tramp_brk - obj->trampoline) + size) <= obj->tramps_size);
+}
+
+/**
+ * Trampoline slots.
+ *
+ * @param obj The object file's descriptor.
+ * @retval size_t The number of trampoline slots.
+ */
+static inline size_t rtems_rtl_obj_trampoline_slots (const rtems_rtl_obj* obj)
+{
+  return obj->trampoline == NULL || obj->tramp_size == 0 ?
+0 : obj->tramps_size / obj->tramp_size;
+}
+
+/**
+ * Number of trampolines.
+ *
+ * @param obj The object file's descriptor.
+ * @retval size_t The number of trampolines.
+ */
+static inline size_t rtems_rtl_obj_trampol

[PATCH] libdl allocator deadlock

2019-05-02 Thread chrisj
Hi,

This patch fixes the deadlock with libbsd's nfs client when loading ELF
images. I have built and test psim and xilinx A9 qemu bsps. I will try
and build all archs over the weekend.

Please test and report if this fixes the deadlock.

Thanks
Chris


___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


Re: Error during execution of testsuites on host OS, for ARM Architecture.

2019-05-02 Thread Chris Johns
On 3/5/19 2:49 am, Gedare Bloom wrote:
> Try to manually run the executable directly by qemu. Ask if you need more 
> direction

Good advice. Also the command line for qemu can be seen by adding `--trace` to
the `rtems-test` command line and then looking in the log file. I suggest you
run a single test until it is working.

Chris
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


Re: Error during execution of testsuites on host OS, for ARM Architecture.

2019-05-02 Thread Joel Sherrill
Hi

I tried to post this earlier but was having outgoing mail problems.

The command varies between versions of qemu. It is likely the rtems-tester
configuration file
for this BSP doesn't match the version of qemu you have built. This is from
a shell script
I use on an application. Notice the difference in arguments due to qemu
version.

 #echo "-no-reboot -serial null -serial mon:stdio -net none -nographic -M
xilinx-zynq-a9 -m 256M ${COVERAGE_ARG} -kernel ${1}"
  echo "-no-reboot -monitor none -serial stdio -net none -nographic -M
xilinx-zynq-a9 -m 256M ${COVERAGE_ARG} -kernel ${1}"

--joel

On Thu, May 2, 2019, 7:50 PM Chris Johns  wrote:

> On 3/5/19 2:49 am, Gedare Bloom wrote:
> > Try to manually run the executable directly by qemu. Ask if you need
> more direction
>
> Good advice. Also the command line for qemu can be seen by adding
> `--trace` to
> the `rtems-test` command line and then looking in the log file. I suggest
> you
> run a single test until it is working.
>
> Chris
> ___
> devel mailing list
> devel@rtems.org
> http://lists.rtems.org/mailman/listinfo/devel
>
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: Error during execution of testsuites on host OS, for ARM Architecture.

2019-05-02 Thread Chris Johns

> On 3 May 2019, at 10:55 am, Joel Sherrill  wrote:
> 
> Hi
> 
> I tried to post this earlier but was having outgoing mail problems.
> 
> The command varies between versions of qemu. It is likely the rtems-tester 
> configuration file
> for this BSP doesn't match the version of qemu you have built. This is from a 
> shell script
> I use on an application. Notice the difference in arguments due to qemu 
> version.
> 
>  #echo "-no-reboot -serial null -serial mon:stdio -net none -nographic -M 
> xilinx-zynq-a9 -m 256M ${COVERAGE_ARG} -kernel ${1}"
>   echo "-no-reboot -monitor none -serial stdio -net none -nographic -M 
> xilinx-zynq-a9 -m 256M ${COVERAGE_ARG} -kernel ${1}"

Yes. The `rtems-test` command if configured to use the RSB built version of 
qemu.

Do you know version is which command line?

Chris
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: Error during execution of testsuites on host OS, for ARM Architecture.

2019-05-02 Thread Joel Sherrill
On Thu, May 2, 2019, 7:58 PM Chris Johns  wrote:

>
> On 3 May 2019, at 10:55 am, Joel Sherrill  wrote:
>
> Hi
>
> I tried to post this earlier but was having outgoing mail problems.
>
> The command varies between versions of qemu. It is likely the rtems-tester
> configuration file
> for this BSP doesn't match the version of qemu you have built. This is
> from a shell script
> I use on an application. Notice the difference in arguments due to qemu
> version.
>
>  #echo "-no-reboot -serial null -serial mon:stdio -net none -nographic -M
> xilinx-zynq-a9 -m 256M ${COVERAGE_ARG} -kernel ${1}"
>   echo "-no-reboot -monitor none -serial stdio -net none -nographic -M
> xilinx-zynq-a9 -m 256M ${COVERAGE_ARG} -kernel ${1}"
>
>
> Yes. The `rtems-test` command if configured to use the RSB built version
> of qemu.
>
> Do you know version is which command line
>

Not off hand. I recall being unable to build the default Qemu package so it
is probably the couverture one.


> Chris
>
>
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel