Message-ID: Content-Type: multipart/alternative; boundary="_f3d9f8c0-7050-4719-abce-64fbd49ddaee_" From: Fabio Visona Date: Fri, 13 Apr 2012 16:49:13 +0200 MIME-Version: 1.0 Subject: [Xenomai-help] rt_event_wait makes linux crash if executed while debugging with gdbserver List-Id: Help regarding installation and common use of Xenomai List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: xenomai@xenomai.org --_f3d9f8c0-7050-4719-abce-64fbd49ddaee_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hello=2C =20 I am trying to debug a Xenomai task through gdbserver over ethernet=2C with= : =20 gdbserver host:12345 --attach 240 =20 where 240 is the PID of the Xenomai real-time task I want to debug. =20 After connecting with the gdb client=2C running continuosly is fine=2C but = if I put a breakpoint and afterwards make the software execute an rt_event_= wait call=2C the system crashes (gdb client stuck=2C no more ethernet conne= ction=2C no panic message on the debug console serial port). =20 By going step by step with the debugger=2C the exact point of the problem c= an be isolated: =20 int rt_event_wait(RT_EVENT *event=2C unsigned long mask=2C unsigned long *mask_r=2C int mode=2C RTIME timeout= ) { int ret=3B ret =3D XENOMAI_SKINCALL5(__native_muxid=2C __native_event_wait=2C event=2C &mask=2C mode=2C XN_RELATIVE=2C &timeout)=3B if (ret) return ret=3B =20 *mask_r =3D mask=3B =20 return 0=3B } =20 with mode =3D EV_ANY=2C timeout is 10000 - 100000 ns about. =20 Showing the assembly code of the XENOMAI_SKINCALL5 macro: =20 0x64fc4e : R3 =3D 0x0 (X)=3B /* R3=3D0x0( 0) */ 0x64fc50 : R7.L =3D 0x22b=3B /* (555) R7=3D0x0x27022b(= 2556459) */ 0x64fc54 : JUMP.S 0x0x64fc60 =3B 0x64fc56 : R0 =3D P1=3B 0x64fc58 : R1 =3D -0x55 (X)=3B /* R1=3D0x0xffffffab(-= 85) */ 0x64fc5c : CC =3D R0 =3D=3D R1=3B 0x64fc5e : IF !CC JUMP 0x0x64fc9e = =3B 0x64fc60 : [FP + -0x848] =3D R3=3B 0x64fc64 : R1 =3D R6=3B 0x64fc66 : R2 =3D P4=3B 0x64fc68 : R0 =3D [P5]=3B 0x64fc6a : R0 =3D R0 | R7=3B 0x64fc6c : P0 =3D R0=3B 0x64fc6e : R0 =3D P3=3B 0x64fc70 : EXCPT 0x0=3B <<<<<<<<<<<<<<<<<<<<<<<<<<= <<<<<<<<<<<<<<<<<<<<<<<< 0x64fc72 : P1 =3D R0=3B 0x64fc74 : R0 =3D [FP + -0x848]=3B =20 Execution crashes at EXCPT 0x0=2C which should be a system call=2C accordin= g to Xenomai sources (syscall.h). =20 Xenomai version is 2.5.3=2C Linux 2.6.34.7=2C running on a Blackfin BF518 p= rocessor. =20 Note that everything works fine running the application without debugger. =20 Any hint? Thank you very much in advance. = --_f3d9f8c0-7050-4719-abce-64fbd49ddaee_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hello=2C
 =3B
I am trying to debug a Xenomai task through gdbserver over ethernet=2C with= :
 =3B
gdbserver host:12345 --attach 240
 =3B
where 240 is the PID of the Xenomai real-time task I want to debug.
 =3B
After connecting with the gdb client=2C running continuosly is fine=2C but = if I put a breakpoint and afterwards make the software execute an rt_event_= wait call=2C the system crashes (gdb client stuck=2C no more ethernet conne= ction=2C no panic message on the debug console serial port).
 =3B
By going step by step with the debugger=2C the exact point of the problem c= an be isolated:
 =3B
int rt_event_wait(RT_EVENT *event=2C
 =3B =3B =3B =3B&nb= sp=3B =3B =3B =3B =3B =3B =3B =3B =3B = =3B =3B =3B =3B =3B =3B =3B =3B =3B =3B=  =3B unsigned long mask=2C
 =3B =3B =3B =3B =3B&= nbsp=3B =3B =3B =3B =3B =3B =3B =3B =3B&nbs= p=3B =3B =3B =3B =3B =3B =3B =3B =3B = =3B unsigned long *mask_r=2C int mode=2C RTIME timeout)
{
 =3B&nb= sp=3B =3B =3B int ret=3B

 =3B =3B =3B ret =3D XE= NOMAI_SKINCALL5(__native_muxid=2C
 =3B =3B =3B  =3B = =3B =3B =3B =3B__native_event_wait=2C
 =3B =3B = =3B  =3B =3B =3B =3B =3Bevent=2C &=3Bmask=2C mode=2C= XN_RELATIVE=2C &=3Btimeout)=3B
 =3B =3B =3B =3Bif (r= et)
 =3B  =3B =3B =3Breturn ret=3B
 =3B =3B&n= bsp=3B
 =3B  =3B =3B*mask_r =3D mask=3B
 =3B
 = =3B =3Breturn 0=3B
}
 =3B
with mode =3D EV_ANY=2C timeout is 10000 - 100000 ns about.
 =3B
Showing the assembly code of the XENOMAI_SKINCALL5 macro:
 =3B
 =3B0x64fc4e =3B<=3Brt_event_wait+42>=3B: =3B =3BR3 =3D= 0x0 (X)=3B =3B =3B/* =3B =3BR3=3D0x0( =3B 0) */
&nb= sp=3B0x64fc50 =3B<=3Brt_event_wait+44>=3B: =3B =3BR7.L =3D = 0x22b=3B =3B =3B/* (555) =3BR7=3D0x0x27022b(2556459) */
&nbs= p=3B0x64fc54 =3B<=3Brt_event_wait+48>=3B: =3B =3BJUMP.S 0x0= x64fc60 <=3Brt_event_wait+60>=3B=3B
 =3B0x64fc56 =3B<=3Brt= _event_wait+50>=3B: =3B =3BR0 =3D P1=3B
 =3B0x64fc58 = =3B<=3Brt_event_wait+52>=3B: =3B =3BR1 =3D -0x55 (X)=3B =3B=  =3B/* =3B =3BR1=3D0x0xffffffab(-85) */
 =3B0x64fc5c&nbs= p=3B<=3Brt_event_wait+56>=3B: =3B =3BCC =3D R0 =3D=3D R1=3B
=  =3B0x64fc5e =3B<=3Brt_event_wait+58>=3B: =3B =3BIF !CC= JUMP 0x0x64fc9e <=3Brt_event_wait+122>=3B=3B
 =3B0x64fc60 = =3B<=3Brt_event_wait+60>=3B: =3B =3B[FP + -0x848] =3D R3=3B
=  =3B0x64fc64 =3B<=3Brt_event_wait+64>=3B: =3B =3BR1 =3D= R6=3B
 =3B0x64fc66 =3B<=3Brt_event_wait+66>=3B: =3B&nbs= p=3BR2 =3D P4=3B
 =3B0x64fc68 =3B<=3Brt_event_wait+68>=3B:&n= bsp=3B =3BR0 =3D [P5]=3B
 =3B0x64fc6a =3B<=3Brt_event_wait= +70>=3B: =3B =3BR0 =3D R0 | R7=3B
 =3B0x64fc6c =3B<= =3Brt_event_wait+72>=3B: =3B =3BP0 =3D R0=3B
 =3B0x64fc6e&= nbsp=3B<=3Brt_event_wait+74>=3B: =3B =3BR0 =3D P3=3B
 = =3B0x64fc70 =3B<=3Brt_event_wait+76>=3B: =3B =3BEXCPT 0x0= =3B =3B =3B =3B =3B =3B <=3B<=3B<=3B<=3B<=3B&= lt=3B<=3B<=3B<=3B<=3B<=3B<=3B<=3B<=3B<=3B<=3B<=3B<= =3B<=3B<=3B<=3B<=3B<=3B<=3B<=3B<=3B<=3B<=3B<=3B<=3B= <=3B<=3B<=3B<=3B<=3B<=3B<=3B<=3B<=3B<=3B<=3B<=3B<= =3B<=3B<=3B<=3B<=3B<=3B<=3B<=3B
 =3B0x64fc72 =3B&l= t=3Brt_event_wait+78>=3B: =3B =3BP1 =3D R0=3B
 =3B0x64fc74=  =3B<=3Brt_event_wait+80>=3B: =3B =3BR0 =3D [FP + -0x848]= =3B
 =3B
Execution crashes at EXCPT 0x0=2C which should be a system call=2C accordin= g to Xenomai sources (syscall.h).
 =3B
Xenomai version is 2.5.3=2C Linux 2.6.34.7=2C running on a Blackfin BF518 p= rocessor.
 =3B
Note that everything works fine running the application without debugger.  =3B
Any hint?
Thank you very much in advance.

 =3B
= --_f3d9f8c0-7050-4719-abce-64fbd49ddaee_--