On Wed, Mar 27, 2019 at 01:55:44PM +0000, Zbigniew Jędrzejewski-Szmek wrote:
Hi,
I'm trying to compile systemd in koji and mock, and I'm getting suspicious crashes...
$ valgrind x86_64-redhat-linux-gnu/test-terminal-util /* test_default_term_for_tty */ ... /* test_read_one_char */ ==21== Invalid read of size 4 ==21== at 0x48C09EC: fputs (in /usr/lib64/libc-2.29.9000.so) ==21== by 0x109301: UnknownInlinedFun (test-terminal-util.c:43) ==21== by 0x109301: main (test-terminal-util.c:80) ==21== Address 0x0 is not stack'd, malloc'd or (recently) free'd ==21== ==21== ==21== Process terminating with default action of signal 11 (SIGSEGV)
The problem is at this line, there is just a call to (a function which transitively calls) mkostemp(). It seems like the inlining is somehow going wrong.
It turns out that our test case was wrong. I was confused because the inlining causes the backtrace to report an unrelated spot.
Strangely, gdb also crashes: $ gdb x86_64-redhat-linux-gnu/test-terminal-util GNU gdb (GDB) Fedora 8.3.50.20190321-3.fc31 ... Reading symbols from x86_64-redhat-linux-gnu/test-terminal-util... (gdb) r Starting program: /builddir/build/BUILD/systemd-49bd196d693efe0acfc8d56c4e3d8f7ba9f91b5d/x86_64-redhat-linux-gnu/test-terminal-util Missing separate debuginfos, use: dnf debuginfo-install glibc-2.29.9000-8.fc31.x86_64 [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib64/libthread_db.so.1". /* test_default_term_for_tty */ ... /* test_read_one_char */
Program received signal SIGSEGV, Segmentation fault. 0x00007ffff7e759ec in fputs () from /lib64/libc.so.6 Segmentation fault (core dumped)
This is still a problem. gdb crashes on any program in rawhide mock for me right now. But gcc seems to be fine.
Zbyszek