aboutsummaryrefslogtreecommitdiff
path: root/pkg-config
diff options
context:
space:
mode:
authorAvatar Johannes Nixdorf <mixi@exherbo.org> 2016-09-11 21:36:32 +0200
committerAvatar Heiko Becker <heirecka@exherbo.org> 2018-06-13 21:30:36 +0000
commitce07b7232bcf2a39c84f77909fe2fa205643a1d9 (patch)
tree532a3f43e7c676c160255bef5f73ce26fe76f874 /pkg-config
parent3169132a3231fbbfa0bc118eb8ab315baebc41f3 (diff)
downloadpaludis-ce07b7232bcf2a39c84f77909fe2fa205643a1d9.tar.gz
paludis-ce07b7232bcf2a39c84f77909fe2fa205643a1d9.tar.xz
process.cc: don't allocate after fork
In multithreaded processes POSIX specifies that after fork only AS-safe functions may be called. [1] This fixes a race condition I observed in "cave generate-metadata" with musl libc. This does happen regularily with musl libc, but the general problem also affects glibc. (test [2] if you don't believe me - with glibc it happens more rarely and causes a deadlock inside of malloc locks instead of a crash). This does not fix these problems for as_main_process, as there never will be an exec in the child process that way, which makes it impossible to do safely this way. [1]: http://pubs.opengroup.org/onlinepubs/9699919799/functions/fork.html [2]: https://shadowice.org/~mixi/examples/never-fork-and-malloc-in-multiple-threads.c
Diffstat (limited to 'pkg-config')
0 files changed, 0 insertions, 0 deletions