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

[BUG] Deadlock in thread pool implementation #5

Open
adlai opened this issue Oct 16, 2024 · 2 comments
Open

[BUG] Deadlock in thread pool implementation #5

adlai opened this issue Oct 16, 2024 · 2 comments
Assignees
Labels

Comments

@adlai
Copy link
Owner

adlai commented Oct 16, 2024

Please do not include emoticons in these conversations!

If you feel compelled to click reaction buttons,
 I'm not gonna tell you nor me to stop doing that;
  however, please do not include ANY emoticons
 in the text that you hope will not get ignored.

Sadly, it is only painfully obvious that some information is useless, and not quite obvious how to properly kill this bug...

Deadlock cycle detected:
    adlai/scalpl#1=#<SB-THREAD:THREAD adlai/scalpl#2="ChanL Thread Pool Worker" RUNNING {1001}>
  waited for:
    #<SB-THREAD:MUTEX "thread pool lock" free owner=0>
  owned by:
    #<SB-THREAD:THREAD "ChanL Thread Pool Worker"
        waiting on: adlai/scalpl#3=#<MUTEX "thread leader lock" contested owner=#2#> {2}>
  waited for:
    (#3#)
  owned by:
    adlai/scalpl#1#
   [Condition of type SB-THREAD:THREAD-DEADLOCK]

... however, it almost certainly belongs to ChanL's thread pool, rather than to ScalpL's use of CSP idioms.

@adlai adlai transferred this issue from adlai/scalpl Oct 31, 2024
@adlai adlai changed the title Please rewrite ScalpL so it can be fixed using Valgrind [BUG] Deadlock in thread pool implementation Oct 31, 2024
@adlai
Copy link
Owner Author

adlai commented Oct 31, 2024

RNGesus graced me with this deadlock again, for All Saint's Eve. A few moments' investigation showed that the code holding the relevant locks is entirely within the thread pool, so it's triggered by ScalpL's heavy use of it, however that is to ScalpL's credit rather than a bug.

@adlai adlai self-assigned this Nov 3, 2024
adlai added a commit that referenced this issue Nov 4, 2024
It should help with zkat#31 and #5 although this should be confirmed.
@adlai adlai added bug and removed enhancement labels Nov 26, 2024
@adlai
Copy link
Owner Author

adlai commented Dec 9, 2024

This was quite possibly fixed by 5dad386; I've not encountered the bug again since deploying this commit, and have accumulated over 144 hours of CPU time over eight days running with this fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant