This is the mail archive of the
mailing list for the glibc project.
set_robust_list() not called for forked processes ?
- From: monoreet mutsuddi <monoreet at gmail dot com>
- To: libc-help at sourceware dot org
- Date: Thu, 5 Aug 2010 01:20:44 -0700
- Subject: set_robust_list() not called for forked processes ?
I am using process shared pthread mutexes allocated in shared memory
to synchronize across distinct single threaded processes.
Some of these processes may have a parent-child relationship, with no
execve'ing involved after the fork. I have noticed that if a child
exits ungracefully holding process shared mutexes the kernel doesn't
wake up waiter processes. I straced the forked off child processes
right after the fork, and saw that they don't seem to call
set_robust_list(). Looking at the nptl/pthread code it looks like
is only called in nptl-init.c (probably when the library is first
loaded), and when a new thread is created via pthread_create. Looks
nptl is not handling the fork case. Is that true ? Is there an easy
way to get my forked processes to call set_robust_list() without
after the fork ?