[Bug runtime/30415] conflicting types for ‘kallsyms_on_each_symbol’

wcohen at redhat dot com sourceware-bugzilla@sourceware.org
Mon May 22 14:01:59 GMT 2023


https://sourceware.org/bugzilla/show_bug.cgi?id=30415

--- Comment #5 from William Cohen <wcohen at redhat dot com> ---
Hi, Martin.

I originally tried something similar to that.  However, the
stapkp_symbol_callback function in the runtime actually uses the struct module
argument when the kallsyms_on_each_symbol call back function is invoked.  Just
removing the struct module arg from stapkp_symbol_callback_function doesn't
look to be an option.  Changing to systemtap runtime replacement
kallsyms_on_each_function ends up with pretty much all the tests failing to
compile when "make installcheck" is run with errors like the following in the
systemtap.log:

TEST
PWD=/home/wcohen/systemtap_write/systemtap/testsuite/systemtap.examples/general
meta taglines 'test_check: stap -p4 alias_suffixes.stp' tag 'test_check' value
'stap -p4 alias_suffixes.stp'
attempting command stap -p4 alias_suffixes.stp
OUT In file included from
/tmp/stapeFLono/stap_ca5fcb74ddbf75aa56734f2ec18887bc_85967_src.c:6192:
/home/wcohen/systemtap_write/install/share/systemtap/runtime/linux/kprobes.c:
In function 'stapkp_init':
/home/wcohen/systemtap_write/install/share/systemtap/runtime/linux/kprobes.c:766:32:
error: passing argument 1 of 'kallsyms_on_each_symbol' from incompatible
pointer type [-Werror=incompatible-pointer-types]
  766 |        kallsyms_on_each_symbol(stapkp_symbol_callback, &sd);
      |                                ^~~~~~~~~~~~~~~~~~~~~~
      |                                |
      |                                int (*)(void *, const char *, struct
module *, long unsigned int)
In file included from
/home/wcohen/systemtap_write/install/share/systemtap/runtime/linux/runtime.h:293,
                 from
/home/wcohen/systemtap_write/install/share/systemtap/runtime/runtime.h:26,
                 from
/tmp/stapeFLono/stap_ca5fcb74ddbf75aa56734f2ec18887bc_85967_src.c:21:
/home/wcohen/systemtap_write/install/share/systemtap/runtime/sym.c:1159:35:
note: expected 'int (*)(void *, const char *, long unsigned int)' but argument
is of type 'int (*)(void *, const char *, struct module *, long unsigned int)'
 1159 | int kallsyms_on_each_symbol(int (*fn)(void *, const char *,
      |                             ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
 1160 |                                       unsigned long),
      |                                       ~~~~~~~~~~~~~~
/home/wcohen/systemtap_write/install/share/systemtap/runtime/linux/kprobes.c:
In function 'stapkp_refresh':
/home/wcohen/systemtap_write/install/share/systemtap/runtime/linux/kprobes.c:836:34:
error: passing argument 1 of 'kallsyms_on_each_symbol' from incompatible
pointer type [-Werror=incompatible-pointer-types]
  836 |          kallsyms_on_each_symbol(stapkp_symbol_callback, &sd);
      |                                  ^~~~~~~~~~~~~~~~~~~~~~
      |                                  |
      |                                  int (*)(void *, const char *, struct
module *, long unsigned int)
/home/wcohen/systemtap_write/install/share/systemtap/runtime/sym.c:1159:35:
note: expected 'int (*)(void *, const char *, long unsigned int)' but argument
is of type 'int (*)(void *, const char *, struct module *, long unsigned int)'
 1159 | int kallsyms_on_each_symbol(int (*fn)(void *, const char *,
      |                             ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
 1160 |                                       unsigned long),
      |                                       ~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make[4]: *** [scripts/Makefile.build:252:
/tmp/stapeFLono/stap_ca5fcb74ddbf75aa56734f2ec18887bc_85967_src.o] Error 1
make[3]: *** [Makefile:2044: /tmp/stapeFLono] Error 2
WARNING: kbuild exited with status: 2
Pass 4: compilation failed.  [man error::pass4]
child process exited abnormally
RC 1
FAIL: systemtap.examples/general/alias_suffixes build

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the Systemtap mailing list