-
Notifications
You must be signed in to change notification settings - Fork 21
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
Model Checked - MPSC queue + Rework State Machines #128
Conversation
… with not enough memory :/)
@@ -133,8 +133,11 @@ proc tryRecv*[T](chan: var ChannelMpscUnboundedBatch[T], dst: var T): bool = | |||
## This can fail spuriously on the last element if producer | |||
## enqueues a new element while the consumer was dequeing it | |||
|
|||
let first = cast[T](chan.front.next.load(moRelaxed)) | |||
let first = cast[T](chan.front.next.load(moAcquire)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sleep(xxx) seems like a bad test to test on-blocking sync as it leads to deadlock with Clang and/or on Mac: |
… comment out fences
Tried to use the RCMC VM (why GPL code with no source published?) at http://plv.mpi-sws.org/rcmc/ But:
So seems like even for C/C++ there is an lack of model checker to deal with C++11 concurrency bugs. |
Could there be a bug on OSX similar to https://linux-arm-kernel.infradead.narkive.com/jTmi6ANX/patch-arm-change-definition-of-cpu-relax-for-arm11mpcore
There is no obvious reason why this deadlock again, I don't use sleep: weave/weave/parallel_tasks.nim Lines 250 to 285 in c31e45f
So it might be that with And ARM deadlocked too:
|
Found the bug, there is a race condition in the test
The spinlock was (intentionally :/) not dispatching incoming steal requests. But if between initialization of the threadpool and |
Still 2 bugs (maybe one):
Fixes for another time. |
Trying to fix:
deadlock livelock happening in plain task parallelism and memory pool
counting bugs:
The implementation is run through CDS checker https://github.com/computersforpeace/model-checker but it internally uses dlmalloc
mspace
to replace uer's malloc and somehow it runs out of space and trigger this assert: https://github.com/computersforpeace/model-checker/blob/5c4efe5cd8bdfe1e85138396109876a121ca61d1/mymemory.cc#L166-L171Might need to complete my own at #127 or use
Relaxy
(which cannot properly deal with compiler relaxed reordering unfortunately).