From: Henry N. <hen...@ar...> - 2011-04-26 21:25:40
|
Hello Fabrice, installing the module is not a problem: debian:~# insmod kprobe_example.ko Planted kprobe at c1018be0 But, a follow "lsmod" crashes the kernel. The text from pre_handler is seen. The bug is in top of the do_fork function. I assume, that kprobe does some magic to redirect the function call. I can not say why, because I don't know how it works. Address 01200011 is truely a fault. All virtual addresses should be grater than 0xc0000000. By the while, this is an interesting kernel module for debugging. ;-) >>> start syslog >>> pre_handler: p->addr = 0xc1018be0, ip = c1018be1, flags = 0x246 BUG: unable to handle kernel paging request at 01200011 IP: [<c1018be0>] do_fork+0x0/0x2d0 *pde = 00000000 Oops: 0000 [#1] PREEMPT last sysfs file: /sys/devices/virtual/net/lo/operstate Modules linked in: kprobe_example Pid: 2384, comm: bash Not tainted 2.6.33.7-co-0.7.9-r1582 #3 / EIP: 0060:[<c1018be0>] EFLAGS: 00010246 CPU: 0 EIP is at do_fork+0x0/0x2d0 EAX: 01200011 EBX: 00000000 ECX: c79c3fb4 EDX: bfc64c8c ESI: bfc64c8c EDI: 01200011 EBP: c79c3f84 ESP: c79c3f3c DS: 007b ES: 007b FS: 0000 GS: 0033 SS: 0068 Process bash (pid: 2384, ti=c79c2000 task=c7ba73f0 task.ti=c79c2000) Stack: b75af708 c79c3fa0 c1272789 00000000 c79c3fb4 bfc64c8c b75af708 b75af708 <0> c79c3fa0 01200011 0120007b c7ad007b c79c0000 00000000 ffffffff 00000000 <0> b75af708 b75af708 c79c3fa0 c1005d9f 00000000 00000000 b75af708 01200011 Call Trace: [<c1272789>] ? debug_stack_correct+0x29/0x30 [<c1005d9f>] ? sys_clone+0x2f/0x40 [<c1002ce5>] ? ptregs_clone+0x15/0x30 [<c1272485>] ? syscall_call+0x7/0xb Code: 00 00 89 83 ec 02 00 00 e9 a2 f8 ff ff 8b 83 94 02 00 00 8b 40 10 e8 60 b8 0a 00 85 c0 89 c6 0f 89 5b f7 ff ff eb a0 8d 74 26 00 <cc> 89 e5 57 89 c7 56 89 d6 53 83 ec 3c a9 00 00 00 10 0f 85 98 EIP: [<c1018be0>] do_fork+0x0/0x2d0 SS:ESP 0068:c79c3f3c CR2: 0000000001200011 <<< end syslog <<< -- Henry On 26.04.2011 11:01, Fabrice Clement wrote: > Hi > > I'm using colinux 0.7.9 and I want to use kprobe, so I activated > the "Build kprobes examples -- loadable modules only" (and > the things for kprobe to work) but when I do insmod krpobe_example.ko > in the samples directory of the kernel, the system crashes. > > Has someone succeed in using kprobe with colinux ? > > Thanks ! > -- > Fabrice Clement |