Given a multithreaded program running under libfaketime, I have observed a fork from that program get stuck in clock_gettime's faketime wrapper, waiting for this pthread_mutex_lock from the "MT" version of the .so. clock_gettime is async signal safe, so in principle, it is legal to call it after forking a multithreaded program, but pthread_mutex_lock is not correct in that context.
I'm not exactly sure what this lock is supposed to help with, but maybe the locking should only be done when FAKETIME=something-that-requires-locks? I use fixed offsets, FAKETIME=+123d, and it seems that the lock should not be needed in this case.
The problem still exists, but at least with #344, it's possible to opt-out of behaviors that could be problematic, so I'm going to call this good enough.
Given a multithreaded program running under libfaketime, I have observed a fork from that program get stuck in
clock_gettime
's faketime wrapper, waiting for thispthread_mutex_lock
from the "MT" version of the .so.clock_gettime
is async signal safe, so in principle, it is legal to call it after forking a multithreaded program, butpthread_mutex_lock
is not correct in that context.I'm not exactly sure what this lock is supposed to help with, but maybe the locking should only be done when FAKETIME=something-that-requires-locks? I use fixed offsets, FAKETIME=+123d, and it seems that the lock should not be needed in this case.