From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <5298B3C4.6050203@xenomai.org> Date: Fri, 29 Nov 2013 16:33:24 +0100 From: Philippe Gerum MIME-Version: 1.0 References: <20131128143152.04ac3eab.norbert.bukuli@mediso.hu> <5297BD30.4060007@xenomai.org> <20131129094157.3d7202e1.norbert.bukuli@mediso.hu> <52985E94.4070101@xenomai.org> <20131129112736.3be45065.norbert.bukuli@mediso.hu> In-Reply-To: <20131129112736.3be45065.norbert.bukuli@mediso.hu> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Xenomai] test suite programs crash with Illegal instruction on MPC5200 List-Id: Discussions about the Xenomai project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Bukuli Norbert Cc: Xenomai On 11/29/2013 11:27 AM, Bukuli Norbert wrote: > > > On Fri, 29 Nov 2013 10:29:56 +0100 > Philippe Gerum wrote: >> On 11/29/2013 09:41 AM, Bukuli Norbert wrote: >>> (gdb) cont >>> Continuing. >>> warning: Could not load shared library symbols for >>> linux-vdso32.so.1. Do you need "set solib-search-path" or "set >>> sysroot"? warning: .dynamic section for >>> "/opt/eldk-5.4/powerpc/sysroots/powerpc-linux/usr/xenomai/lib/libpthread_rt.so.1" >>> is not at the expected address (wrong library or version mismatch?) >>> warning: .dynamic section for >>> "/opt/eldk-5.4/powerpc/sysroots/powerpc-linux/usr/xenomai/lib/libxenomai.so.0" >>> is not at the expected address (wrong library or version mismatch?) >> >> These warnings may trigger with recent broken gdbserver releases, >> let's ignore them. >> https://sourceware.org/ml/gdb-patches/2013-06/msg00054.html > OK > >> >>> [New Thread 280] >>> >>> Program received signal SIGILL, Illegal instruction. >>> [Switching to Thread 280] >>> 0x0fdf4e74 in ?? () >>> from /opt/eldk-5.4/powerpc/sysroots/powerpc-linux/lib/libc.so.6 >>> >> >> (gdb) disass $pc-64 $pc+20 > (gdb) disass $pc-64,$pc+20 > Dump of assembler code from 0xfdf4e34 to 0xfdf4e88: > 0x0fdf4e34: .long 0x3894 > 0x0fdf4e38: .long 0x12b8a4 > 0x0fdf4e3c: .long 0x80 > 0x0fdf4e40: vaddfp v16,v0,v0 > 0x0fdf4e44: .long 0x19fb > 0x0fdf4e48: .long 0xe99c8 > 0x0fdf4e4c: .long 0xa0 > 0x0fdf4e50: vaddfp v16,v0,v0 > 0x0fdf4e54: .long 0x2742 > 0x0fdf4e58: .long 0xe375c > 0x0fdf4e5c: .long 0x4c > 0x0fdf4e60: subfic r16,r0,10 > 0x0fdf4e64: .long 0x378a > 0x0fdf4e68: .long 0xf834c > 0x0fdf4e6c: .long 0x58 > 0x0fdf4e70: vaddfp v16,v0,v0 > => 0x0fdf4e74: .long 0x5a3e > 0x0fdf4e78: .long 0xe286c > 0x0fdf4e7c: .long 0x68 > 0x0fdf4e80: vaddfp v16,v0,v0 > 0x0fdf4e84: .long 0x80e > End of assembler dump > >> >> would help at this point. >> >>> (gdb) bt >>> #0 0x0fdf4e74 in ?? () >>> from /opt/eldk-5.4/powerpc/sysroots/powerpc-linux/lib/libc.so.6 #1 >>> 0x0ffd8af8 in sched_setconfig_np () >>> from /opt/eldk-5.4/powerpc/sysroots/powerpc-linux/usr/xenomai/lib/libpthread_rt.so.1 >>> #2 0x0ff7ba68 in start_thread (arg=0xbffffdd0) at >>> pthread_create.c:313 >> >> Is sched_setconfig_np() really the start routine given to >> pthread_create() in your application, I guess not. Or could this >> weird backtrace reveal a stack overflow? > This is the clocktest, not my trivial posix skin test. The start > routine in that is "cpu_thread()" in clocktest.c:196 in xenomai-2.6.3. > > Debugging of the trivial posix skin test (my application): > (gdb) set sysroot /opt/eldk-5.4/powerpc/sysroots/powerpc-linux > (gdb) cont > The program is not being run. > (gdb) target remote 172.31.2.11:2001 > Remote debugging using 172.31.2.11:2001 > Reading symbols from /opt/eldk-5.4/powerpc/sysroots/powerpc-linux/lib/ld.so.1...Reading symbols from /opt/eldk-5.4/powerpc/sysroots/powerpc-linux/lib/.debug/ld-2.17.so...done. > done. > Loaded symbols for /opt/eldk-5.4/powerpc/sysroots/powerpc-linux/lib/ld.so.1 > _start () at ../sysdeps/powerpc/powerpc32/dl-start.S:32 > 32 ../sysdeps/powerpc/powerpc32/dl-start.S: No such file or directory. > (gdb) cont > Continuing. > warning: Could not load shared library symbols for linux-vdso32.so.1. > Do you need "set solib-search-path" or "set sysroot"? > warning: .dynamic section for "/opt/eldk-5.4/powerpc/sysroots/powerpc-linux/usr/xenomai/lib/libpthread_rt.so.1" is not at the expected address (wrong library or version mismatch?) > warning: .dynamic section for "/opt/eldk-5.4/powerpc/sysroots/powerpc-linux/usr/xenomai/lib/libxenomai.so.0" is not at the expected address (wrong library or version mismatch?) > [New Thread 336] > > Program received signal SIGTRAP, Trace/breakpoint trap. > [Switching to Thread 336] > 0x480319f8 in ?? () > (gdb) bt > #0 0x480319f8 in ?? () > #1 0x0ffd8af8 in sched_setconfig_np () > from /opt/eldk-5.4/powerpc/sysroots/powerpc-linux/usr/xenomai/lib/libpthread_rt.so.1 > #2 0x0ff7ba68 in start_thread (arg=0xbffffdd0) at pthread_create.c:313 > #3 0x4802ff18 in _rtld_global_ro () from /opt/eldk-5.4/powerpc/sysroots/powerpc-linux/lib/ld.so.1 > Backtrace stopped: frame did not save the PC > > (gdb) disass $pc-64,$pc+20 > Dump of assembler code from 0x480319b8 to 0x48031a0c: > 0x480319b8: .long 0x0 > 0x480319bc: .long 0x0 > 0x480319c0: .long 0x0 > 0x480319c4: .long 0x0 > 0x480319c8: .long 0x0 > 0x480319cc: .long 0x0 > 0x480319d0: cmpi cr6,1,r21,29554 > 0x480319d4: cmpi cr6,1,r24,25966 > 0x480319d8: xoris r13,r27,24937 > 0x480319dc: cmpi cr6,1,r12,26978 > 0x480319e0: cmpi cr6,1,r12,26978 > 0x480319e4: andi. r20,r3,26738 > 0x480319e8: oris r1,r11,25695 > 0x480319ec: andi. r20,r19,11891 > 0x480319f0: xoris r14,r25,12544 > 0x480319f4: .long 0x0 > => 0x480319f8: twi 31,r29,16384 > 0x480319fc: b 0x480633cc > 0x48031a00: twi 31,r30,-3476 > 0x48031a04: b 0x480636cc > 0x48031a08: b 0x48062e90 > End of assembler dump. > > (gdb) frame 1 > #1 0x0ffd8af8 in sched_setconfig_np () > from /opt/eldk-5.4/powerpc/sysroots/powerpc-linux/usr/xenomai/lib/libpthread_rt.so.1 > (gdb) disass $pc-64,$pc+20 > Dump of assembler code from 0xffd8ab8 to 0xffd8b0c: > 0x0ffd8ab8 : bl 0xffef720 > 0x0ffd8abc : addi r3,r31,20 > 0x0ffd8ac0 : bl 0xffef540 <__real_sem_post@plt> > 0x0ffd8ac4 : lwz r9,8(r1) > 0x0ffd8ac8 : cmpw cr7,r9,r25 > 0x0ffd8acc : beq- cr7,0xffd8b38 > 0x0ffd8ad0 : cmpwi cr7,r28,0 > 0x0ffd8ad4 : beq- cr7,0xffd8aec > 0x0ffd8ad8 : lis r0,512 > 0x0ffd8adc : li r3,1 > 0x0ffd8ae0: ori r0,r0,555 > 0x0ffd8ae4 : sc > 0x0ffd8ae8 : mfcr r0 > 0x0ffd8aec : mtctr r27 > 0x0ffd8af0 : mr r3,r26 > 0x0ffd8af4 : bctrl > => 0x0ffd8af8 : li r4,0 > 0x0ffd8afc : mr r31,r3 > 0x0ffd8b00 : lis r3,4 > 0x0ffd8b04 : bl 0xffef5e0 > 0x0ffd8b08 : lwz r0,68(r1) > End of assembler dump. > > Please, note, that the file, in frame 1 in not equal to the actually used one, I do not use Xenomai provided by ELDK, I compiled it separately. > Which explains why the symbol resolution in this disassembly does not make any sense. This is going to be quite hard to find out what goes wrong in your setup until we do know what code is running. Step 1. Did you ever try running the Xenomai libraries as shipped in the eldk 5.4, keeping your kernel? Does clocktest runs fine there? We need to know whether this is an issue with how your own Xenomai install is built, or if a library mismatch is at work on your setup. -- Philippe.