| 32 | |
| 33 | * getpid.c |
| 34 | {{{#!cc |
| 35 | #include <stdio.h> |
| 36 | #include <sys/types.h> |
| 37 | #include <unistd.h> |
| 38 | |
| 39 | int main() { |
| 40 | printf ("%d\n", getpid()); |
| 41 | |
| 42 | return 0; |
| 43 | } |
| 44 | }}} |
| 45 | |
| 46 | * case1 |
| 47 | * gdb attach L0 => L2 |
| 48 | * mitty@quantal-l0:~/works/linux-3.5.1$ gdb |
| 49 | {{{ |
| 50 | (gdb) file vmlinux |
| 51 | Reading symbols from /home/mitty/works/linux-3.5.1/vmlinux...done. |
| 52 | (gdb) b sys_getpid |
| 53 | Breakpoint 1 at 0xffffffff81064070: file kernel/timer.c, line 1414. |
| 54 | (gdb) target remote 192.168.XX.223:1234 |
| 55 | Remote debugging using 192.168.XX.223:1234 |
| 56 | native_safe_halt () |
| 57 | at /home/mitty/works/linux-3.5.1/arch/x86/include/asm/irqflags.h:50 |
| 58 | 50 } |
| 59 | (gdb) c |
| 60 | Continuing. |
| 61 | }}} |
| 62 | * kern.log |
| 63 | {{{ |
| 64 | Jul 11 23:31:00 quantal-nested kernel: [ 1877.578453] int3: 0000 [#1] SMP |
| 65 | Jul 11 23:31:00 quantal-nested kernel: [ 1877.591921] CPU 0 |
| 66 | Jul 11 23:31:00 quantal-nested kernel: [ 1877.594478] Modules linked in: kvm_intel kvm ppdev psmouse microcode parport_pc serio_raw i2c_piix4 mac_hid lp parport floppy 8139too 8139cp |
| 67 | Jul 11 23:31:00 quantal-nested kernel: [ 1877.614280] |
| 68 | Jul 11 23:31:00 quantal-nested kernel: [ 1877.616880] Pid: 946, comm: getpid Not tainted 3.5.1 #1 Bochs Bochs |
| 69 | Jul 11 23:31:00 quantal-nested kernel: [ 1877.622425] RIP: 0010:[<ffffffff81064071>] [<ffffffff81064071>] sys_getpid+0x1/0x30 |
| 70 | Jul 11 23:31:00 quantal-nested kernel: [ 1877.629986] RSP: 0018:ffff88003cfa5f80 EFLAGS: 00010293 |
| 71 | Jul 11 23:31:00 quantal-nested kernel: [ 1877.634137] RAX: 0000000000000027 RBX: 0000000000000000 RCX: 00007fffb9729930 |
| 72 | Jul 11 23:31:00 quantal-nested kernel: [ 1877.638935] RDX: 0000000000000000 RSI: 00007fffb9729c88 RDI: 0000000000000001 |
| 73 | Jul 11 23:31:00 quantal-nested kernel: [ 1877.643660] RBP: 00007fffb9729ba0 R08: 0000000000400610 R09: 00007f664da39750 |
| 74 | Jul 11 23:31:00 quantal-nested kernel: [ 1877.648427] R10: 00007fffb9729930 R11: 0000000000000246 R12: 0000000000400450 |
| 75 | Jul 11 23:31:00 quantal-nested kernel: [ 1877.652946] R13: 00007fffb9729c80 R14: 0000000000000000 R15: 0000000000000000 |
| 76 | Jul 11 23:31:00 quantal-nested kernel: [ 1877.657537] FS: 00007f664dc42700(0000) GS:ffff88003fc00000(0000) knlGS:0000000000000000 |
| 77 | Jul 11 23:31:00 quantal-nested kernel: [ 1877.664543] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 |
| 78 | Jul 11 23:31:00 quantal-nested kernel: [ 1877.668770] CR2: 00007f664d72b6d0 CR3: 000000001921f000 CR4: 00000000000006f0 |
| 79 | Jul 11 23:31:00 quantal-nested kernel: [ 1877.673353] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 |
| 80 | Jul 11 23:31:00 quantal-nested kernel: [ 1877.678072] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400 |
| 81 | Jul 11 23:31:00 quantal-nested kernel: [ 1877.682699] Process getpid (pid: 946, threadinfo ffff88003cfa4000, task ffff88003da44500) |
| 82 | Jul 11 23:31:00 quantal-nested kernel: [ 1877.693357] Stack: |
| 83 | Jul 11 23:31:00 quantal-nested kernel: [ 1877.696519] ffffffff816812e9 0000000000000246 00007fffb9729930 00007f664da39750 |
| 84 | Jul 11 23:31:00 quantal-nested kernel: [ 1877.705634] 0000000000400610 0000000000000027 0000000000400580 0000000000000000 |
| 85 | Jul 11 23:31:00 quantal-nested kernel: [ 1877.714651] 00007fffb9729c88 0000000000000001 0000000000000027 00007f664d72b6f9 |
| 86 | Jul 11 23:31:00 quantal-nested kernel: [ 1877.724455] Call Trace: |
| 87 | Jul 11 23:31:00 quantal-nested kernel: [ 1877.727731] [<ffffffff816812e9>] ? system_call_fastpath+0x16/0x1b |
| 88 | Jul 11 23:31:00 quantal-nested kernel: [ 1877.732259] Code: 66 2e 0f 1f 84 00 00 00 00 00 55 48 89 e5 66 66 66 66 90 e8 c2 4d ff ff 5d 89 c0 c3 66 66 66 66 66 2e 0f 1f 84 00 00 00 00 00 cc <48> 89 e5 66 66 66 66 90 65 48 8b 04 25 00 c7 00 00 48 8b 80 f0 |
| 89 | Jul 11 23:31:00 quantal-nested kernel: [ 1877.792020] RIP [<ffffffff81064071>] sys_getpid+0x1/0x30 |
| 90 | Jul 11 23:31:00 quantal-nested kernel: [ 1877.797667] RSP <ffff88003cfa5f80> |
| 91 | Jul 11 23:31:00 quantal-nested kernel: [ 1877.801729] ---[ end trace 626ed62bf5aa88ab ]--- |
| 92 | Jul 11 23:31:00 quantal-nested kernel: [ 1877.806097] BUG: scheduling while atomic: getpid/946/0x10000001 |
| 93 | Jul 11 23:31:00 quantal-nested kernel: [ 1877.810788] Modules linked in: kvm_intel kvm ppdev psmouse microcode parport_pc serio_raw i2c_piix4 mac_hid lp parport floppy 8139too 8139cp |
| 94 | Jul 11 23:31:00 quantal-nested kernel: [ 1877.827458] Pid: 946, comm: getpid Tainted: G D 3.5.1 #1 |
| 95 | Jul 11 23:31:00 quantal-nested kernel: [ 1877.832034] Call Trace: |
| 96 | Jul 11 23:31:00 quantal-nested kernel: [ 1877.835138] <#DB> [<ffffffff8166e564>] __schedule_bug+0x4d/0x59 |
| 97 | Jul 11 23:31:00 quantal-nested kernel: [ 1877.839978] [<ffffffff81677d34>] __schedule+0x6e4/0x7c0 |
| 98 | Jul 11 23:31:00 quantal-nested kernel: [ 1877.844322] [<ffffffff81084b4a>] __cond_resched+0x2a/0x40 |
| 99 | Jul 11 23:31:00 quantal-nested kernel: [ 1877.848360] [<ffffffff81677e90>] _cond_resched+0x30/0x40 |
| 100 | Jul 11 23:31:00 quantal-nested kernel: [ 1877.852387] [<ffffffff81677326>] down_read+0x16/0x2b |
| 101 | Jul 11 23:31:00 quantal-nested kernel: [ 1877.856313] [<ffffffff810681cb>] exit_signals+0x2b/0x130 |
| 102 | Jul 11 23:31:00 quantal-nested kernel: [ 1877.860322] [<ffffffff8107c3e6>] ? blocking_notifier_call_chain+0x16/0x20 |
| 103 | Jul 11 23:31:00 quantal-nested kernel: [ 1877.864782] [<ffffffff810577b4>] do_exit+0xb4/0x8e0 |
| 104 | Jul 11 23:31:00 quantal-nested kernel: [ 1877.868730] [<ffffffff8166dfe0>] ? printk+0x61/0x63 |
| 105 | Jul 11 23:31:00 quantal-nested kernel: [ 1877.873228] [<ffffffff8167a334>] oops_end+0xa4/0xf0 |
| 106 | Jul 11 23:31:00 quantal-nested kernel: [ 1877.877232] [<ffffffff810166b8>] die+0x58/0x90 |
| 107 | Jul 11 23:31:00 quantal-nested kernel: [ 1877.881063] [<ffffffff81679c40>] do_trap+0xc0/0x170 |
| 108 | Jul 11 23:31:00 quantal-nested kernel: [ 1877.885899] [<ffffffff81679f39>] do_int3+0xd9/0x130 |
| 109 | Jul 11 23:31:00 quantal-nested kernel: [ 1877.889902] [<ffffffff81679698>] int3+0x28/0x40 |
| 110 | Jul 11 23:31:00 quantal-nested kernel: [ 1877.893805] [<ffffffff81064071>] ? sys_getpid+0x1/0x30 |
| 111 | Jul 11 23:31:00 quantal-nested kernel: [ 1877.897890] <<EOE>> [<ffffffff816812e9>] ? system_call_fastpath+0x16/0x1b |
| 112 | Jul 11 23:31:00 quantal-nested kernel: [ 1877.903220] note: getpid[946] exited with preempt_count 1 |
| 113 | Jul 11 23:31:00 quantal-nested kernel: [ 1877.907471] BUG: scheduling while atomic: getpid/946/0x10000001 |
| 114 | Jul 11 23:31:00 quantal-nested kernel: [ 1877.915076] Modules linked in: kvm_intel kvm ppdev psmouse microcode parport_pc serio_raw i2c_piix4 mac_hid lp parport floppy 8139too 8139cp |
| 115 | Jul 11 23:31:00 quantal-nested kernel: [ 1877.933729] Pid: 946, comm: getpid Tainted: G D W 3.5.1 #1 |
| 116 | Jul 11 23:31:00 quantal-nested kernel: [ 1877.938159] Call Trace: |
| 117 | Jul 11 23:31:00 quantal-nested kernel: [ 1877.941419] <#DB> [<ffffffff8166e564>] __schedule_bug+0x4d/0x59 |
| 118 | Jul 11 23:31:00 quantal-nested kernel: [ 1877.946391] [<ffffffff81677d34>] __schedule+0x6e4/0x7c0 |
| 119 | Jul 11 23:31:00 quantal-nested kernel: [ 1877.950571] [<ffffffff81084b4a>] __cond_resched+0x2a/0x40 |
| 120 | Jul 11 23:31:00 quantal-nested kernel: [ 1877.954840] [<ffffffff81677e90>] _cond_resched+0x30/0x40 |
| 121 | Jul 11 23:31:00 quantal-nested kernel: [ 1877.959065] [<ffffffff81677326>] down_read+0x16/0x2b |
| 122 | Jul 11 23:31:00 quantal-nested kernel: [ 1877.963238] [<ffffffff810b7acb>] acct_collect+0x4b/0x1c0 |
| 123 | Jul 11 23:31:00 quantal-nested kernel: [ 1877.967488] [<ffffffff81057d83>] do_exit+0x683/0x8e0 |
| 124 | Jul 11 23:31:00 quantal-nested kernel: [ 1877.971680] [<ffffffff8167a334>] oops_end+0xa4/0xf0 |
| 125 | Jul 11 23:31:00 quantal-nested kernel: [ 1877.975844] [<ffffffff810166b8>] die+0x58/0x90 |
| 126 | Jul 11 23:31:00 quantal-nested kernel: [ 1877.979899] [<ffffffff81679c40>] do_trap+0xc0/0x170 |
| 127 | Jul 11 23:31:00 quantal-nested kernel: [ 1877.984131] [<ffffffff81679f39>] do_int3+0xd9/0x130 |
| 128 | Jul 11 23:31:00 quantal-nested kernel: [ 1877.987954] [<ffffffff81679698>] int3+0x28/0x40 |
| 129 | Jul 11 23:31:00 quantal-nested kernel: [ 1877.992037] [<ffffffff81064071>] ? sys_getpid+0x1/0x30 |
| 130 | Jul 11 23:31:00 quantal-nested kernel: [ 1877.995934] <<EOE>> [<ffffffff816812e9>] ? system_call_fastpath+0x16/0x1b |
| 131 | }}} |
| 132 | * gdb attach L1 => L2 |
| 133 | * mitty@quantal-l1:~/works/linux-3.5.1$ gdb |
| 134 | {{{ |
| 135 | (gdb) file vmlinux |
| 136 | Reading symbols from /home/mitty/works/linux-3.5.1/vmlinux...done. |
| 137 | (gdb) b sys_getpid |
| 138 | Breakpoint 1 at 0xffffffff81064070: file kernel/timer.c, line 1414. |
| 139 | (gdb) target remote 127.0.0.1:1234 |
| 140 | Remote debugging using 127.0.0.1:1234 |
| 141 | native_safe_halt () |
| 142 | at /home/mitty/works/linux-3.5.1/arch/x86/include/asm/irqflags.h:50 |
| 143 | 50 } |
| 144 | (gdb) c |
| 145 | Continuing. |
| 146 | }}} |
| 147 | * kern.log |
| 148 | {{{ |
| 149 | Jul 11 23:32:34 quantal-nested kernel: [ 1971.193620] int3: 0000 [#2] SMP |
| 150 | Jul 11 23:32:34 quantal-nested kernel: [ 1971.196085] CPU 0 |
| 151 | Jul 11 23:32:34 quantal-nested kernel: [ 1971.196085] Modules linked in: kvm_intel kvm ppdev psmouse microcode parport_pc serio_raw i2c_piix4 mac_hid lp parport floppy 8139too 8139cp |
| 152 | Jul 11 23:32:34 quantal-nested kernel: [ 1971.196085] |
| 153 | Jul 11 23:32:34 quantal-nested kernel: [ 1971.196085] Pid: 970, comm: getpid Tainted: G D W 3.5.1 #1 Bochs Bochs |
| 154 | Jul 11 23:32:34 quantal-nested kernel: [ 1971.196085] RIP: 0010:[<ffffffff81064071>] [<ffffffff81064071>] sys_getpid+0x1/0x30 |
| 155 | Jul 11 23:32:34 quantal-nested kernel: [ 1971.196085] RSP: 0018:ffff880018dfff80 EFLAGS: 00010293 |
| 156 | Jul 11 23:32:34 quantal-nested kernel: [ 1971.196085] RAX: 0000000000000027 RBX: 0000000000000000 RCX: 00007fff6dc338f0 |
| 157 | Jul 11 23:32:34 quantal-nested kernel: [ 1971.196085] RDX: 0000000000000000 RSI: 00007fff6dc33c48 RDI: 0000000000000001 |
| 158 | Jul 11 23:32:34 quantal-nested kernel: [ 1971.196085] RBP: 00007fff6dc33b60 R08: 0000000000400610 R09: 00007fce0d61b750 |
| 159 | Jul 11 23:32:34 quantal-nested kernel: [ 1971.196085] R10: 00007fff6dc338f0 R11: 0000000000000246 R12: 0000000000400450 |
| 160 | Jul 11 23:32:34 quantal-nested kernel: [ 1971.196085] R13: 00007fff6dc33c40 R14: 0000000000000000 R15: 0000000000000000 |
| 161 | Jul 11 23:32:34 quantal-nested kernel: [ 1971.196085] FS: 00007fce0d824700(0000) GS:ffff88003fc00000(0000) knlGS:0000000000000000 |
| 162 | Jul 11 23:32:34 quantal-nested kernel: [ 1971.196085] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 |
| 163 | Jul 11 23:32:34 quantal-nested kernel: [ 1971.196085] CR2: 00007fce0d30d6d0 CR3: 0000000024c2f000 CR4: 00000000000006f0 |
| 164 | Jul 11 23:32:34 quantal-nested kernel: [ 1971.196085] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 |
| 165 | Jul 11 23:32:34 quantal-nested kernel: [ 1971.196085] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400 |
| 166 | Jul 11 23:32:34 quantal-nested kernel: [ 1971.196085] Process getpid (pid: 970, threadinfo ffff880018dfe000, task ffff88003da44500) |
| 167 | Jul 11 23:32:34 quantal-nested kernel: [ 1971.196085] Stack: |
| 168 | Jul 11 23:32:34 quantal-nested kernel: [ 1971.196085] ffffffff816812e9 0000000000000246 00007fff6dc338f0 00007fce0d61b750 |
| 169 | Jul 11 23:32:34 quantal-nested kernel: [ 1971.196085] 0000000000400610 0000000000000027 0000000000400580 0000000000000000 |
| 170 | Jul 11 23:32:34 quantal-nested kernel: [ 1971.196085] 00007fff6dc33c48 0000000000000001 0000000000000027 00007fce0d30d6f9 |
| 171 | Jul 11 23:32:34 quantal-nested kernel: [ 1971.196085] Call Trace: |
| 172 | Jul 11 23:32:34 quantal-nested kernel: [ 1971.196085] [<ffffffff816812e9>] ? system_call_fastpath+0x16/0x1b |
| 173 | Jul 11 23:32:34 quantal-nested kernel: [ 1971.196085] Code: 66 2e 0f 1f 84 00 00 00 00 00 55 48 89 e5 66 66 66 66 90 e8 c2 4d ff ff 5d 89 c0 c3 66 66 66 66 66 2e 0f 1f 84 00 00 00 00 00 cc <48> 89 e5 66 66 66 66 90 65 48 8b 04 25 00 c7 00 00 48 8b 80 f0 |
| 174 | Jul 11 23:32:34 quantal-nested kernel: [ 1971.196085] RIP [<ffffffff81064071>] sys_getpid+0x1/0x30 |
| 175 | Jul 11 23:32:34 quantal-nested kernel: [ 1971.196085] RSP <ffff880018dfff80> |
| 176 | Jul 11 23:32:34 quantal-nested kernel: [ 1971.429516] ---[ end trace 626ed62bf5aa88ac ]--- |
| 177 | Jul 11 23:32:34 quantal-nested kernel: [ 1971.433353] BUG: scheduling while atomic: getpid/970/0x10000001 |
| 178 | Jul 11 23:32:34 quantal-nested kernel: [ 1971.437605] Modules linked in: kvm_intel kvm ppdev psmouse microcode parport_pc serio_raw i2c_piix4 mac_hid lp parport floppy 8139too 8139cp |
| 179 | Jul 11 23:32:34 quantal-nested kernel: [ 1971.454074] Pid: 970, comm: getpid Tainted: G D W 3.5.1 #1 |
| 180 | Jul 11 23:32:34 quantal-nested kernel: [ 1971.459631] Call Trace: |
| 181 | Jul 11 23:32:34 quantal-nested kernel: [ 1971.463006] <#DB[1]> [<ffffffff8166e564>] __schedule_bug+0x4d/0x59 |
| 182 | Jul 11 23:32:34 quantal-nested kernel: [ 1971.467796] [<ffffffff81677d34>] __schedule+0x6e4/0x7c0 |
| 183 | Jul 11 23:32:34 quantal-nested kernel: [ 1971.472053] [<ffffffff81084b4a>] __cond_resched+0x2a/0x40 |
| 184 | Jul 11 23:32:34 quantal-nested kernel: [ 1971.476354] [<ffffffff81677e90>] _cond_resched+0x30/0x40 |
| 185 | Jul 11 23:32:34 quantal-nested kernel: [ 1971.480364] [<ffffffff81677326>] down_read+0x16/0x2b |
| 186 | Jul 11 23:32:34 quantal-nested kernel: [ 1971.484258] [<ffffffff810681cb>] exit_signals+0x2b/0x130 |
| 187 | Jul 11 23:32:34 quantal-nested kernel: [ 1971.488224] [<ffffffff8107c3e6>] ? blocking_notifier_call_chain+0x16/0x20 |
| 188 | Jul 11 23:32:34 quantal-nested kernel: [ 1971.492594] [<ffffffff810577b4>] do_exit+0xb4/0x8e0 |
| 189 | Jul 11 23:32:34 quantal-nested kernel: [ 1971.496434] [<ffffffff8166dfe0>] ? printk+0x61/0x63 |
| 190 | Jul 11 23:32:34 quantal-nested kernel: [ 1971.502565] [<ffffffff8167a334>] oops_end+0xa4/0xf0 |
| 191 | Jul 11 23:32:34 quantal-nested kernel: [ 1971.506615] [<ffffffff810166b8>] die+0x58/0x90 |
| 192 | Jul 11 23:32:34 quantal-nested kernel: [ 1971.510514] [<ffffffff81679c40>] do_trap+0xc0/0x170 |
| 193 | Jul 11 23:32:34 quantal-nested kernel: [ 1971.514546] [<ffffffff8167d062>] ? __atomic_notifier_call_chain+0x12/0x20 |
| 194 | Jul 11 23:32:34 quantal-nested kernel: [ 1971.519120] [<ffffffff81679f39>] do_int3+0xd9/0x130 |
| 195 | Jul 11 23:32:34 quantal-nested kernel: [ 1971.523203] [<ffffffff81679698>] int3+0x28/0x40 |
| 196 | Jul 11 23:32:34 quantal-nested kernel: [ 1971.527218] [<ffffffff81064071>] ? sys_getpid+0x1/0x30 |
| 197 | Jul 11 23:32:34 quantal-nested kernel: [ 1971.531377] <<EOE>> [<ffffffff816812e9>] ? system_call_fastpath+0x16/0x1b |
| 198 | Jul 11 23:32:34 quantal-nested kernel: [ 1971.536974] note: getpid[970] exited with preempt_count 1 |
| 199 | Jul 11 23:32:34 quantal-nested kernel: [ 1971.541020] BUG: scheduling while atomic: getpid/970/0x10000001 |
| 200 | Jul 11 23:32:34 quantal-nested kernel: [ 1971.545193] Modules linked in: kvm_intel kvm ppdev psmouse microcode parport_pc serio_raw i2c_piix4 mac_hid lp parport floppy 8139too 8139cp |
| 201 | Jul 11 23:32:34 quantal-nested kernel: [ 1971.561926] Pid: 970, comm: getpid Tainted: G D W 3.5.1 #1 |
| 202 | Jul 11 23:32:34 quantal-nested kernel: [ 1971.566331] Call Trace: |
| 203 | Jul 11 23:32:34 quantal-nested kernel: [ 1971.569623] <#DB[1]> [<ffffffff8166e564>] __schedule_bug+0x4d/0x59 |
| 204 | Jul 11 23:32:34 quantal-nested kernel: [ 1971.574595] [<ffffffff81677d34>] __schedule+0x6e4/0x7c0 |
| 205 | Jul 11 23:32:34 quantal-nested kernel: [ 1971.578747] [<ffffffff81084b4a>] __cond_resched+0x2a/0x40 |
| 206 | Jul 11 23:32:34 quantal-nested kernel: [ 1971.583011] [<ffffffff81677e90>] _cond_resched+0x30/0x40 |
| 207 | Jul 11 23:32:34 quantal-nested kernel: [ 1971.587401] [<ffffffff81677326>] down_read+0x16/0x2b |
| 208 | Jul 11 23:32:34 quantal-nested kernel: [ 1971.593630] [<ffffffff810b7acb>] acct_collect+0x4b/0x1c0 |
| 209 | Jul 11 23:32:34 quantal-nested kernel: [ 1971.597808] [<ffffffff81057d83>] do_exit+0x683/0x8e0 |
| 210 | Jul 11 23:32:34 quantal-nested kernel: [ 1971.601871] [<ffffffff8167a334>] oops_end+0xa4/0xf0 |
| 211 | Jul 11 23:32:34 quantal-nested kernel: [ 1971.605873] [<ffffffff810166b8>] die+0x58/0x90 |
| 212 | Jul 11 23:32:34 quantal-nested kernel: [ 1971.609722] [<ffffffff81679c40>] do_trap+0xc0/0x170 |
| 213 | Jul 11 23:32:34 quantal-nested kernel: [ 1971.613718] [<ffffffff8167d062>] ? __atomic_notifier_call_chain+0x12/0x20 |
| 214 | Jul 11 23:32:34 quantal-nested kernel: [ 1971.618365] [<ffffffff81679f39>] do_int3+0xd9/0x130 |
| 215 | Jul 11 23:32:34 quantal-nested kernel: [ 1971.622438] [<ffffffff81679698>] int3+0x28/0x40 |
| 216 | Jul 11 23:32:34 quantal-nested kernel: [ 1971.626413] [<ffffffff81064071>] ? sys_getpid+0x1/0x30 |
| 217 | Jul 11 23:32:34 quantal-nested kernel: [ 1971.630548] <<EOE>> [<ffffffff816812e9>] ? system_call_fastpath+0x16/0x1b |
| 218 | }}} |
| 219 | * case2 |
| 220 | * gdb attach L1 => L2 |
| 221 | * mitty@kvm-l1:~/works/linux-3.2.48$ gdb |
| 222 | {{{ |
| 223 | (gdb) file vmlinux |
| 224 | Reading symbols from /home/mitty/works/linux-3.2.48/vmlinux...done. |
| 225 | (gdb) b sys_getpid |
| 226 | Breakpoint 1 at 0xc1068290: file kernel/timer.c, line 1358. |
| 227 | (gdb) target remote 127.0.0.1:1234 |
| 228 | Remote debugging using 127.0.0.1:1234 |
| 229 | native_safe_halt () |
| 230 | at /home/mitty/works/linux-3.2.48/arch/x86/include/asm/irqflags.h:50 |
| 231 | 50 } |
| 232 | (gdb) c |
| 233 | Continuing. |
| 234 | }}} |
| 235 | * kern.log |
| 236 | {{{ |
| 237 | Jul 11 22:51:18 precise-l2 kernel: [ 440.401637] int3: 0000 [#1] SMP |
| 238 | Jul 11 22:51:18 precise-l2 kernel: [ 440.404089] Modules linked in: ppdev psmouse parport_pc serio_raw mac_hid i2c_piix4 lp parport floppy 8139too 8139cp |
| 239 | Jul 11 22:51:18 precise-l2 kernel: [ 440.404089] |
| 240 | Jul 11 22:51:18 precise-l2 kernel: [ 440.404089] Pid: 994, comm: getpid Not tainted 3.2.48 #1 Bochs Bochs |
| 241 | Jul 11 22:51:18 precise-l2 kernel: [ 440.404089] EIP: 0060:[<c1068291>] EFLAGS: 00000297 CPU: 0 |
| 242 | Jul 11 22:51:18 precise-l2 kernel: [ 440.404089] EIP is at sys_getpid+0x1/0x30 |
| 243 | Jul 11 22:51:18 precise-l2 kernel: [ 440.404089] EAX: 00000014 EBX: b7747ff4 ECX: bfb4cfc4 EDX: 000000e0 |
| 244 | Jul 11 22:51:18 precise-l2 kernel: [ 440.404089] ESI: 00000000 EDI: 00000000 EBP: e5702000 ESP: e5703fb0 |
| 245 | Jul 11 22:51:18 precise-l2 kernel: [ 440.404089] DS: 007b ES: 007b FS: 00d8 GS: 00e0 SS: 0068 |
| 246 | Jul 11 22:51:18 precise-l2 kernel: [ 440.404089] Process getpid (pid: 994, ti=e5702000 task=e57ecbc0 task.ti=e5702000) |
| 247 | Jul 11 22:51:18 precise-l2 kernel: [ 440.404089] Stack: |
| 248 | Jul 11 22:51:18 precise-l2 kernel: [ 440.404089] c158dd44 b7747ff4 bfb4cfc4 00000000 00000000 00000000 bfb4cf28 00000014 |
| 249 | Jul 11 22:51:18 precise-l2 kernel: [ 440.404089] 0000007b 0000007b 00000000 00000033 00000014 b7753416 00000073 00000246 |
| 250 | Jul 11 22:51:18 precise-l2 kernel: [ 440.404089] bfb4cf08 0000007b 00000000 00000000 |
| 251 | Jul 11 22:51:18 precise-l2 kernel: [ 440.404089] Call Trace: |
| 252 | Jul 11 22:51:18 precise-l2 kernel: [ 440.404089] [<c158dd44>] ? syscall_call+0x7/0xb |
| 253 | Jul 11 22:51:18 precise-l2 kernel: [ 440.404089] Code: f8 8b 7d fc 89 ec 5d c3 66 90 55 89 e5 3e 8d 74 26 00 8b 45 08 e8 c0 55 ff ff 5d c3 8d b4 26 00 00 00 00 8d bc 27 00 00 00 00 cc <89> e5 3e 8d 74 26 00 64 a1 4c ae 8f c1 8b 80 2c 02 00 00 8b 80 |
| 254 | Jul 11 22:51:18 precise-l2 kernel: [ 440.404089] EIP: [<c1068291>] sys_getpid+0x1/0x30 SS:ESP 0068:e5703fb0 |
| 255 | Jul 11 22:51:18 precise-l2 kernel: [ 440.584643] ---[ end trace 13cb4567d2843904 ]--- |
| 256 | Jul 11 22:51:18 precise-l2 kernel: [ 440.589404] note: getpid[994] exited with preempt_count 1 |
| 257 | Jul 11 22:51:18 precise-l2 kernel: [ 440.594107] BUG: scheduling while atomic: getpid/994/0x10000001 |
| 258 | Jul 11 22:51:18 precise-l2 kernel: [ 440.599042] Modules linked in: ppdev psmouse parport_pc serio_raw mac_hid i2c_piix4 lp parport floppy 8139too 8139cp |
| 259 | Jul 11 22:51:18 precise-l2 kernel: [ 440.614812] Pid: 994, comm: getpid Tainted: G D 3.2.48 #1 |
| 260 | Jul 11 22:51:18 precise-l2 kernel: [ 440.620549] Call Trace: |
| 261 | Jul 11 22:51:18 precise-l2 kernel: [ 440.624267] [<c1584497>] ? printk+0x2d/0x2f |
| 262 | Jul 11 22:51:18 precise-l2 kernel: [ 440.628617] [<c1584242>] __schedule_bug+0x60/0x66 |
| 263 | Jul 11 22:51:18 precise-l2 kernel: [ 440.633044] [<c158baa7>] __schedule+0x757/0x8c0 |
| 264 | Jul 11 22:51:18 precise-l2 kernel: [ 440.637723] [<c10594c6>] ? vprintk+0x176/0x4a0 |
| 265 | Jul 11 22:51:18 precise-l2 kernel: [ 440.642134] [<c10353b8>] ? default_spin_lock_flags+0x8/0x10 |
| 266 | Jul 11 22:51:18 precise-l2 kernel: [ 440.647215] [<c158dc3d>] ? _raw_spin_lock_irqsave+0x2d/0x40 |
| 267 | Jul 11 22:51:18 precise-l2 kernel: [ 440.652420] [<c10512fb>] __cond_resched+0x1b/0x30 |
| 268 | Jul 11 22:51:18 precise-l2 kernel: [ 440.656954] [<c158bc86>] _cond_resched+0x26/0x30 |
| 269 | Jul 11 22:51:18 precise-l2 kernel: [ 440.661390] [<c158cf20>] down_read+0x10/0x1f |
| 270 | Jul 11 22:51:18 precise-l2 kernel: [ 440.666075] [<c109d832>] acct_collect+0x42/0x170 |
| 271 | Jul 11 22:51:18 precise-l2 kernel: [ 440.670738] [<c105c9c7>] do_exit+0x567/0x6f0 |
| 272 | Jul 11 22:51:18 precise-l2 kernel: [ 440.675455] [<c158eb8e>] oops_end+0x8e/0xd0 |
| 273 | Jul 11 22:51:18 precise-l2 kernel: [ 440.681704] [<c1013984>] die+0x54/0x80 |
| 274 | Jul 11 22:51:18 precise-l2 kernel: [ 440.686044] [<c158e666>] do_trap+0x96/0xd0 |
| 275 | Jul 11 22:51:18 precise-l2 kernel: [ 440.690568] [<c158e8c1>] do_int3+0xa1/0xc0 |
| 276 | Jul 11 22:51:18 precise-l2 kernel: [ 440.695007] [<c158e5a4>] int3+0x30/0x38 |
| 277 | Jul 11 22:51:18 precise-l2 kernel: [ 440.699589] [<c15900d8>] ? trampoline_handler+0x158/0x190 |
| 278 | Jul 11 22:51:18 precise-l2 kernel: [ 440.704554] [<c1068291>] ? sys_getpid+0x1/0x30 |
| 279 | Jul 11 22:51:18 precise-l2 kernel: [ 440.709022] [<c158dd44>] ? syscall_call+0x7/0xb |
| 280 | }}} |