public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* [Bug runtime/31039] New: implicit declaration of function ‘stap_task_finder_complete’
@ 2023-11-07 14:39 mcermak at redhat dot com
  2023-12-06 22:36 ` [Bug runtime/31039] " wcohen at redhat dot com
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: mcermak at redhat dot com @ 2023-11-07 14:39 UTC (permalink / raw)
  To: systemtap

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

            Bug ID: 31039
           Summary: implicit declaration of function
                    ‘stap_task_finder_complete’
           Product: systemtap
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: runtime
          Assignee: systemtap at sourceware dot org
          Reporter: mcermak at redhat dot com
  Target Milestone: ---

On Fedora 40, auto_path.exp fails with "implicit declaration of function
‘stap_task_finder_complete’".  Smaller reproducer:

f40 x86_64 # pwd
/root/systemtap/testsuite/systemtap.base
f40 x86_64 # gcc -g auto_path.c 
f40 x86_64 # stap -I tapset -e 'probe ap1.process {println(pp())}' -c ./a.out 
In file included from
/tmp/stap9p91aS/stap_6d06511a67f12d9b3e0b31aa80968db5_1658_src.c:250:
/usr/local/share/systemtap/runtime/linux/uprobes-inode.c: In function
‘stapiu_probe_prehandler’:
/usr/local/share/systemtap/runtime/linux/uprobes-inode.c:209:13: error:
implicit declaration of function ‘stap_task_finder_complete’; did you mean
‘stap_task_finder_post_init’? [-Werror=implicit-function-declaration]
  209 |         if (stap_task_finder_complete())
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~
      |             stap_task_finder_post_init
/tmp/stap9p91aS/stap_6d06511a67f12d9b3e0b31aa80968db5_1658_src.c: At top level:
/tmp/stap9p91aS/stap_6d06511a67f12d9b3e0b31aa80968db5_1658_src.c:394:76: error:
‘struct stap_task_finder_target’ has no member named ‘build_id_len’
  394 |   { .finder={  .purpose="inode-uprobes",
.callback=&stapiu_process_found, .build_id_len=0,
.procname="/tmp/stap_auto_path/a/ap1", },
.module_name="/tmp/stap_auto_path/a/ap1", .offset=(loff_t)0x110aULL,
.probe=(&stap_probes[0]), },
      |                                                                        
   ^~~~~~~~~~~~
cc1: all warnings being treated as errors
make[1]: *** [scripts/Makefile.build:243:
/tmp/stap9p91aS/stap_6d06511a67f12d9b3e0b31aa80968db5_1658_src.o] Error 1
make: *** [Makefile:1931: /tmp/stap9p91aS] Error 2
WARNING: kbuild exited with status: 2
Pass 4: compilation failed.  [man error::pass4]
Kernel version 6.7.0 is outside tested range 2.6.32 ... 6.5
f40 x86_64 #

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug runtime/31039] implicit declaration of function ‘stap_task_finder_complete’
  2023-11-07 14:39 [Bug runtime/31039] New: implicit declaration of function ‘stap_task_finder_complete’ mcermak at redhat dot com
@ 2023-12-06 22:36 ` wcohen at redhat dot com
  2023-12-11 21:08 ` wcohen at redhat dot com
  2023-12-11 22:15 ` wcohen at redhat dot com
  2 siblings, 0 replies; 4+ messages in thread
From: wcohen at redhat dot com @ 2023-12-06 22:36 UTC (permalink / raw)
  To: systemtap

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

William Cohen <wcohen at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |wcohen at redhat dot com

--- Comment #1 from William Cohen <wcohen at redhat dot com> ---
I see this failing on Fedora rawhide, but things working on Fedora 39.  The
function is coming inside the runtime:

$ grep  stap_task_finder_complete -r
runtime/linux/task_finder2.c:stap_task_finder_complete(void)
runtime/linux/uprobes-inode.c:  if (stap_task_finder_complete())

Looks like there is some #ifdef change tha cause that function in
task_finder2.c to be exclude or to cause the code in uprobes-inode.c with the
stap_task_finder_complete() reference to be compiled.

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug runtime/31039] implicit declaration of function ‘stap_task_finder_complete’
  2023-11-07 14:39 [Bug runtime/31039] New: implicit declaration of function ‘stap_task_finder_complete’ mcermak at redhat dot com
  2023-12-06 22:36 ` [Bug runtime/31039] " wcohen at redhat dot com
@ 2023-12-11 21:08 ` wcohen at redhat dot com
  2023-12-11 22:15 ` wcohen at redhat dot com
  2 siblings, 0 replies; 4+ messages in thread
From: wcohen at redhat dot com @ 2023-12-11 21:08 UTC (permalink / raw)
  To: systemtap

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

--- Comment #2 from William Cohen <wcohen at redhat dot com> ---
Simplified the reproduce a bit more to:

stap -p4 -k -e 'probe process("a.out").function("main") {println(pp())}' -c
./a.out

Copied over the saved /tmp/stap* directories to the same machine and compared
the stapconfig*.h files:

$ diff -u0 pr31039_work/stapconf_1bb440e7276e415100ffcad1e32728e1_750.h
pr31039_broken/stapconf_9b039485a92757b3b5bcb8bed0dea5cd_953.h 
--- pr31039_work/stapconf_1bb440e7276e415100ffcad1e32728e1_750.h       
2023-12-11 14:43:43.486670764 -0500
+++ pr31039_broken/stapconf_9b039485a92757b3b5bcb8bed0dea5cd_953.h     
2023-12-11 14:41:21.846997966 -0500
@@ -46 +45,0 @@
-#define STAPCONF_UTRACE_VIA_TRACEPOINTS 1

The rawhide autoconf-utrace-via-tracepoints.c is failing to build.  This causes
the following code in runtime/linux/runtime.h to not include the needed
stap_task_finder_complete() or real definition of struct
stap_task_finder_target:


#if (defined(STAPCONF_UTRACE_VIA_TRACEPOINTS))
#define HAVE_TASK_FINDER
#include "task_finder.c"
#else
/* stub functionality that fails gracefully */
#include "task_finder_stubs.c"
#endif

The rawhide kernel has the tracepoints mentioned in
autoconf-utrace-via-tracepoints.c.  Adding "-vvvvv" to the commandline provide
the information about the autoconf compiles.  See the following on the x86_64
rawhide machine where there is a problem because of the struct folio:


if gcc -DMODULE -nostdinc -D__KERNEL__ -fmacro-prefix-map=./= 
-I./arch/x86/include -I./arch/x86/include/generated  -I./include
-I./arch/x86/include/uapi -I./arch/x86/include/generated/uapi -I./include/uapi
-I./include/generated/uapi -include ./include/linux/compiler-version.h -include
./include/linux/kconfig.h  -std=gnu11 -fshort-wchar -funsigned-char -fno-common
-fno-PIE -fno-strict-aliasing -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -mno-avx
-fcf-protection=branch -fno-jump-tables -m64 -falign-jumps=1 -falign-loops=1
-mno-80387 -mno-fp-ret-in-387 -mpreferred-stack-boundary=3 -mskip-rax-setup
-mtune=generic -mno-red-zone -mcmodel=kernel -Wno-sign-compare
-fno-asynchronous-unwind-tables -mindirect-branch=thunk-extern
-mindirect-branch-register -mindirect-branch-cs-prefix
-mfunction-return=thunk-extern -fno-jump-tables -mharden-sls=all
-fpatchable-function-entry=16,16 -fno-delete-null-pointer-checks -O2
-fno-allow-store-data-races -fstack-protector-strong
-ftrivial-auto-var-init=zero  -fno-stack-clash-protection -pg -mrecord-mcount
-mfentry -DCC_USING_FENTRY -falign-functions=16  -fstrict-flex-arrays=3
-fno-strict-overflow -fno-stack-check -fconserve-stack -Wall -Wundef
-Werror=implicit-function-declaration -Werror=implicit-int -Werror=return-type
-Werror=strict-prototypes -Wno-format-security -Wno-trigraphs
-Wno-frame-address -Wno-address-of-packed-member -Wframe-larger-than=2048
-Wno-main -Wno-unused-but-set-variable -Wno-unused-const-variable
-Wno-dangling-pointer -Wvla -Wno-pointer-sign  -Wcast-function-type
-Wno-array-bounds -Wno-alloc-size-larger-than -Wimplicit-fallthrough=5
-Werror=date-time -Werror=incompatible-pointer-types -Werror=designated-init
-Wenum-conversion -Wno-unused-but-set-variable -Wno-unused-const-variable
-Wno-restrict -Wno-packed-not-aligned -Wno-format-overflow
-Wno-format-truncation -Wno-stringop-overflow -Wno-stringop-truncation
-Wno-missing-field-initializers -Wno-type-limits -Wno-shift-negative-value
-Wno-maybe-uninitialized -Wno-sign-compare     -DKBUILD_BASENAME=\"stap_40592\"
-Werror -S -o /dev/null -xc 
"/usr/share/systemtap/runtime"/linux/autoconf-utrace-via-tracepoints.c; then
echo "#define STAPCONF_UTRACE_VIA_TRACEPOINTS 1"; fi >>
/tmp/stapKt8wF0/autoconf-utrace-via-tracepoints.c.h
if gcc -DMODULE -nostdinc -D__KERNEL__ -fmacro-prefix-map=./= 
-I./arch/x86/include -I./arch/x86/include/generated  -I./include
-I./arch/x86/include/uapi -I./arch/x86/include/generated/uapi -I./include/uapi
-I./include/generated/uapi -include ./include/linux/compiler-version.h -include
./include/linux/kconfig.h  -std=gnu11 -fshort-wchar -funsigned-char -fno-common
-fno-PIE -fno-strict-aliasing -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -mno-avx
-fcf-protection=branch -fno-jump-tables -m64 -falign-jumps=1 -falign-loops=1
-mno-80387 -mno-fp-ret-in-387 -mpreferred-stack-boundary=3 -mskip-rax-setup
-mtune=generic -mno-red-zone -mcmodel=kernel -Wno-sign-compare
-fno-asynchronous-unwind-tables -mindirect-branch=thunk-extern
-mindirect-branch-register -mindirect-branch-cs-prefix
-mfunction-return=thunk-extern -fno-jump-tables -mharden-sls=all
-fpatchable-function-entry=16,16 -fno-delete-null-pointer-checks -O2
-fno-allow-store-data-races -fstack-protector-strong
-ftrivial-auto-var-init=zero  -fno-stack-clash-protection -pg -mrecord-mcount
-mfentry -DCC_USING_FENTRY -falign-functions=16  -fstrict-flex-arrays=3
-fno-strict-overflow -fno-stack-check -fconserve-stack -Wall -Wundef
-Werror=implicit-function-declaration -Werror=implicit-int -Werror=return-type
-Werror=strict-prototypes -Wno-format-security -Wno-trigraphs
-Wno-frame-address -Wno-address-of-packed-member -Wframe-larger-than=2048
-Wno-main -Wno-unused-but-set-variable -Wno-unused-const-variable
-Wno-dangling-pointer -Wvla -Wno-pointer-sign  -Wcast-function-type
-Wno-array-bounds -Wno-alloc-size-larger-than -Wimplicit-fallthrough=5
-Werror=date-time -Werror=incompatible-pointer-types -Werror=designated-init
-Wenum-conversion -Wno-unused-but-set-variable -Wno-unused-const-variable
-Wno-restrict -Wno-packed-not-aligned -Wno-format-overflow
-Wno-format-truncation -Wno-stringop-overflow -Wno-stringop-truncation
-Wno-missing-field-initializers -Wno-type-limits -Wno-shift-negative-value
-Wno-maybe-uninitialized -Wno-sign-compare     -DKBUILD_BASENAME=\"stap_40592\"
-Werror -S -o /dev/null -xc 
"/usr/share/systemtap/runtime"/linux/autoconf-task_work-struct.c; then echo
"#define STAPCONF_TASK_WORK_STRUCT 1"; fi >>
/tmp/stapKt8wF0/autoconf-task_work-struct.c.h
In file included from ./include/trace/events/sched.h:9,
                 from
/usr/share/systemtap/runtime/linux/autoconf-utrace-via-tracepoints.c:1:
./include/linux/sched/numa_balancing.h:33:63: error: ‘struct folio’ declared
inside parameter list will not be visible outside of this definition or
declaration [-Werror]
   33 | bool should_numa_migrate_memory(struct task_struct *p, struct folio
*folio,
      |                                                               ^~~~~
/usr/share/systemtap/runtime/linux/autoconf-task_work-struct.c: In function
‘__autoconf_func’:
/usr/share/systemtap/runtime/linux/autoconf-task_work-struct.c:7:26: error:
storage size of ‘work’ isn’t known
    7 |         struct task_work work;
      |                          ^~~~
/usr/share/systemtap/runtime/linux/autoconf-task_work-struct.c:9:9: error: too
many arguments to function ‘init_task_work’
    9 |         init_task_work(&work, NULL, NULL);
      |         ^~~~~~~~~~~~~~
In file included from
/usr/share/systemtap/runtime/linux/autoconf-task_work-struct.c:1:
./include/linux/task_work.h:11:1: note: declared here
   11 | init_task_work(struct callback_head *twork, task_work_func_t func)
      | ^~~~~~~~~~~~~~
/usr/share/systemtap/runtime/linux/autoconf-task_work-struct.c:7:26: error:
unused variable ‘work’ [-Werror=unused-variable]
    7 |         struct task_work work;
      |                          ^~~~
cc1: all warnings being treated as errors

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug runtime/31039] implicit declaration of function ‘stap_task_finder_complete’
  2023-11-07 14:39 [Bug runtime/31039] New: implicit declaration of function ‘stap_task_finder_complete’ mcermak at redhat dot com
  2023-12-06 22:36 ` [Bug runtime/31039] " wcohen at redhat dot com
  2023-12-11 21:08 ` wcohen at redhat dot com
@ 2023-12-11 22:15 ` wcohen at redhat dot com
  2 siblings, 0 replies; 4+ messages in thread
From: wcohen at redhat dot com @ 2023-12-11 22:15 UTC (permalink / raw)
  To: systemtap

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

William Cohen <wcohen at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|NEW                         |RESOLVED

--- Comment #3 from William Cohen <wcohen at redhat dot com> ---
This has been fixed by:

commit 39b3819b69536e8a652920bf491442f26e187a19 (HEAD -> master, origin/master,
origin/HEAD)
Author: William Cohen <wcohen@redhat.com>
Date:   Mon Dec 11 17:03:18 2023 -0500

    PR31039: Make autoconf-utrace-via-tracepoints.c work with struct folio

    Newer linux kernels are using struct folio in place of struct page.
    Kernel git commit 8c9ae56dc73b5ae48 replaces the struct page argument
    in should_numa_migrate_memory() with a struct folio.  To make the
    autoconf-utrace-via-tracepoints.c test compile properly needed to add
    an include to pull in the struct folio definition.  This allows the
    auto_path.exp and many other tests using userspace probes to function
    properly on the newer Linux 6.7 kernels.

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-12-11 22:15 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-07 14:39 [Bug runtime/31039] New: implicit declaration of function ‘stap_task_finder_complete’ mcermak at redhat dot com
2023-12-06 22:36 ` [Bug runtime/31039] " wcohen at redhat dot com
2023-12-11 21:08 ` wcohen at redhat dot com
2023-12-11 22:15 ` wcohen at redhat dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).