Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Skipped - Unit
Tests Skipped
Event Timeline
| bin/pkill/pkill.c | ||
|---|---|---|
| 152 | getprogname() should return name without the path /rescue/ . I think we should investigate why pgrep linked with contrib/openzfs/lib/libspl
| |
| bin/pkill/pkill.c | ||
|---|---|---|
| 152 | It is not just the pgrep binary. Most of the executables in /rescue are a single binary linked to multiple filenames. This includes zfs and zpool. My question is, why is the getprogname() call in pkill.c calling getexecname() instead? | |
| bin/pkill/pkill.c | ||
|---|---|---|
| 152 | After dig into libspl I get some clues. zlei@:~ % llvm-objdump -d /lib/libspl.so.2 | grep getexecname
zlei@:~ % llvm-objdump -d /lib/libspl.so.2 | grep getprogname
0000000000007220 <getprogname>:
724c: 74 09 je 0x7257 <getprogname+0x37>
7255: eb 52 jmp 0x72a9 <getprogname+0x89>
728e: 75 10 jne 0x72a0 <getprogname+0x80>
7298: 74 06 je 0x72a0 <getprogname+0x80>
729e: eb 09 jmp 0x72a9 <getprogname+0x89>
72bc: 75 0c jne 0x72ca <getprogname+0xaa>stable/13 merged openzfs and it contains libspl which has its own implementation of getexecname() [1] . Well unfortunately the Makefile [2] of libspl still include the *shim* cddl/compat/opensolaris/include/stdlib.h which define getexecname to getprogname . sys/contrib/openzfs/lib/libspl/os/freebsd/getexecname.c include stdlib.h resulting the function name change from getexecname to getprogname which conflict with stand c library (libc). So when statically linked with libspl, programs requires getprogname() might bind the wrong version of getprogname(). For /rescue, if zfs is enabled (the default), then all programs will link with libspl . .if ${MK_ZFS} != "no"
CRUNCH_LIBS+= -lavl -lzpool -lzfs_core -lzfs -lnvpair -lpthread -luutil -lumem
CRUNCH_LIBS+= -lbe -lzfsbootenv -lzutil -ltpool -lspl -licp_rescue
.else
...After checking zfs sources in stable/12, I think the *shim* is no longer needed for stable/13 and current/14 . [1] sys/contrib/openzfs/lib/libspl/os/freebsd/getexecname.c | |
https://cgit.freebsd.org/src/commit/?id=7f0ebf0876c82a098bd5815ea6bf3a8efa6dd6f3
Do we abandon this one?