- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Closed
Labels
atomicsbugIndicates an unexpected problem or unintended behaviorIndicates an unexpected problem or unintended behaviorcompiler:codegenGeneration of LLVM IR and native codeGeneration of LLVM IR and native codemultithreadingBase.Threads and related functionalityBase.Threads and related functionalityregression 1.12Regression in the 1.12 releaseRegression in the 1.12 release
Milestone
Description
I attached the code that reproduces the crash. I'm sorry for the extension but couldn't attach a Julia source file.
You may need to give it a few tries though. It should crash in a few seconds, but sometimes it just hangs. I have a 16 core machine, so that may also affect the outcome.
See discussion for some details.
I installed Julia with juliaup.
julia> versioninfo()
Julia Version 1.12.0-DEV.670
Commit 5cb1107cce1 (2024-06-06 03:00 UTC)
Build Info:
Official https://julialang.org/ release
Platform Info:
OS: Linux (x86_64-linux-gnu)
CPU: 16 × AMD Ryzen 7 4800HS with Radeon Graphics
WORD_SIZE: 64
LLVM: libLLVM-17.0.6 (ORCJIT, znver2)
Threads: 16 default, 0 interactive, 16 GC (on 16 virtual cores)
Environment:
JULIA_NUM_THREADS = 4
Metadata
Metadata
Assignees
Labels
atomicsbugIndicates an unexpected problem or unintended behaviorIndicates an unexpected problem or unintended behaviorcompiler:codegenGeneration of LLVM IR and native codeGeneration of LLVM IR and native codemultithreadingBase.Threads and related functionalityBase.Threads and related functionalityregression 1.12Regression in the 1.12 releaseRegression in the 1.12 release
Type
Projects
Milestone
Relationships
Development
Select code repository
Activity
oscardssmith commentedon Jun 6, 2024
minimized slightly. I can also confirm that this doesn't occur on 1.11.
sgaure commentedon Jul 31, 2024
Bisected to 39f141d. (Oscar's variant, but with
for _ in 1:5; crash(); end
and-t 3
).However, that's the segfault. Hangs can be provoked even in 1.7 by calling
crash()
in a longer loop with more threads. It might be separate issues.oscardssmith commentedon Jul 31, 2024
I wonder if the problem is a fault of the original code. if there is a datarace it might be constructing a bool with an illegal value...
vtjnash commentedon Jul 31, 2024
My first attempt at looking at this hangs here because of a badly implemented spinlock / Channel:
You need a Condition variable there (or a least a
GC.safepoint()
) to ensure it can make forward progress without being expected to hangvtjnash commentedon Jul 31, 2024
As for the segfault, it looks like codegen is failing to emit a write-multi-barrier in
which just has an empty block
resulting in a gc of the values in the linked list before they are used
11 remaining items