Help with parallelize() (CPU only for now)

I am working on a path tracer in Mojo. It works well single-threaded but crashes with a SIGBUS (Misaligned address error) when I parallelize it, and the stack trace isn’t very useful. Here’s the commit that does parallelization, which as you can see it’s a fairly trivial change: fails with SIGBUS · int3/mpt@c6e9894 · GitHub

Almost all the shared state is read-only, and in fact the SIGBUS still occurs after I remove the writes to image, so I guess something is up with the shared read-only state. It’s not clear to me which of them might need to get aligned though. Help would be greatly appreciated!

d’oh, it was a stack overflow issue. Probably triggered due to smaller stack sizes in worker threads

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.