HaxeFoundation / HaxeFoundation/haxe
Haxe compiler hangs nondeterministically - "SuspendThread failed"
- Dominant language
- Haxe
- Stars
- 6.9k
- Forks
- 715
- Avg merge
- 2d 2h
- Merged PRs (30d)
- 11
Description
Almost half the time I run a haxe build, the process hangs and I have to force quit the terminal.
Even something simple like:
-cp src
-hl build.hl
--main Main
and running
>haxe compile.hxml
Sometimes it freezes the terminal, sometimes it causes the following popup with the text "Fatal error in GC: SuspendThread failed".

Then when you close the popup the following message is printed:
ERROR: Process exited with code 1
Error: Failed to call haxelib (command not found ?)
Sometimes it doesn't freeze the terminal and the process can be ctrl+c exited with the following error message:
>haxe compile.hxml
Fatal error: exception Stdlib.Sys.Break
This happens across all projects inexplicably and has been happening for months. I'm running Windows 10 and both Haxe and Haxelib are updated to most recent versions.
One thing to note is that I often have 2 or 3 instances of VSCode open, working on different haxe projects. Opening task manager I will see many instances of haxe.exe and haxelib.exe running:

So I don't know if there might be some failing race conditions between the multiple open processes or something.
Contributor guide
Research direction
Start by reproducing the hang with the shown compile.hxml command on Windows 10, including multiple VSCode projects and concurrent haxe.exe or haxelib.exe processes. Use the "Fatal error in GC: SuspendThread failed" and "Stdlib.Sys.Break" messages as the initial symptoms; done means identifying a reproducible cause and confirming that the build no longer hangs or exits unexpectedly.
Written by the indexing model from the issue text.
Assessment
- Domain
- compilers, operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100