All of lore.kernel.org
 help / color / mirror / Atom feed
From: Philippe Gerum <rpm@xenomai.org>
To: Bukuli Norbert <norbert.bukuli@mediso.hu>
Cc: Xenomai <xenomai@xenomai.org>
Subject: Re: [Xenomai] test suite programs crash with Illegal instruction on MPC5200
Date: Fri, 29 Nov 2013 16:33:24 +0100	[thread overview]
Message-ID: <5298B3C4.6050203@xenomai.org> (raw)
In-Reply-To: <20131129112736.3be45065.norbert.bukuli@mediso.hu>

On 11/29/2013 11:27 AM, Bukuli Norbert wrote:
>
>
> On Fri, 29 Nov 2013 10:29:56 +0100
> Philippe Gerum <rpm@xenomai.org> 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 <pthread_set_name_np+52>:	bl      0xffef720 <sigemptyset@plt>
>     0x0ffd8abc <pthread_set_name_np+56>:	addi    r3,r31,20
>     0x0ffd8ac0 <pthread_set_name_np+60>:	bl      0xffef540 <__real_sem_post@plt>
>     0x0ffd8ac4 <pthread_set_name_np+64>:	lwz     r9,8(r1)
>     0x0ffd8ac8 <pthread_set_name_np+68>:	cmpw    cr7,r9,r25
>     0x0ffd8acc <pthread_set_name_np+72>:	beq-    cr7,0xffd8b38 <sched_setconfig_np+84>
>     0x0ffd8ad0 <pthread_set_name_np+76>:	cmpwi   cr7,r28,0
>     0x0ffd8ad4 <pthread_set_name_np+80>:	beq-    cr7,0xffd8aec <sched_setconfig_np+8>
>     0x0ffd8ad8 <pthread_set_name_np+84>:	lis     r0,512
>     0x0ffd8adc <pthread_set_name_np+88>:	li      r3,1
>     0x0ffd8ae0:	ori     r0,r0,555
>     0x0ffd8ae4 <sched_setconfig_np+0>:	sc
>     0x0ffd8ae8 <sched_setconfig_np+4>:	mfcr    r0
>     0x0ffd8aec <sched_setconfig_np+8>:	mtctr   r27
>     0x0ffd8af0 <sched_setconfig_np+12>:	mr      r3,r26
>     0x0ffd8af4 <sched_setconfig_np+16>:	bctrl
> => 0x0ffd8af8 <sched_setconfig_np+20>:	li      r4,0
>     0x0ffd8afc <sched_setconfig_np+24>:	mr      r31,r3
>     0x0ffd8b00 <sched_setconfig_np+28>:	lis     r3,4
>     0x0ffd8b04 <sched_setconfig_np+32>:	bl      0xffef5e0 <open@plt>
>     0x0ffd8b08 <sched_setconfig_np+36>:	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.


  reply	other threads:[~2013-11-29 15:33 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-28 13:31 [Xenomai] test suite programs crash with Illegal instruction on MPC5200 Bukuli Norbert
2013-11-28 20:17 ` Gilles Chanteperdrix
2013-11-28 20:30   ` Gilles Chanteperdrix
2013-11-29  7:59     ` Bukuli Norbert
2013-11-29  7:45   ` Bukuli Norbert
2013-11-28 22:01 ` Philippe Gerum
2013-11-29  8:41   ` Bukuli Norbert
2013-11-29  8:41   ` Bukuli Norbert
2013-11-29  9:29     ` Philippe Gerum
2013-11-29  9:34       ` Philippe Gerum
2013-11-29 10:44         ` Bukuli Norbert
2013-11-29 10:27       ` Bukuli Norbert
2013-11-29 15:33         ` Philippe Gerum [this message]
2013-12-02  7:50           ` Bukuli Norbert
2013-11-29 22:53       ` Wolfgang Denk
2013-12-02  8:50         ` Bukuli Norbert
2013-12-02  9:15           ` Philippe Gerum
2013-12-02  9:24             ` Bukuli Norbert
2013-12-02  9:41               ` Philippe Gerum
2013-12-02  9:44                 ` Bukuli Norbert
2013-12-02  9:58           ` Philippe Gerum
2013-12-02 10:16             ` Bukuli Norbert
2013-12-09 14:52               ` Bukuli Norbert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5298B3C4.6050203@xenomai.org \
    --to=rpm@xenomai.org \
    --cc=norbert.bukuli@mediso.hu \
    --cc=xenomai@xenomai.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.