Hello, I wrote:
>>If there are no objections, I will commit the following patch.

>>-- 

>>This patch fixes some corner cases where KGDB will silently hang or
>>kill the system, if a user accidentally tries to source step into a
>>spin_unlock() call or source step in on a macro containing
>>smp_processor_id().  The use of raw_smp_processor_id is desired in
>>kernel/kgdb.c to fix this particular problem.

>>To fix issues with accidental source step in on spin_unlock(), the
>>idea is to check for the existence of a break point on the second
>>entry to kgdb and try to remove it.  Next an attempt will be made to
>>continue normal operations.  A third entry will generate a panic(), so
>>as to stop infinite loops.

>>Testing has shown that kgdb is much more robust with these changes
>>and "random accidental run control".

>     It seems that something has been broken WRT backtracing...

    Here's the more relevant trace -- got it at the initial KGDB breakpoint:

breakpoint () at kernel/kgdb.c:1773
1773    }

(gdb) bt
#0  breakpoint () at kernel/kgdb.c:1773
#1  0xffffffff808c8811 in kgdb_late_entry () at kernel/kgdb.c:1752
#2  0xffffffff808b2a29 in init (unused=0x0) at init/main.c:692
#3  0xffffffff8020ae38 in child_rip ()
#4  0x0000000000000000 in ?? ()
Ignoring packet error, continuing...
Reply contains invalid hex digit 116

    And here's the start of endless trace on target -- it suggests that KGDb 
has caught GPF:

KGDB: re-enter exception: ALL breakpoints removed
Kernel panic - not syncing: Recursive entry to debugger

Call Trace:
  <#DB>  [<ffffffff80228ccb>] panic+0xe9/0x1a9
  [<ffffffff80258f3a>] kgdb_handle_exception+0x11c/0xf92
  [<ffffffff80585cad>] kfree_skbmem+0x84/0x8b
  [<ffffffff802586f3>] kgdb_mem2hex+0x311/0x35d
  [<ffffffff8021d433>] kgdb_notify+0xfb/0x105
  [<ffffffff80236b36>] notifier_call_chain+0x2c/0x43
  [<ffffffff80236d61>] raw_notifier_call_chain+0x9/0xb
  [<ffffffff8020c3ef>] do_general_protection+0xf7/0x121
  [<ffffffff8062f46d>] error_exit+0x0/0x84
  [<ffffffff80258408>] kgdb_mem2hex+0x26/0x35d
  [<ffffffff802586f3>] kgdb_mem2hex+0x311/0x35d
  [<ffffffff80258408>] kgdb_mem2hex+0x26/0x35d
  [<ffffffff80258910>] kgdb_hex2long+0x29/0x5f
  [<ffffffff80259534>] kgdb_handle_exception+0x716/0xf92
  [<ffffffff8021d433>] kgdb_notify+0xfb/0x105
  [<ffffffff80236b36>] notifier_call_chain+0x2c/0x43
  [<ffffffff80236d61>] raw_notifier_call_chain+0x9/0xb
  [<ffffffff8020c621>] do_int3+0x44/0xa7
  [<ffffffff8062f7b3>] int3+0x93/0xb0
  [<ffffffff80259eb6>] breakpoint+0xf/0x1b
  <<EOE>>  [<ffffffff808c8811>] kgdb_late_entry+0xba/0xc3
  [<ffffffff808b2a29>] init+0x1a2/0x37c
  [<ffffffff8020ae38>] child_rip+0xa/0x12
  [<ffffffff803f8cb4>] acpi_ds_init_one_object+0x0/0x88
  [<ffffffff808b2887>] init+0x0/0x37c
  [<ffffffff8020ae2e>] child_rip+0x0/0x12

Kernel panic - not syncing: Recursive entry to debugger

Call Trace:
  <#DB[1]>  [<ffffffff80228ccb>] panic+0xe9/0x1a9
  [<ffffffff8021d47a>] kgdb_skipexception+0x22/0x3e
  [<ffffffff80258f3a>] kgdb_handle_exception+0x11c/0xf92
  [<ffffffff80259eb5>] breakpoint+0xe/0x1b
  [<ffffffff8021d433>] kgdb_notify+0xfb/0x105
  [<ffffffff80236b36>] notifier_call_chain+0x2c/0x43
  [<ffffffff80236d61>] raw_notifier_call_chain+0x9/0xb
  [<ffffffff8020c621>] do_int3+0x44/0xa7
  [<ffffffff8062f7b3>] int3+0x93/0xb0
  [<ffffffff80259eb6>] breakpoint+0xf/0x1b
  <<EOE>>  <#DB>  [<ffffffff80259ecb>] kgdb_panic_notify+0x9/0xd
  [<ffffffff80236b36>] notifier_call_chain+0x2c/0x43
  [<ffffffff80236c0e>] atomic_notifier_call_chain+0x34/0x4e
  [<ffffffff80228cee>] panic+0x10c/0x1a9
  [<ffffffff80258f3a>] kgdb_handle_exception+0x11c/0xf92
  [<ffffffff80585cad>] kfree_skbmem+0x84/0x8b
  [<ffffffff802586f3>] kgdb_mem2hex+0x311/0x35d
  [<ffffffff8021d433>] kgdb_notify+0xfb/0x105
  [<ffffffff80236b36>] notifier_call_chain+0x2c/0x43
  [<ffffffff80236d61>] raw_notifier_call_chain+0x9/0xb
  [<ffffffff8020c3ef>] do_general_protection+0xf7/0x121
  [<ffffffff8062f46d>] error_exit+0x0/0x84
  [<ffffffff80258408>] kgdb_mem2hex+0x26/0x35d
  [<ffffffff802586f3>] kgdb_mem2hex+0x311/0x35d
  [<ffffffff80258408>] kgdb_mem2hex+0x26/0x35d
  [<ffffffff80258910>] kgdb_hex2long+0x29/0x5f
  [<ffffffff80259534>] kgdb_handle_exception+0x716/0xf92
  [<ffffffff8021d433>] kgdb_notify+0xfb/0x105
  [<ffffffff80236b36>] notifier_call_chain+0x2c/0x43
  [<ffffffff80236d61>] raw_notifier_call_chain+0x9/0xb
  [<ffffffff8020c621>] do_int3+0x44/0xa7
  [<ffffffff8062f7b3>] int3+0x93/0xb0
  [<ffffffff80259eb6>] breakpoint+0xf/0x1b
  <<EOE>>  [<ffffffff808c8811>] kgdb_late_entry+0xba/0xc3
  [<ffffffff808b2a29>] init+0x1a2/0x37c
  [<ffffffff8020ae38>] child_rip+0xa/0x12
  [<ffffffff803f8cb4>] acpi_ds_init_one_object+0x0/0x88
  [<ffffffff808b2887>] init+0x0/0x37c
  [<ffffffff8020ae2e>] child_rip+0x0/0x12

Kernel panic - not syncing: Recursive entry to debugger

Call Trace:

[a lot of taceless panics skipped]

Call Trace:
  <#MC>  [<ffffffff80228ccb>] panic+0xe9/0x1a9
  [<ffffffff8021d47a>] kgdb_skipexception+0x22/0x3e
  [<ffffffff80258f3a>] kgdb_handle_exception+0x11c/0xf92
  [<ffffffff80259eb5>] breakpoint+0xe/0x1b
  [<ffffffff8021d433>] kgdb_notify+0xfb/0x105
  [<ffffffff80236b36>] notifier_call_chain+0x2c/0x43
  [<ffffffff80236d61>] raw_notifier_call_chain+0x9/0xb
  [<ffffffff8020c621>] do_int3+0x44/0xa7
  [<ffffffff8062f7b3>] int3+0x93/0xb0
  [<ffffffff80259eb6>] breakpoint+0xf/0x1b
  <<EOE>>
Kernel panic - not syncing: Recursive entry to debugger

Call Trace:
  <IRQ>  [<ffffffff80228ccb>] panic+0xe9/0x1a9
  [<ffffffff802200c4>] __activate_task+0x38/0x54
  [<ffffffff802201b9>] activate_task+0xd9/0xf1
  [<ffffffff8021d47a>] kgdb_skipexception+0x22/0x3e
  [<ffffffff80258f3a>] kgdb_handle_exception+0x11c/0xf92
  [<ffffffff8021fc10>] task_rq_lock+0x50/0x92
  [<ffffffff8062ed9f>] __spin_unlock_irqrestore+0x35/0x37
  [<ffffffff80259eb5>] breakpoint+0xe/0x1b
  [<ffffffff80220b87>] try_to_wake_up+0x48b/0x49d
  [<ffffffff8021d433>] kgdb_notify+0xfb/0x105
  [<ffffffff80236b36>] notifier_call_chain+0x2c/0x43
  [<ffffffff80236d61>] raw_notifier_call_chain+0x9/0xb
  [<ffffffff8020c621>] do_int3+0x44/0xa7
  [<ffffffff8062f7b3>] int3+0x93/0xb0
  <EOI>

    ... and then follows the trace that I've quoted in the previous email.

WBR, Sergei


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Kgdb-bugreport mailing list
Kgdb-bugreport@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kgdb-bugreport

Reply via email to