https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82635
Jonathan Wakely <redi at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |WAITING Last reconfirmed| |2017-10-20 Ever confirmed|0 |1 --- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> --- https://gcc.gnu.org/bugs/ What we need: ... - the complete command line that triggers the bug; Are you linking to libpthread? Where does it crash? (In reply to Hannes Hauswedell from comment #0) > The problem must have been introduced in the last months, I know for sure > that it did not happen in June. However it seems strange that it affects all > GCCs down to version 5. Maybe something that was backported? Nope. The code is largely the same for GNU/Linux and FreeBSD, and I'm not aware of any problems in it, and TSan doesn't show any, which suggests a problem in the FreeBSD pthreads implementation. I do recall something in FreeBSD's pthreads impl being non-conforming, where the static PTHREAD_MUTEX_INITIALIZER (or maybe PTHREAD_COND_INITIALIZER) creates an invalid object that then requires dynamic initialization on the first use. There could be a race in that code (or I could be totally misremembering).