Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@grouptheoryiscool
Copy link

@grouptheoryiscool grouptheoryiscool commented May 7, 2025

Failing tests in test.ml, fork.ml and trace.ml:

  • test.ml failed because it expects memtrace to catch and report an exception only once. Thus, in the lock_tracer function we need to check for failure before trying to obtain the lock. Otherwise, the tracer will continue to attempt to write traces even after it has failed, and will likely throw the same error multiple times. After switching the order of "if s.failed" and "if Mutex.try_lock", the test passes.
  • another issue was that a thread that already holds the lock may try to obtain it again because (1) an allocation happens while a thread is in the "close tracer" function or (2) if a thread is writing an external allocation. If we replace Mutex.try_lock with Mutex.lock, it will throw an error if this happens. we catch this error and return false to avoid deadlocks.

@tmcgilchrist tmcgilchrist force-pushed the 5_1_statmemprof branch 3 times, most recently from f90106c to e315e21 Compare May 27, 2025 00:34
@tmcgilchrist
Copy link
Owner

Fix added to janestreet#22

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants