[#5253] schedule to CPU0 first would receive signal SIGTRAP when kgdb SMP kernel

Document created by Aaronwu Employee on Sep 4, 2013
Version 1Show Document
  • View in full screen mode

[#5253] schedule to CPU0 first would receive signal SIGTRAP when kgdb SMP kernel

Submitted By: Mingquan Pan

Open Date

2009-06-15 03:37:12     Close Date

2009-07-14 04:34:37

Priority:

Medium     Assignee:

Sonic Zhang

Status:

Closed     Fixed In Release:

N/A

Found In Release:

N/A     Release:

Category:

N/A     Board:

N/A

Processor:

BF561     Silicon Revision:

Is this bug repeatable?:

Yes     Resolution:

Fixed

Uboot version or rev.:

    Toolchain version or rev.:

09r1-rc7

App binary format:

N/A     

Summary: schedule to CPU0 first would receive signal SIGTRAP when kgdb SMP kernel

Details:

 

schedule to CPU0 first would receive signal SIGTRAP when kgdb SMP kernel.

 

when setting break kgdb_test, run cat /proc/kgdbtest on target, the gdb stop at that break point. At this time, do thread 4(CPU1) first or thread 3(CPU0) first would get diffetent results.

 

Run thread 4 first:

[Switching to Thread 176]

 

Breakpoint 3, kgdb_test (name=0x10c958 "hello world!", len=12, count=85, z=16) at arch/blackfin/kernel/kgdb_test.c:57

57              printk(KERN_DEBUG "kgdb name(%d): %s, %d, %d\n", len, name, count, z);

(gdb) info thread

* 45 Thread 176 (cat)  kgdb_test (name=0x10c958 "hello world!", len=12, count=85, z=16) at arch/blackfin/kernel/kgdb_test.c:57

  28 Thread 143 (klogd)  0x0000b114 in resume ()

  27 Thread 142 (syslogd)  0x0000b114 in resume ()

  26 Thread 141 (inetd)  0x0000b114 in resume ()

  25 Thread 140 (sh)  0x0000b114 in resume ()

  24 Thread 106 (bfin-spi.0)  0x0000b114 in resume ()

  23 Thread 105 (mtdblockd)  0x0000b114 in resume ()

  22 Thread 65 (kswapd0)  0x0000b114 in resume ()

  21 Thread 64 (pdflush)  0x0000b114 in resume ()

  20 Thread 63 (pdflush)  0x0000b114 in resume ()

  19 Thread 47 (kblockd/1)  0x0000b114 in resume ()

  18 Thread 46 (kblockd/0)  0x0000b114 in resume ()

  17 Thread 15 (kstop/1)  0x0000b114 in resume ()

  16 Thread 14 (kstop/0)  0x0000b114 in resume ()

  15 Thread 11 (khelper)  0x0000b114 in resume ()

  14 Thread 10 (events/1)  0x0000b114 in resume ()

  13 Thread 9 (events/0)  0x0000b114 in resume ()

  12 Thread 8 (watchdog/1)  0x0000b114 in resume ()

  11 Thread 7 (ksoftirqd/1)  0x0000b114 in resume ()

  10 Thread 6 (migration/1)  0x0000b114 in resume ()

  9 Thread 5 (watchdog/0)  0x0000b114 in resume ()

  8 Thread 4 (ksoftirqd/0)  0x0000b114 in resume ()

  7 Thread 3 (migration/0)  0x0000b114 in resume ()

  6 Thread 2 (kthreadd)  0x0000b114 in resume ()

  5 Thread 1 (init)  0x0000b114 in resume ()

  4 Thread -3 (shadowCPU1)  default_idle () at /home/test/work/cruise/checkouts/uclinux-dist/linux-2.6.x/arch/blackfin/include/asm/processor.h:164

  3 Thread -2 (shadowCPU0)  kgdb_test (name=0x10c958 "hello world!", len=12, count=85, z=16) at arch/blackfin/kernel/kgdb_test.c:57

(gdb) thread 4

[Switching to thread 4 (Thread -3)]#0  kgdb_breakpoint () at kernel/kgdb.c:1796

1796            atomic_set(&kgdb_setting_breakpoint, 0);

(gdb) c

Continuing.

 

Breakpoint 3, kgdb_test (name=0x10c958 "hello world!", len=12, count=85, z=16) at arch/blackfin/kernel/kgdb_test.c:57

57              printk(KERN_DEBUG "kgdb name(%d): %s, %d, %d\n", len, name, count, z);

(gdb) c

Continuing.

[New Thread 177]

[Switching to Thread 177]

 

Breakpoint 3, kgdb_test (name=0x10c958 "hello world!", len=12, count=85, z=16) at arch/blackfin/kernel/kgdb_test.c:57

57              printk(KERN_DEBUG "kgdb name(%d): %s, %d, %d\n", len, name, count, z);

 

 

 

Run thread 3 first, it would receive signal SIGTRAP.

(gdb) thread 3

[Switching to thread 3 (Thread -2)]#0  kgdb_test (name=0x10c958 "hello world!", len=12, count=85, z=16) at arch/blackfin/kernel/kgdb_test.c:57

57              printk(KERN_DEBUG "kgdb name(%d): %s, %d, %d\n", len, name, count, z);

(gdb) c

Continuing.

 

Program received signal SIGTRAP, Trace/breakpoint trap.

[Switching to Thread 177]

0x000099ca in kgdb_test (name=0x10c958 "hello world!", len=12, count=85, z=16) at arch/blackfin/kernel/kgdb_test.c:57

57              printk(KERN_DEBUG "kgdb name(%d): %s, %d, %d\n", len, name, count, z);

(gdb) c

Continuing.

 

 

 

 

Follow-ups

 

--- Sonic Zhang                                              2009-07-01 02:40:48

Fix.

 

keep cpu switch the same among all cpus, so the context after swith cpu

are the similar to gdb. switch master cpu to itself as well.

 

 

--- Mingquan Pan                                             2009-07-14 04:34:37

Yes,fixed. Close.

 

 

 

    Files

    Changes

    Commits

    Dependencies

    Duplicates

    Associations

    Tags

 

File Name     File Type     File Size     Posted By

No Files Were Found

Attachments

    Outcomes