Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not enter critical section during program termination in AsyncCallback #2219

Open
petervdonovan opened this issue Feb 23, 2024 · 2 comments
Assignees
Labels
bug Something isn't working c Related to C target

Comments

@petervdonovan
Copy link
Collaborator

This describes an error that appeared in CI on macOS (here) in a PR that probably wouldn't introduce any concurrency bugs (the PR, lf-lang/reactor-c#342, is instead mostly just changing the build system and directory structure).

AsyncCallback just flaked on me with a failed termination sequence:

    DEBUG: Scheduler: Advancing tag.
    DEBUG: Scheduler: Reached stop tag.
    DEBUG: Worker 0: Stop requested. Exiting.
    LOG: ---- All worker threads exited successfully.
    LOG: ---- Terminating environment 0, normal termination: 1
    LOG: --------- Start time step at tag (2000000000, 0).
    ---- Elapsed logical time (in nsec): 2,000,000,000
    ---- Elapsed physical time (in nsec): 2,027,747,000
    DEBUG: Freeing token from _lf_token_recycling_bin: 0x600001dc8030
    DEBUG: Trace buffer 0 has 201 records.
    DEBUG: Trace buffer 1 has 0 records.
    FATAL ERROR: Could not enter critical section

This is probably an error thrown from C11 mtx_lock. I assume the problem is that it tried to acquire the same lock twice and the lock was not configured for recursive locking.

@petervdonovan petervdonovan added bug Something isn't working c Related to C target labels Feb 23, 2024
@erlingrj
Copy link
Collaborator

I will try to reproduce this locally. Note to self is that our LF_ASSERT macros should also print out the file and line number where the assertion fails.

@erlingrj
Copy link
Collaborator

erlingrj commented Mar 1, 2024

With this PR: lf-lang/reactor-c#376 it will be easier to debug such failures since it will also print the exact place where the assertion failed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working c Related to C target
Projects
None yet
Development

No branches or pull requests

2 participants