[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Segfault when running pthread_exit on kbsd



Greetings everyone,

while doing a rebuild of dspam after hardening flags have been enabled, we had 
a build failure on kfreebsd-*. Since the source code didn't change, we thought 
it was related to the hardening flags but we could reproduce the bug even 
without them enabled. Looking into the config.log gave us a small test case:

int main() {

  pthread_mutex_t m;
  pthread_mutex_init(&m, NULL);
  pthread_exit(0);
  exit(EXIT_FAILURE);
}

This code compiled and linked with i486-kfreebsd-gnu-gcc -o conftest -g -O2 
conftest.c -pthread lead to a segmentation fault. Gdb gave us the following 
backtrace:

#0  0x2808dfee in __pthread_do_exit () from /lib/i386-kfreebsd-
gnu/libpthread.so.0
#1  0x2808e2e1 in pthread_exit () from /lib/i386-kfreebsd-gnu/libpthread.so.0
#2  0x080483e9 in main () at conftest.c:50

Is this a bug in the pthread implementation or am I missing something obvious 
in the test case?

Please CC me on reply as I'm not subscribed to the list.

Best regards.

Attachment: signature.asc
Description: This is a digitally signed message part.


Reply to: