I'm having trouble incorporating multithreading support into my OCaml-Win32 library. Basically, any program that uses OCaml threading and also invokes a Win32 message loop will crash after a few seconds with an illegal attempt to access memory at "0x00000001". This behavior is demonstrated by the enclosed sample program, which is very simple and does not require my OCaml-Win32 library. I tried following the suggestion from the mailing list of adding "if not (!Sys.interactive && signal=(-11))" to the preempt function, but it doesn't seem to help. I don't really know how to investigate this problem further. I've determined that the problem goes away if I disable the tick thread, so presumably it has something to do with the interaction of the tick thread and the Windows message loop. I've also noticed that if I call enter_blocking_section / leave_blocking_section in my C code, the behavior changes: the program exits abruptly with no error message. By inserting printf's, I've concluded that the GPF and/or abrupt exit do not occur during execution of any of my C code. Beyond that, I don't know what to try. Does anybody have any idea why OCaml's threads might be incompatible with a Windows message loop, or how I can work on debugging this?