[RTEMS Project] #2993: SMP assert in _Thread_Executing in libdebugger

RTEMS trac trac at rtems.org
Fri Apr 14 06:02:14 UTC 2017


#2993: SMP assert in _Thread_Executing in libdebugger
-------------------------+-----------------------------
 Reporter:  Chris Johns  |      Owner:  joel.sherrill@…
     Type:  defect       |     Status:  new
 Priority:  normal       |  Milestone:  4.12.0
Component:  cpukit       |    Version:  4.12
 Severity:  normal       |   Keywords:
-------------------------+-----------------------------
 The target code in libdebugger has support to recover from exceptions
 related to invalid memory accesses. GDB may request the server access
 memory on the target that results in an exception. The exception occurs on
 the server's remote connection thread and the server needs to recover and
 return and error to GDB.

 Running the debugger01 test with an SMP build of RTEMS and libbsd for
 {{{xilinx_zedboard}}} and issuing {{{bt}}} in GDB results in:

 {{{
 *** LIBBSD DEBUGGER 1 TEST ***
 [144/1950]
 shell:cannot set terminal attributes(/dev/console)

 RTEMS Shell on /devn/ecxounss0o:l e<.R TUEsMeS  'Nheexlups'  dteov
 ilcies>t
  ccogmemma0n:d s<.C
 adence CGEM Gigabit Ethernet Interface> on nexus0
 miibus0: <MII bus> on cgem0
 [/] # e1000phy0: <Marvell 88E1512 Gigabit PHY> PHY 0 on miibus0
 e1000phy0:  none, 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX,
 1000baseT-FDX, 1000baseT-FDX-master, auto
 cgem0: Ethernet address: fa:69:35:9e:04:2f
 zy7_slcr0: <Zynq-7000 slcr block> on nexus0
 [zone: udpcb] kern.ipc.maxsockets limit reached
 notice: cgem0: link state changed to DOWN
 add host 10.10.5.1: gateway cgem0
 add net default: gateway 10.10.5.1
 rtems-db: remote running
 rtems-db: tcp remote: listing on port: 1122
 notice: cgem0: link state changed to UP

 rtems-db: tcp remote: connect host: 10.10.5.2
 rtems-db: arm debug: (v3.0) ARMv7 [v7, all CP14 registers] breakpoints:5
 watchpoints:3
 assertion "cpu_self->thread_dispatch_disable_level != 0 ||
 _ISR_Get_level() != 0" failed: file
 "../../cpukit/../../../xilinx_zynq_zedboard/lib/include/rtems/score/percpu.h",
 line 630, function: _Per_CPU_Get
 }}}

 If I enable {{{TARGET_DEBUG}}} in libdebugger and apply the attached patch
 I can create the assert with {{{DIE_ON_ASSERT}}} set to {{{1}}}. The
 output is:

 {{{
  rtems-db: tcp remote: connect host: 10.10.5.2
 rtems-db: arm debug: (v3.0) ARMv7 [v7, all CP14 registers] breakpoints:5
 watchpoints:3
 [} frame = 005664EC sig=1 vector=4 ifsr=00000000 pra=0024173A
 [}  R0 = 00000158  R1 = 00000004  R2 = 00000001  R3 = 0041AB64
 [}  R4 = 00000158  R5 = 00000004  R6 = 00000000  R7 = 005606A4
 [}  R8 = 00000016  R9 = 00000001 R10 = 00000006 R11 = 0041AB64
 [} R12 = 00560658  SP = 00566540  LR = 00000FFD  PC = 00241736
 [}  CPSR = 08010173 ----Q--A-FT GE:0 IT:01 M:13 SVC
 [} target exception: 0 0 0
 assertion "cpu_self->thread_dispatch_disable_level != 0 ||
 _ISR_Get_level() != 0" failed: file
 "../../cpukit/../../../xilinx_zynq_zedboard/lib/include/rtems/score/percpu.h",
 line 630, function: _Per_CPU_Get
 }}}

 and set to {{{0}}:

 {{{
 rtems-db: tcp remote: connect host: 10.10.5.2
 rtems-db: arm debug: (v3.0) ARMv7 [v7, all CP14 registers] breakpoints:5
 watchpoints:3
 [} frame = 005664EC sig=1 vector=4 ifsr=00000000 pra=0024173A
 [}  R0 = 00000158  R1 = 00000004  R2 = 00000001  R3 = 0041AB64
 [}  R4 = 00000158  R5 = 00000004  R6 = 00000000  R7 = 005606A4
 [}  R8 = 00000016  R9 = 00000001 R10 = 00000006 R11 = 0041AB64
 [} R12 = 00560658  SP = 00566540  LR = 00000FFD  PC = 00241736
 [}  CPSR = 08010173 ----Q--A-FT GE:0 IT:01 M:13 SVC
 [} target exception: 0 0 0
 [} tid:0A01000A: thread:0041F5B0 frame:005664EC
 [} server access fault
 [} frame = 005664EC sig=1 vector=4 ifsr=00000000 pra=0024173A
 [}  R0 = 00000158  R1 = 00000004  R2 = 00000001  R3 = 0041AB64
 [}  R4 = 00000158  R5 = 00000004  R6 = 00000000  R7 = 005606A4
 [}  R8 = 00000016  R9 = 00000001 R10 = 00000006 R11 = 0041AB64
 [} R12 = 00560658  SP = 00566540  LR = 00000FFD  PC = 00241736
 [}  CPSR = 08010173 ----Q--A-FT GE:0 IT:01 M:13 SVC
 [} target exception: 0 0 0
 [} tid:0A01000A: thread:0041F5B0 frame:005664EC
 [} server access fault
 }}}

 The following lines first two values are
 {{{cpu_self->thread_dispatch_disable_level}}} and {{{_ISR_Get_level()}}}
 which are both {{{0}}} so I cannot see a reason the assert is happening:

 {{{
 [} target exception: 0 0 0
 }}}

--
Ticket URL: <http://devel.rtems.org/ticket/2993>
RTEMS Project <http://www.rtems.org/>
RTEMS Project


More information about the bugs mailing list