https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81098
Bug ID: 81098
Summary: backtrace_pcinfo initialization not thread safe
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: other
Assignee: unassigned at gcc dot gnu.org
Reporter: bernard at zeroc dot com
Target Milestone: ---
Created attachment 41552
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=41552&action=edit
test case
The first call to backtrace_pcinfo performs a one-time initialization which
does not appear to be thread safe, even when initializing libbacktrace in
threaded mode.
With the attached test case, you should get a SEGV and core dump with every
run.
Compile with:
c++ -g --std=c++11 bt-test.cpp -o bt-test -lbacktrace -pthread
Tested on Ubuntu 16.04 x86_64 with gcc 5.4.0 and Debian stretch x86_64 with gcc
6.3.0.
Compile with -DWORKAROUND to "pre initialize" backtrace_pcinfo and work-around
this issue.