Skip to content

use poll() to find open fds, removes malloc() after fork()

Jean-Louis Fuchs requested to merge jeanlf/dbus:poll into master

Resolves issue #173: libdbus calls malloc() after fork(), causing clients to deadlock

calling malloc() after fork is undefined behaviour if the process multi-threaded. The new code is a commonly used performance workaround for the fork-and-close pattern and uses only async-signal safe functions. See signal-safety(7).

I currently use this patch with 1.12.20. Another example where it is used is openjdk8 on alpine linux.

Edited by Jean-Louis Fuchs

Merge request reports