PackageCompiler hangs while compiling nonincremental system image on Julia v1.11

Exactly. During the work on my solution, I announced in this thread.
I performed dozens of compilations. With Julia 1.11.4 there are threading issues. You get during PackageCompilation first warnings that a thread could not be ended and in contrast to Julia 1.10 the compilation sometimes fails. And as strange as it is, this is the case no matter if I set JULIA_NUM_THREADS to 1 or don’t have a JULIA_NUM_THREADS at all. Also, you can perform the same compilation 10 times in a row and several times the compilation fails but not always and not reproducibly. I really have no clue and this kind of randomness made me crazy.

To test, I documented what I did in detail. I cannot do more as I have no clue how the JIT compiler works and how threading is done. After working on this many hours, I am however, sure that the issue is somewhere in the handling of threading.

Note that Julia 1.10 also gives you kind of random threading warnings, but first after the nonincremental system image was successfully compiled and they can be ignored as the compilation eventually succeeds every time.

3 Likes