#1093599 faketime threads racing in ftpl_init and ft_shm_init

#1093599#5
Date:
2025-01-20 10:23:00 UTC
From:
To:
The gem2deb autopkgtest is failing with the new version of faketime.
There's a BUG complaint from, I think, the libc, in
pthread_cond_destroy.

The most relevant changes in libfaketime seem to me to be that the
test for `initialized` has been hoisted into ftpl_init.  I looked at
the code and if faked functions are run from multiple threads, the
core of ftpl_init could run twice concurrently.  Looking at it, it
obviously isn't sound against that.

I intend to develop a patch to change this to use sound locking
techniques and/or atomics.  But that will probably not happen right
away.

Ian.