Commit 248531f
authored
Local names linking fixes (#61165)
The merging of #60031 revealed a few remaining multithreading issues
with local names linking
(https://buildkite.com/julialang/julia-master/builds/55081/steps/canvas?jid=019c9584-a2fa-4ddc-bc7e-95ee729211a0&tab=output).
This PR has a series of commits addressing these issues and making us a
little more eager to crash with a useful message in situations that
would otherwise result in a deadlock in `JuliaTaskDispatcher`:
- We return as soon as possible from
`JLMaterializationUnit::materialize` after calling
`MaterializationResponsibility::failMaterialization`.
- When an ORC lookup fails in `publishCIs`, call `abort()` instead of
potentially deadlocking.
Two concurrency issues are fixed. The first is that there was a window
of time during which a CodeInstance added to the JIT via
`jl_emit_codeinst_to_jit` had `invoke ==
jl_fptr_wait_for_compiled_addr`, but did not have ORC symbols set up in
`JuliaOJIT::CISymbols`. We solve this by taking the lock before setting
up the ORC symbols, skipping any CodeInstances where another thread beat
us to the punch in setting `invoke.`
I suspect the second issue is the one that was causing rare CI failures.
We had a data race on the `InFlight` counter for
`JLJITLinkMemoryManager`, which, if decremented below zero, would cause
the `FinalizedCallbacks` to never fire. This manifests as deadlocks in
`JuliaTaskDispatcher`, since those symbols will be stuck in the
`SymbolState::Resolved` state forever.1 parent d2af968 commit 248531f
3 files changed
Lines changed: 31 additions & 23 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
979 | 979 | | |
980 | 980 | | |
981 | 981 | | |
| 982 | + | |
982 | 983 | | |
983 | 984 | | |
984 | 985 | | |
| |||
1061 | 1062 | | |
1062 | 1063 | | |
1063 | 1064 | | |
1064 | | - | |
1065 | 1065 | | |
1066 | | - | |
1067 | | - | |
| 1066 | + | |
| 1067 | + | |
| 1068 | + | |
| 1069 | + | |
| 1070 | + | |
1068 | 1071 | | |
1069 | | - | |
1070 | 1072 | | |
1071 | 1073 | | |
1072 | 1074 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
369 | 369 | | |
370 | 370 | | |
371 | 371 | | |
372 | | - | |
373 | 372 | | |
374 | 373 | | |
375 | 374 | | |
376 | 375 | | |
377 | | - | |
378 | 376 | | |
379 | 377 | | |
380 | 378 | | |
| |||
476 | 474 | | |
477 | 475 | | |
478 | 476 | | |
479 | | - | |
480 | | - | |
481 | | - | |
482 | | - | |
483 | | - | |
484 | | - | |
485 | | - | |
486 | 477 | | |
487 | 478 | | |
488 | 479 | | |
| |||
923 | 914 | | |
924 | 915 | | |
925 | 916 | | |
926 | | - | |
| 917 | + | |
| 918 | + | |
927 | 919 | | |
928 | 920 | | |
929 | 921 | | |
| |||
1881 | 1873 | | |
1882 | 1874 | | |
1883 | 1875 | | |
| 1876 | + | |
| 1877 | + | |
| 1878 | + | |
| 1879 | + | |
| 1880 | + | |
| 1881 | + | |
| 1882 | + | |
| 1883 | + | |
| 1884 | + | |
| 1885 | + | |
| 1886 | + | |
| 1887 | + | |
1884 | 1888 | | |
1885 | 1889 | | |
1886 | 1890 | | |
| |||
1980 | 1984 | | |
1981 | 1985 | | |
1982 | 1986 | | |
1983 | | - | |
1984 | | - | |
1985 | | - | |
| 1987 | + | |
1986 | 1988 | | |
1987 | | - | |
1988 | 1989 | | |
1989 | 1990 | | |
1990 | 1991 | | |
| |||
2002 | 2003 | | |
2003 | 2004 | | |
2004 | 2005 | | |
2005 | | - | |
| 2006 | + | |
2006 | 2007 | | |
2007 | 2008 | | |
2008 | 2009 | | |
| |||
2156 | 2157 | | |
2157 | 2158 | | |
2158 | 2159 | | |
2159 | | - | |
| 2160 | + | |
2160 | 2161 | | |
2161 | 2162 | | |
2162 | 2163 | | |
| |||
2180 | 2181 | | |
2181 | 2182 | | |
2182 | 2183 | | |
2183 | | - | |
| 2184 | + | |
| 2185 | + | |
| 2186 | + | |
| 2187 | + | |
2184 | 2188 | | |
2185 | 2189 | | |
2186 | 2190 | | |
| |||
2205 | 2209 | | |
2206 | 2210 | | |
2207 | 2211 | | |
| 2212 | + | |
2208 | 2213 | | |
2209 | 2214 | | |
2210 | 2215 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
784 | 784 | | |
785 | 785 | | |
786 | 786 | | |
787 | | - | |
788 | | - | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
789 | 790 | | |
790 | 791 | | |
791 | 792 | | |
| |||
0 commit comments