https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=278489
Bug ID: 278489
Summary: dtrace; pid probe; unable to match constructor
functions
Product: Base System
Version: 14.0-RELEASE
Hardware: amd64
OS: Any
Status: New
Severity: Affects Some People
Priority: ---
Component: kern
Assignee: [email protected]
Reporter: [email protected]
It seems dtrace on FreeBSD is not matching constructor functions during
execution.
Very simple test program:
#include <stdio.h>
void __attribute__((constructor)) myinit() {
printf("%s: hello\n", __func__);
}
int main() {
return 42;
}
Listing the probes works as expected:
# dtrace -ln 'pid$target:a.out::entry' -c ./simple
myinit: hello
ID PROVIDER MODULE FUNCTION NAME
82966 pid5454 simple __do_global_dtors_aux entry
82967 pid5454 simple register_classes entry
82968 pid5454 simple __do_global_ctors_aux entry
82969 pid5454 simple _start entry
82970 pid5454 simple main entry
82971 pid5454 simple myinit entry
But when I run it:
# dtrace -n 'pid$target:a.out::entry' -c ./simple
myinit: hello
dtrace: description 'pid$target:a.out::entry' matched 6 probes
dtrace: pid 5458 exited with status 42
CPU ID FUNCTION:NAME
1 82969 _start:entry
1 82970 main:entry
1 82966 __do_global_dtors_aux:entry
myinit() is not matched.
This works on Solaris where constructor functions are properly matched.
--
You are receiving this mail because:
You are the assignee for the bug.