adafruit / Adafruit_Mynewt

Apache Mynewt documentation and test project for the nRF5x family of BLE SoCs
MIT License
8 stars 3 forks source link

nustest command unexpectedly run on crash #21

Closed microbuilder closed 8 years ago

microbuilder commented 8 years ago

To do some pre-release tests I enabled the crash_test library in the throughput app, just to make sure tasks can die properly and to test out some of the logging and debugging tools.

Building the throughput example you can run the crash command from the shell with a specific error like crash div0 or crash jump0.

The tasks fail gracefully, but every time an error occurs nustest is being executed unexpectedly, which shouldn't be happening:

?
6185:     echo         ?     tasks  mempools      date     crash 
6189:      log      stat   nustest 
crash
9945:Usage crash [div0|jump0|ref0|assert]

crash div0
15145:Unhandled interrupt (3), exception sp 0x2000a960
15145: r0:0x00000000  r1:0x000242bd  r2:0x00000000  r3:0x0000002a
15145: r4:0x00000000  r5:0x2000c002  r6:0x2000bffc  r7:0x00025e34
15145: r8:0x0000d04d  r9:0x0000000c r10:0x20009068 r11:0x55555556
15145:r12:0x2000a8e8  lr:0x00009e45  pc:0x00009e54 psr:0x61000000
15145:ICSR:0x00419803 HFSR:0x40000000 CFSR:0x02000000
15145:BFAR:0xe000ed38 MMFAR:0xe000ed34
nustest <count> <packetsize>

crash jump0 
52128:Unhandled interrupt (3), exception sp 0x2000a960
52128: r0:0x00000000  r1:0x000242d2  r2:0x00000000  r3:0x00000000
52128: r4:0x00000000  r5:0x2000c002  r6:0x2000bffc  r7:0x00025e34
52128: r8:0x0000d04d  r9:0x0000000c r10:0x20009068 r11:0x55555556
52128:r12:0x2000a8e8  lr:0x00009e75  pc:0x00000000 psr:0x60000000
52128:ICSR:0x00419803 HFSR:0x40000000 CFSR:0x00020000
52128:BFAR:0xe000ed38 MMFAR:0xe000ed34
nustest <count> <packetsize>
microbuilder commented 8 years ago

Not related to this issue, but I added some notes in the documentation folder on debugging these crash dumps to trace it back to the offending line of code via gdb or objdump: https://github.com/adafruit/Adafruit_Mynewt/blob/master/docs/14_FieldDebugging.md

hathach commented 8 years ago

Nah, it is the help instruction for using nustest that I print out upon reset to remind us how to run this command https://github.com/adafruit/Adafruit_Mynewt/blob/master/apps/throughput/src/main.c#L338

nustest <count> <packetsize>

microbuilder commented 8 years ago

Ah I didn't see that ... I think there shouldn't be printf like that unless we run the command or ask for the help params. Can you comment that out? Glad it's not a bug though, I wasn't sure what was happening to make that command fire and worried it was something more complicated. :)