-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Basic use of StaticArrays and begin ... end
leads to GC error (probable corruption)
#54422
Comments
begin ... end
leads to GC error (probable corruption)
It looks like we did something odd when assigning
|
I think what I observed happened here is that llvm-late-lowering.cpp assumes code must be permanently allocated, so it skips emitting the expected write barrier for this store (of a constant value into the slot for the binding value). That object then gets GC'd after it gets stored there, and then the next GC segfaults on the bad object in that slot. I couldn't make a small reproducer, but can show a similar example of the problematic IR pattern:
|
It also gets 128 aligned which is bad but fixed on master. I'm not sure it it's missing a write barrier or if the code here is missing a root, because if the code can keep a reference to it in any way it has to be perma rooted. |
MWE
|
on |
ah, I tried to simplify too much. You need to first assign a type to
|
Version Info
Can reproduce with both Julia 1.10.3 and 1.11.0-beta1 with StaticArrays@1.9.3. Can not reproduce on Julia 1.9. Reproduced on two different Mac laptops.
Installed with juliaup:
MWE
Executing the following in Julia 1.10 or 1.11 will (usually) crash the terminal with a
GC error (probable corruption)
.Toggle for full error message.
The use of
GC.gc()
makes the crashes more reproducible, but we originally observed this "in the wild" without those calls.Almost any tweak to this code will make the crash go away. For example, removing the
begin ... end
wrapper around the final block, changing theSVector
to aTuple
allocation, or removing the two assignments todims
.The text was updated successfully, but these errors were encountered: