Problem combining worker processes and threads

This isn’t a GC “crash”, this is just a regular error from a finalizer (which looks like a crash because it shows a non-fancy stacktrace). The issue is that WeakKeyDict uses a ReentrantLock internally to ensure consistency, but trying to lock that within a finalizer can sometimes cause a yield(), which is not valid in a finalizer. I believe this should be fixed by fix numerous issues with WeakKeyDict by vtjnash · Pull Request #38180 · JuliaLang/julia · GitHub.

The rest of the errors I’m not sure about since I haven’t looked at your code for very long. Can you post an MWE that exhibits the bugs in question? The above code snippet doesn’t define COUNTERS, and doesn’t qualify nthreads(); once I set COUNTERS=100 and made the definition Threads.nthreads(), it ran fine for me with 6 threads and 6 processes. Am I supposed to call next!() to reproduce the bug?