[PATCH] D72364: [scudo][standalone] Modify malloc_{enable,disable} wrt fork
Evgenii Stepanov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Jan 8 12:23:27 PST 2020
eugenis added a comment.
In D72364#1810619 <https://reviews.llvm.org/D72364#1810619>, @cryptoad wrote:
> In D72364#1810596 <https://reviews.llvm.org/D72364#1810596>, @eugenis wrote:
>
> > I see. I think the other approach could be safer. Grab all the locks before fork and release them after fork. This will also allow user applications to use malloc after fork, which ex. glibc allocator supports.
>
>
> I think the second approach is more keen to "if allocator is disabled when we call fork, wait until it's enabled", as opposed to disabling it pre-fork.
Right, but it looks like it will have the same effect.
Attempting to disable an already disabled allocator will block until the allocator is enabled.
I.e. pthread_atfork(disable, enable, enable) should be sufficient.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D72364/new/
https://reviews.llvm.org/D72364
More information about the llvm-commits
mailing list