A2, welcome to pain. A couples of things after reading your code: - `--panics:on` is not for "debugging". It's there to prevent catching defects. - You can't pass `ref object` to another thread without using `std/isolation`, and if you try and can't then you will have to give up `ref` altogether and start to use `SharedPtr`/`UniquePtr`/etc ( https://github.com/nim-lang/threading). - `--mm:orc` is not thread-safe, so use `--mm:atomicArc` (and NOT `arc`!) and ensure you don't have cycles. - please stick with `-d:useMalloc` until you have NO crashes. - please dont use `fusion/matching`, it doesn't work reliably with recent Nim versions. - you can drop the `{.experimental: "caseStmtMacros".}`, case macros are no longer experimental. - good luck