[Bug 203765] Processes inside jail that use libthr get stuck in 'umtxn' state.

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Wed Oct 14 09:01:22 UTC 2015


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

            Bug ID: 203765
           Summary: Processes inside jail that use libthr get stuck in
                    'umtxn' state.
           Product: Base System
           Version: 10.2-RELEASE
          Hardware: amd64
                OS: Any
            Status: New
          Severity: Affects Many People
          Priority: ---
         Component: threads
          Assignee: freebsd-threads at FreeBSD.org
          Reporter: emiel.kollof at gmail.com

Inside a jail, programs that use pthread (libthr) get stuck in umtxn state.
This problem exhibited itself since upgrading to 10.2-RELEASE-p5 with
freebsd-update.

Mitigations tried:

- Updated poudriere jail and rebuilt all packages
- Reinstalled all packages inside jail with pkg upgrade -f

Test program:

---- CUT HERE ----
#include <unistd.h>
#include <sys/types.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <pthread.h>
#include <string.h>

void  message(void *ptr);

typedef struct stdata {
  int  id;
  char  msg[100];
}  stdata;

int
main()
{
  pthread_t t1, t2;
  stdata d1, d2;

  d1.id = 1;
  strcpy(d1.msg, "Thread 1");

  d2.id = 2;
  strcpy(d2.msg, "Thread 2");

  pthread_create(&t1, NULL, (void *)&message, (void *)&d1);
  pthread_create(&t2, NULL, (void *)&message, (void *)&d2);

  pthread_join(t1, NULL);
  pthread_join(t2, NULL);

  exit(0);
}

void
message(void *ptr)
{
  stdata *data;

  data = (stdata *) ptr;

  printf("Thread %d message %s \n", data->id, data->msg);

  pthread_exit(0);
}
---- CUT HERE ----

Demonistration:

$ cc -o pthread pthread.c -pthread
$ ./pthread &
[1] 45949
$ ps -aux | grep pthread
ekollof 45949  0.0  0.0  14564  1708  5  SNJ  10:20AM 0:00.00 ./pthread
$ procstat -kk 45949
  PID  TID COMM  TDNAME  KSTACK  
45949 101151 pthread  -  mi_switch+0xe1 sleepq_catch_signals+0xab
sleepq_wait_sig+0xf _sleep+0x27d umtxq_sleep+0x125 do_lock_umutex+0x1f74
__umtx_op_wait_umutex+0x78 amd64_syscall+0x357 Xfast_syscall+0xfb
$ fg
[1]  + 45949 running  ./pthread
* I pressed Ctrl-T *
load: 0.27  cmd: pthread 45949 [umtxn] 35.86r 0.00u 0.00s 0% 1692k
* I pressed Ctrl-\ *
^\[1]  + 45949 quit (core dumped)  ./pthread

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


More information about the freebsd-threads mailing list