FAQ: [#6189] Kgdb test may fail on bf561-ezkit SMP kernel(2010)

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

[#6189] Kgdb test may fail on bf561-ezkit SMP kernel

Submitted By: Vivi Li

Open Date

2010-08-17 05:28:25     Close Date

2010-11-18 04:27:01

Priority:

Medium     Assignee:

Sonic Zhang

Status:

Closed     Fixed In Release:

N/A

Found In Release:

2010R1     Release:

Category:

N/A     Board:

EZKIT Lite

Processor:

BF561     Silicon Revision:

Is this bug repeatable?:

Yes     Resolution:

Fixed

Uboot version or rev.:

    Toolchain version or rev.:

gcc4.3-2010_Aug_04

App binary format:

N/A     

Summary: Kgdb test may fail on bf561-ezkit SMP kernel

Details:

 

Kgdb test may fail on bf561-ezkit SMP kernel.

 

Bellow is the log which fail at case 29:

--

(gdb) hbreak 48

Hardware assisted breakpoint 4 at 0xfeb00058: file arch/blackfin/kernel/kgdb_test.c, line 48.

 

Case 26 ...PASS

(gdb) info break

Num Type           Disp Enb Address    What

3   breakpoint     keep y   0xfeb00004 in kgdb_l2_test at arch/blackfin/kernel/kgdb_test.c:45

        breakpoint already hit 1 time

 

Case 27 ...PASS

4   hw breakpoint  keep y   0xfeb00058 in kgdb_l2_test at arch/blackfin/kernel/kgdb_test.c:48

(gdb) info thread

  28 Thread 144 (klogd)  do_syslog (type=<value optimized out>, buf=0x28dbcbd " : code function addr = 0xfeb00000", len=1023,

    from_file=<value optimized out>) at kernel/printk.c:298

  27 Thread 143 (syslogd)  0x0000bdb0 in resume ()

    at /home/test/work/cruise/checkouts/uclinux-dist/linux-2.6.x/arch/blackfin/include/asm/cplb.h:128

  26 Thread 142 (inetd)  0x0000bdb0 in resume ()

    at /home/test/work/cruise/checkouts/uclinux-dist/linux-2.6.x/arch/blackfin/include/asm/cplb.h:128

  25 Thread 141 (sh)  0x0000bdb0 in resume ()

    at /home/test/work/cruise/checkouts/uclinux-dist/linux-2.6.x/arch/blackfin/include/asm/cplb.h:128

  24 Thread 115 (mtdblockd)  0x0000bdb0 in resume ()

    at /home/test/work/cruise/checkouts/uclinux-dist/linux-2.6.x/arch/blackfin/include/asm/cplb.h:128

  23 Thread 73 (kswapd0)  0x0000bdb0 in resume ()

    at /home/test/work/cruise/checkouts/uclinux-dist/linux-2.6.x/arch/blackfin/include/asm/cplb.h:128

  22 Thread 72 (khungtaskd)  0x0000bdb0 in resume ()

    at /home/test/work/cruise/checkouts/uclinux-dist/linux-2.6.x/arch/blackfin/include/asm/cplb.h:128

  21 Thread 55 (bfin-spi.0)  0x0000bdb0 in resume ()

    at /home/test/work/cruise/checkouts/uclinux-dist/linux-2.6.x/arch/blackfin/include/asm/cplb.h:128

  20 Thread 53 (kblockd/1)  0x0000bdb0 in resume ()

    at /home/test/work/cruise/checkouts/uclinux-dist/linux-2.6.x/arch/blackfin/include/asm/cplb.h:128

  19 Thread 52 (kblockd/0)  0x0000bdb0 in resume ()

    at /home/test/work/cruise/checkouts/uclinux-dist/linux-2.6.x/arch/blackfin/include/asm/cplb.h:128

  18 Thread 50 (bdi-default)  0x0000bdb0 in resume ()

    at /home/test/work/cruise/checkouts/uclinux-dist/linux-2.6.x/arch/blackfin/include/asm/cplb.h:128

  17 Thread 48 (sync_supers)  0x0000bdb0 in resume ()

    at /home/test/work/cruise/checkouts/uclinux-dist/linux-2.6.x/arch/blackfin/include/asm/cplb.h:128

  16 Thread 14 (async/mgr)  0x0000bdb0 in resume ()

    at /home/test/work/cruise/checkouts/uclinux-dist/linux-2.6.x/arch/blackfin/include/asm/cplb.h:128

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

    at /home/test/work/cruise/checkouts/uclinux-dist/linux-2.6.x/arch/blackfin/include/asm/cplb.h:128

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

    at /home/test/work/cruise/checkouts/uclinux-dist/linux-2.6.x/arch/blackfin/include/asm/cplb.h:128

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

    at /home/test/work/cruise/checkouts/uclinux-dist/linux-2.6.x/arch/blackfin/include/asm/cplb.h:128

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

    at /home/test/work/cruise/checkouts/uclinux-dist/linux-2.6.x/arch/blackfin/include/asm/cplb.h:128

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

    at /home/test/work/cruise/checkouts/uclinux-dist/linux-2.6.x/arch/blackfin/include/asm/cplb.h:128

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

    at /home/test/work/cruise/checkouts/uclinux-dist/linux-2.6.x/arch/blackfin/include/asm/cplb.h:128

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

---Type <return> to continue, or q <return> to quit---

    at /home/test/work/cruise/checkouts/uclinux-dist/linux-2.6.x/arch/blackfin/include/asm/cplb.h:128

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

    at /home/test/work/cruise/checkouts/uclinux-dist/linux-2.6.x/arch/blackfin/include/asm/cplb.h:128

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

    at /home/test/work/cruise/checkouts/uclinux-dist/linux-2.6.x/arch/blackfin/include/asm/cplb.h:128

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

    at /home/test/work/cruise/checkouts/uclinux-dist/linux-2.6.x/arch/blackfin/include/asm/cplb.h:128

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

    at /home/test/work/cruise/checkouts/uclinux-dist/linux-2.6.x/arch/blackfin/include/asm/cplb.h:128

  4 Thread -3 (shadowCPU1)  do_syslog (type=<value optimized out>, buf=0x28dbcbd " : code function addr = 0xfeb00000",

    len=1023, from_file=<value optimized out>) at kernel/printk.c:298

  3 Thread -2 (shadowCPU0)  kgdb_l2_test () at arch/blackfin/kernel/kgdb_test.c:45

* 2 Thread 151 (cat)  kgdb_l2_test () at arch/blackfin/kernel/kgdb_test.c:45

(gdb)

Case 28 ...PASS

thread 3

[Switching to thread 3 (Thread -2)]#0  kgdb_l2_test () at arch/blackfin/kernel/kgdb_test.c:45

 

Case 29 ...PASS

45              pr_alert("L2(before change) : data variable addr = 0x%p, data value is %d\n", &num2, num2);

(gdb) c

Continuing.

 

Program received signal SIGTRAP, Trace/breakpoint trap.

[Switching to Thread 151]

spawn /bin/sh

uclinux65-561-SMP:~/work/cruise/checkouts/uclinux-dist/testsuites/kgdb> ps aux | grep bfin-uclinux-gdb

test     25770  0.4  2.8  35324 29416 pts/5    Ss+  17:01   0:00 bfin-uclinux-gdb /home/test/work/cruise/checkouts/uclinux-dist/linux-2.6.x/vmlinux

test     25781  0.0  0.0   5236   816 pts/6    R+   17:02   0:00 grep bfin-uclinux-gdb

uclinux65-561-SMP:~/work/cruise/checkouts/uclinux-dist/testsuites/kgdb> kill -9 `pidof  bfin-uclinux-gdb`

uclinux65-561-SMP:~/work/cruise/checkouts/uclinux-dist/testsuites/kgdb>

--

 

It also may fail at case 10:

--

info b

Num Type           Disp Enb Address    What

1   breakpoint     keep y   0x00008be2 in kgdb_test

                                       at arch/blackfin/kernel/kgdb_test.c:56

        breakpoint already hit 1 time

2   hw breakpoint  keep y   0x00008c08 in kgdb_test

 

Case 7 ...PASS

 

Case 7 ...PASS

                                       at arch/blackfin/kernel/kgdb_test.c:58

(gdb) list

51      #endif

52

53

54      int kgdb_test(char *name, int len, int count, int z)

55      {

56              pr_alert("kgdb name(%d): %s, %d, %d\n", len, name, count, z);

57              count = z;

58              return count;

59      }

60

(gdb)

Case 8 ...PASS

 

Case 8 ...PASS

bt

#0  kgdb_test (name=0x11b4a8 "hello world!", len=12, count=85, z=16)

 

Case 9 ...PASS

 

Case 9 ...PASS

    at arch/blackfin/kernel/kgdb_test.c:56

#1  0x00008c38 in kgdb_test_proc_read (file=0x27ac920, buf=0x2a63e80 "",

    count=4096, ppos=0x27b9eec) at arch/blackfin/kernel/kgdb_test.c:65

#2  0x000801a2 in proc_reg_read (file=0x27ac920, buf=0x2a63e80 "", count=4096,

    ppos=0x27b9eec) at fs/proc/inode.c:163

#3  0x00055998 in vfs_read (file=0x27ac920, buf=0x2a63e80 "",

    count=<value optimized out>, pos=0x27b9eec) at fs/read_write.c:293

#4  0x00055ac0 in sys_read (fd=<value optimized out>, buf=0x2a63e80 "",

    count=4096) at fs/read_write.c:383

#5  0x0000bcda in system_call ()

    at /home/test/work/cruise/checkouts/uclinux-dist/linux-2.6.x/arch/blackfin/include/asm/cplb.h:128

(gdb) c

Continuing.

spawn /bin/sh

^[[?1034huclinux65-561-SMP:~/work/cruise/checkouts/uclinux-dist/testsuites/kgdb> ps aux |  grep bfin-uclinux-gdb

test     12859  1.0  2.7  34260 28336 pts/5    Ss+  17:22   0:00 bfin-uclinux-gdb /home/test/work/cruise/checkouts/uclinux-dist/linux-2.6.x/vmlinux

test     12870  0.0  0.0   5236   824 pts/6    S+   17:22   0:00 grep bfin-uclinux-gdb

uclinux65-561-SMP:~/work/cruise/checkouts/uclinux-dist/testsuites/kgdb> kill -9  `pidof  bfin-uclinux-gdb`

uclinux65-561-SMP:~/work/cruise/checkouts/uclinux-dist/testsuites/kgdb>

--

 

Follow-ups

 

--- Sonic Zhang                                              2010-09-14 04:34:41

Fixed.

 

Switch to current cpu is allowed in kgdb SMP kernel. If

1) kernel traps into kgdb at a breakpoint;

2) gdb asks to switch to current cpu thread (-cpu_id -2);

3) gdb asks to continue;

 

Hc, s and c gdb ops are issued in sequence to skip the breakpoint with

current cpu thread id. But, kgdb always returns the thread id of current

process after the single step is done, which confuses gdb. This patch

return the thread id which Hc is issued with.

 

--- Vivi Li                                                  2010-11-18 04:27:01

OK. Close it.

 

 

 

    Files

    Changes

    Commits

    Dependencies

    Duplicates

    Associations

    Tags

 

File Name     File Type     File Size     Posted By

config.linux.kgdb_smp    application/octet-stream    30194    Vivi Li

Attachments

Outcomes