Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't load dtracedrv.ko; unknown symbols: ctf_init and ctf_exit #16

Closed
msabramo opened this issue Feb 29, 2012 · 3 comments
Closed

Can't load dtracedrv.ko; unknown symbols: ctf_init and ctf_exit #16

msabramo opened this issue Feb 29, 2012 · 3 comments

Comments

@msabramo
Copy link
Contributor

I finally was able to build from the head of the github repo, but now I can't load the kernel module, dtracedrv.ko:

marca@ubuntu:~/src/dtrace4linux/newlinux$ make all
...
/home/marca/src/dtrace4linux/newlinux/build-2.6.32-38-generic/driver/vminfo.c:46: warning: 'sdt_add_locator' defined but not used
/home/marca/src/dtrace4linux/newlinux/build-2.6.32-38-generic/driver/vminfo.c:66: warning: 'vminfo_instr_callback' defined but not used
  CC [M]  /home/marca/src/dtrace4linux/newlinux/build-2.6.32-38-generic/driver/x_call.o
  CC [M]  /home/marca/src/dtrace4linux/newlinux/build-2.6.32-38-generic/driver/divmod64.o
  LD [M]  /home/marca/src/dtrace4linux/newlinux/build-2.6.32-38-generic/driver/dtracedrv.o
  Building modules, stage 2.
  MODPOST 1 modules
WARNING: "ctf_exit" [/home/marca/src/dtrace4linux/newlinux/build-2.6.32-38-generic/driver/dtracedrv.ko] undefined!
WARNING: "ctf_init" [/home/marca/src/dtrace4linux/newlinux/build-2.6.32-38-generic/driver/dtracedrv.ko] undefined!
  CC      /home/marca/src/dtrace4linux/newlinux/build-2.6.32-38-generic/driver/dtracedrv.mod.o
  LD [M]  /home/marca/src/dtrace4linux/newlinux/build-2.6.32-38-generic/driver/dtracedrv.ko
tools/mkctf.sh
-rw-r--r-- 1 marca marca 96284 Feb 29 14:45 build/linux-2.6.32-38-generic.ctf
sync
marca@ubuntu:~/src/dtrace4linux/newlinux$ sudo make load
tools/load.pl
14:47:50 Syncing...
14:47:50 Loading: build-2.6.32-38-generic/driver/dtracedrv.ko
insmod: error inserting 'build-2.6.32-38-generic/driver/dtracedrv.ko': -1 Unknown symbol in module

An error was detected loading the driver. Refer to
/var/log/messages or 'dmesg' to see what the issue
might be. For your convenience, here is the last few
lines from /var/log/messages:

===== tail -10 /var/log/messages
Feb 29 08:56:13 ubuntu kernel: [   99.802095] __ratelimit: 21 callbacks suppressed
Feb 29 08:56:13 ubuntu kernel: [   99.802098] type=1503 audit(1330534573.088:18):  operation="capable" pid=10204 parent=10200 profile="/usr/sbin/cupsd" name="sys_admin"
Feb 29 09:37:17 ubuntu kernel: [ 2560.567424] eth0: link down
Feb 29 09:37:28 ubuntu kernel: [ 2571.083710] eth0: link up
Feb 29 09:37:50 ubuntu kernel: [ 2593.050661] eth0: link down
Feb 29 09:38:00 ubuntu kernel: [ 2603.033176] eth0: link up
Feb 29 14:44:29 ubuntu kernel: [17366.909133] dtracedrv: module license 'CDDL' taints kernel.
Feb 29 14:44:29 ubuntu kernel: [17366.909153] Disabling lock debugging due to kernel taint
Feb 29 14:44:29 ubuntu kernel: [17366.909966] dtracedrv: Unknown symbol ctf_init
Feb 29 14:44:29 ubuntu kernel: [17366.910294] dtracedrv: Unknown symbol ctf_exit
make: *** [load] Error 1

I wonder is this is a side-effect of the change I made to replace the various .o files with libctf.a. Perhaps libctf.a doesn't have all of those object files...

@dtrace4linux
Copy link
Owner

yes - because of the missing driver/ctf*.c files, your solution picked the wrong files. The ctf stuff is confusing, but actually quite simple.

@msabramo
Copy link
Contributor Author

I don't understand it yet. Perhaps someday I will. But at least we're making progress on getting everything to build more easily! :-)

@msabramo
Copy link
Contributor Author

OK, I started off with a clean master. I still have to apply a680dfb to avoid issue #11 ("error: invalid storage class for function 'DEFINE_SEMAPHORE'"), but then the module builds and loads!

marca@ubuntu:~/src/dtrace4linux/newlinux$ sudo make load
tools/load.pl
15:03:48 Syncing...
15:03:48 Loading: build-2.6.32-38-generic/driver/dtracedrv.ko
15:03:49 Preparing symbols...
15:03:49 Probes available: 277007
15:03:51 Time: 3s

azat added a commit to azat-archive/dtrace4linux that referenced this issue Aug 7, 2013
I see this is happens in gdb:

gdb bt:
 #0  taskq_dispatch2 (tq=0xffff88003712e600, func=0x0 <irq_stack_union>,
     arg=0x0 <irq_stack_union>, flags=0, delay=1)
     at /usr/src/dtrace4linux/build-3.11.0-rc4+/driver/taskq.c:263
 dtrace4linux#1  0xffffffffa0369433 in timeout (
     func=func@entry=0xffffffffa035c9d5 <fasttrap_pid_cleanup_cb>,
     arg=arg@entry=0x0 <irq_stack_union>, ticks=ticks@entry=1)
     at /usr/src/dtrace4linux/build-3.11.0-rc4+/driver/taskq.c:306
 dtrace4linux#2  0xffffffffa035c9c0 in fasttrap_pid_cleanup ()
     at /usr/src/dtrace4linux/build-3.11.0-rc4+/driver/fasttrap.c:505
 dtrace4linux#3  0xffffffffa035cdbf in fasttrap_provider_retire (pid=<optimized out>,
     name=0xffffffffa037eb8f "pid", name@entry=0x140ef <Address 0x140ef out of bounds>,
     mprov=mprov@entry=0) at /usr/src/dtrace4linux/build-3.11.0-rc4+/driver/fasttrap.c:1713
 dtrace4linux#4  0xffffffffa035ce08 in fasttrap_exec_exit (p=0xffff8800371d3b18)
     at /usr/src/dtrace4linux/build-3.11.0-rc4+/driver/fasttrap.c:596
 dtrace4linux#5  0xffffffffa0358c09 in proc_exit_notifier (n=<optimized out>, code=<optimized out>,
     ptr=<optimized out>)
     at /usr/src/dtrace4linux/build-3.11.0-rc4+/driver/dtrace_linux.c:2020
 dtrace4linux#6  0xffffffff8139b2d3 in notifier_call_chain (
     nl=nl@entry=0xffffffff81634da0 <task_exit_notifier+32>, val=val@entry=0,
     v=v@entry=0xffff88007b62b040, nr_to_call=nr_to_call@entry=-1,
     nr_calls=nr_calls@entry=0x0 <irq_stack_union>) at kernel/notifier.c:93
 dtrace4linux#7  0xffffffff8105824b in __blocking_notifier_call_chain (
     nh=nh@entry=0xffffffff81634d80 <task_exit_notifier>, val=val@entry=0,
     v=0xffff88007b62b040, nr_to_call=nr_to_call@entry=-1,
     nr_calls=nr_calls@entry=0x0 <irq_stack_union>) at kernel/notifier.c:314
 dtrace4linux#8  0xffffffff81058273 in blocking_notifier_call_chain (
     nh=nh@entry=0xffffffff81634d80 <task_exit_notifier>, val=val@entry=0,
     v=<optimized out>) at kernel/notifier.c:325
 dtrace4linux#9  0xffffffff810750f5 in profile_task_exit (task=<optimized out>) at kernel/profile.c:143
 dtrace4linux#10 0xffffffff8103a3cf in do_exit ()
 dtrace4linux#11 0xffffffff8103b87c in do_group_exit ()
 dtrace4linux#12 0xffffffff81047522 in get_signal_to_deliver ()
 dtrace4linux#13 0xffffffff81002176 in do_signal ()
 dtrace4linux#14 0xffffffff810025d3 in do_notify_resume ()
 dtrace4linux#15 <signal handler called>
 dtrace4linux#16 0x00007fed3818fff8 in ?? ()

 Refs dtrace4linux#61
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants