I've bisected now, but during my testing I realised that the problem didn't go away. Instead, it just took a bit longer to reproduce.

I discovered that a very effective way to reproduce the issue is just to start several threads at the same time, so I simply extended the test case to the following:

(require 'cl(
(loop repeat 10 do (make-thread (lambda () (sit-for 5) (with-current-buffer "z" (insert "hello")))))

When running this test, I have gotten two different errors. One SIGSEGV and another being SIGABRT.

I will include the stack traces for both test cases in the following two emails.

Regards,
Elias