HaxeFoundation / HaxeFoundation/haxe

Haxe compiler hangs nondeterministically - "SuspendThread failed"

Open
#11,371 2 comments 0 reactions 0 assignees View on GitHub
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".

![suspendthreadfailed](https://github.com/HaxeFoundation/haxe/assets/132514276/c4f4ebd9-10fe-4d59-9ed9-72a41168f544)

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:

![haxetaskmanage](https://github.com/HaxeFoundation/haxe/assets/132514276/7eada76f-dfda-4986-af37-2f7a41655228)

So I don't know if there might be some failing race conditions between the multiple open processes or something.

Contributor guide

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.