control: reassign -1 nbdkit control: tag -1 + patch Hi,
On 2024-11-26 15:47, Hilko Bengen wrote: > Package: libc6 > Version: 2.40-4 > Severity: serious > Control: notfound -1 2.39-7 > > Dear Maintainer, > > in investigating the root cause for #1082751 I found that current nbdkit > built on unstable/mips64el segfaults in printf() with libc6/2.40-4 – but > not with 2.39. > > ,---- > | nbdkit [-4|--ipv4-only] [-6|--ipv6-only] > | [-D|--debug PLUGIN|FILTER|nbdkit.FLAG=N] > | [--exit-with-parent] [-e|--exportname EXPORTNAME] > | [--filter=FILTER ...] [-f|--foreground] > | [-g|--group GROUP] [-i|--ipaddr IPADDR] > | [--log=stderr|syslog|null] [--mask-handshake=MASK] > | [-n|--newstyle] [--no-mc|--no-meta-contexts] > | [--no-sr|--no-structured-replies] [-o|--oldstyle] > | [-P|--pidfile PIDFILE] [-p|--port PORT] [--print-uri] > | [-r|--readonly] [--run 'COMMAND ARGS ...'] > | [--selinux-label=LABEL] [-s|--single] [--swap] > | [-t|--threads THREADS] [--tls=off|on|require] > | [--tls-certificates=/path/to/certificates] > | [--tls-psk=/path/to/pskfile] [--tls-verify-peer] > | [-U|--unix SOCKET|-] [-u|--user USER] > | [-v|--verbose] [--vsock] > | PLUGIN [[KEY=]VALUE [KEY=VALUE [...]]] > | > | nbdkit --dump-config > | > | nbdkit PLUGIN --dump-plugin > | > | nbdkit --help > | > | nbdkit [-V|--version] > | > | Program received signal SIGSEGV, Segmentation fault. > `---- > > The stacktrace suggests to me that the crash happens within glibc's I/O > buffer handling; main's argc has apparently be overwritten with a > nonsensical value. Yep, I confirm this is linked with that. I have tracked down the issue to two parts: - nbdkit uses a version script with -rdynamic, which causes the _IO_stdin_used symbol from crt1.o to not be included in nbdkit binary. This is used by the GNU libc determine which version of the I/O functions should be used. Not exporting it means that the "old" version is used, leading to possible crashes or other issues on architectures that were supported by glibc 2.0. That is for debian: i386 and mips64el for official architectures and alpha, hppa, m68k, powerpc, sh4 and sparc64 for ports architecture. - glibc 2.40 changed the format of the libio structures even more [1], increasing the incompatibilities. Therefore I believe the problem has to be fixed on the nbdkit side, with the following patch: --- nbdkit-1.40.4.orig/server/nbdkit.syms +++ nbdkit-1.40.4/server/nbdkit.syms @@ -100,6 +100,12 @@ # For AFL++ to work: __afl_*; + # The _IO_stdin_used symbol is used by the GNU libc determine which + # version of the I/O functions should be used. Not exporting it + # means that the "old" version is used, leading to crashes or other + # issues on architectures that were supported by glibc 2.0. + _IO_stdin_used; + # Everything else is hidden. local: *; }; Regards Aurelien [1] https://sourceware.org/git/?p=glibc.git;a=commit;h=2a99e2398d9d717c034e915f7846a49e623f5450 -- Aurelien Jarno GPG: 4096R/1DDD8C9B aurel...@aurel32.net http://aurel32.net