OrcJIT InPlaceTaskDispatcher excessive recursion now causes crashes
To reproduce:
- Delete the
.julia/compiled/v1.12folder - Start Julia with:
julia +1.12 --inline=no
- Type
]to enter the Pkg REPL
This will leave Julia stuck in this state:
This essentially makes --inline=no unusable.
It is also not possible to interrupt precompilation with Ctrl+C:
Running Julia in non-interactive mode shows one additional error stack overflow message:
➜ Documents julia +1.12 --inline=no -e "import Pkg"
Info Given Pkg was explicitly requested, output will be shown live
Warning: detected a stack overflow; program state may be corrupted, so further execution might be unreliable.
Precompiling packages ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╺━ 24/25
◑ Pkg
In case it's not clear, I'll just note that this is not necessarily a bug. Disabling inlining will cause stack overflows, among other issues, for some code.
I my view: --inline=no is public API, and being able to import Pkg is public API, so their combination should work, just like in Julia 1.11.
If we are dropping support for Pkg with --inline=no starting with Julia 1.12, then that should be documented.
This looks like a known problem with the OrcJIT's default InPlaceTaskDispatcher since I'm told that is a legacy component to support MCJIT and not used in production. I've talked with Lang about it, and we need to switch to DynamicThreadPoolTaskDispatcher, so that it uses extra threads instead of extra stack frames, to link the code successfully.
Duplicate of https://github.com/JuliaLang/julia/issues/57149.
Oh oops, I forgot to change the text in the pr so it auto closed. The pr only mitigates this slightly
I don't think this really has to be on the milestone
I have a fix for this locally. I was waiting to see if upstream would take the fix soon, but they currently seem reluctant to accept a fix for this, so I'll just make a local PR soon