https://bugs.kde.org/show_bug.cgi?id=396415

--- Comment #6 from Geoffrey Thomas <geo...@ldpreload.com> ---
Yeah, looks like the same problem happens on FreeBSD. Here's a repro (I used
the 15.0-CURRENT AMI on AWS):

root@freebsd:~ # pkg install valgrind
root@freebsd:~ # mkdir orig
root@freebsd:~ # cd orig
root@freebsd:~/orig # cat main.c
extern void stuff(void);

int main(void) {
        stuff();
}
root@freebsd:~/orig # cat stuff.c
#include <stdio.h>

void stuff(void) {
        printf("Hello world!\n");
}
root@freebsd:~/orig # cc -shared -o libstuff.so stuff.c
root@freebsd:~/orig # cc -L. -o main main.c -lstuff -Wl,-rpath,'$ORIGIN'
root@freebsd:~/orig # cd ..
root@freebsd:~ # mkdir link
root@freebsd:~/link # ln -s ../orig/main .
root@freebsd:~/link # echo '#!/root/link/main' > script
root@freebsd:~/link # chmod +x script
root@freebsd:~/link # ./script
Hello world!
root@freebsd:~/link # valgrind --tool=none -q ./script
ld-elf.so.1: Shared object "libstuff.so" not found, required by "script"
root@freebsd:~/link # valgrind --tool=none -q ./main
Hello world!

I agree that this is probably one of the sysctls instead of /proc/self/exe.
Valgrind does some similar virtualization there.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to