Model Checked - MPSC queue + Rework State Machines - #128
Conversation
… with not enough memory :/)
| ## 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)) |
|
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
mspaceto 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).