filprofiler icon indicating copy to clipboard operation
filprofiler copied to clipboard

New reentrancy strategy

Open itamarst opened this issue 4 years ago • 1 comments

Current system is complex, and may be causing #149 in part.

Proposal:

  1. Reentrancy checks happen in a new, custom Rust allocator wrapping existing allocators.
  2. mmap() would still be called by jemalloc, so that still needs reentrancy prevention logic similar to current one.
  3. Probably there are no calls to malloc() etc.. in current Rust code?

itamarst avatar Apr 27 '21 22:04 itamarst

The hope is:

  • C code (or more broadly defined, the API emulation layer) doesn't have to know about reentrancy.
  • We only don't track allocations from Rust. Right now random other allocations become untracked in various scenarios.
  • Existing invariants: We don't ever double count allocations (e.g. malloc() can call mmap()!).
  • Existing invariants: No crashes/corruption due to reentrancy.

itamarst avatar Apr 27 '21 22:04 itamarst