Fixed
Created: Mar 10, 2017
Updated: Dec 3, 2018
Resolved Date: Mar 17, 2017
Found In Version: 8.0
Fix Version: 8.0.0.16
Severity: Standard
Applicable for: Wind River Linux 8
Component/s: Userspace
This is an issue (use after free) of detached pthreads.
It is a regression. glibc-2.19 works well. Fixed in glibc-2.25.
Related systemd issue issue:
https://github.com/systemd/systemd/issues/4905
https://sourceware.org/bugzilla/show_bug.cgi?id=20116
configure --enable-board=intel_x86-64 --enable-kernel=standard --enable-rootfs=glibc-std --enable-internet-download=yes --with-package=gdb --with-template=feature/kvm,feature/target-toolchain
root@qemu3:~# ./reproducer
.reproducer[12667]: segfault at 7fa5c2bf8d13 ip 00007fa631881b97 sp 00007ffdd3b7f170 error 4 in libpthread-2.22.so[7fa63187a000+18000]
Segmentation fault (core dumped)
root@qemu3:~# gdb ./reproducer core.12667
GNU gdb (GDB) 7.10.1
Copyright (C) 2015 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-wrs-linux".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./reproducer...done.
[New LWP 12667]
[New LWP 24557]
warning: Could not load shared library symbols for linux-vdso.so.1.
Do you need "set solib-search-path" or "set sysroot"?
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
Core was generated by `./reproducer'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0 __pthread_create_2_1 (newthread=0x7ffdd3b7f278, attr=<optimized out>,
start_routine=0x4008a7 <thread_start>, arg=0x0) at pthread_create.c:709
709 if (pd->stopped_start)
[Current thread is 1 (Thread 0x7fa631cb0700 (LWP 12667))]
(gdb) bt
#0 __pthread_create_2_1 (newthread=0x7ffdd3b7f278, attr=<optimized out>,
start_routine=0x4008a7 <thread_start>, arg=0x0) at pthread_create.c:709
#1 0x0000000000400a18 in main ()
(gdb) p *pd
Cannot access memory at address 0x7fa5c2bf8700