[Bug 248225] Linuxulator: pthread_join crash

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Thu Jul 23 19:23:40 UTC 2020


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=248225

            Bug ID: 248225
           Summary: Linuxulator: pthread_join crash
           Product: Base System
           Version: 12.1-RELEASE
          Hardware: amd64
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: kern
          Assignee: bugs at FreeBSD.org
          Reporter: iwtcex at gmail.com

% cat pthread-crash.c
#define _GNU_SOURCE

#include <pthread.h>
#include <stdio.h>

static void* test(void* arg) {
  printf("%s started\n", __func__);
  return NULL;
}

int main() {

  pthread_t t;
  pthread_create(&t, NULL, test, NULL);

  void* val;

  pthread_join(t, &val);
  pthread_join(t, &val);

  return 0;
}
% /compat/linux/bin/gcc -Wall pthread-crash.c -pthread -o pthread-crash
% ./pthread-crash
test started
Segmentation fault (core dumped)

It should be noted, while calling pthread_join in that manner is explicitly
discouraged in both FreeBSD and Linux man pages, some programs (Steam) still
occasionally do this and this does not lead to crash on Linux.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-bugs mailing list