[PATCH] D72470: [scudo][standalone] Fork support

Kostya Kortchinsky via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 10 08:39:28 PST 2020


cryptoad marked 3 inline comments as done.
cryptoad added inline comments.


================
Comment at: compiler-rt/lib/scudo/standalone/wrappers_c.inc:161
+  while (SCUDO_PREFIX(Disabled))
+    pthread_cond_wait(&SCUDO_PREFIX(Conditional), &SCUDO_PREFIX(Mutex));
   SCUDO_ALLOCATOR.disable();
----------------
cryptoad wrote:
> eugenis wrote:
> > why is this signalling necessary?
> > disable() while disabled should block on any of the allocator mutexes just fine.
> > 
> Yes I might have overthought it.
> I was thinking about a situation where one thread would do disable() then one fork() then another enable().
> In my head that was going to block somewhere, but in the end I think you are right and that it's not necessary.
> I will remove it.
Coming back to this.
This is actually needed for the scenario I was describing.
I added a test to illustrate it: doing enable() in a thread while another has done disable()/fork() should enable the allocator again and allow the fork() to go on.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D72470/new/

https://reviews.llvm.org/D72470





More information about the llvm-commits mailing list