-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
SegFault caused by tupocolypse #11313
Comments
OK Working (SegFaulting) example without macro m(ex)
quote
tmp = $(esc(ex))
(x->1, tmp)
end
end
println(macroexpand(:(@m rand(1000000)))) # Adding this delays the SegFault
xd = @m rand(1000000)
xd = @m rand(1000000)
xd = @m rand(1000000) # Removing this might suppress the SegFault might be related to macro handling. Edit: Update to the minimum example I can come up with. Very likely related to macro/global handling because trivial change of the code changes whether it segfaults. |
Technically a regression since I cannot reproduce it on |
Goes back at least to 803193e |
Actualy probably not macro related (might just be some random interference in memory usage etc). Could reproduce with this simple script xd = begin
tmp1 = rand(1000000)
(x->1, tmp1)
end |
Backtrace for these different versions are slightly different by they all end up in |
Direct reason seems to be |
Just went checking a few commits back and sure enough it is introduced by #10380 . I finally remember the issue number of tupocolypse by heart now. Not sure if it is a good sign or a bad one...... |
Nice debugging, @yuyichao. |
@timholy I'll probably stop here for now unless no one fix it in a few days. |
in interpreted global var assignment. Fix #11313.
Found it. Thanks a lot. Those are so much easier to track down with a small deterministic repro. |
Wow. That's fast. Thanks. A little surprised that my full-collect-every-time didn't catch it..... |
It should have if : you collected at each pool alloc && the rhs of the assign && this thing is not rooted anywhere else && this is the first time this particular global is assigned to. In normal operation mode this can only happen if the rhs is allocating something big enough to go right near the collection interval, but not quite so that allocating the binding is the gc trigger. |
I guess I've only only run that mode for very limited cases and probably it was just (un)lucky that this pattern didn't appear.... |
@carnaval Also curious about how did you find the fix? It's not a write barrier issue so (as I tried) |
yep. that's why I like short examples because since the program doesn't allocate much there is almost no addr reuse so it's easier. |
Nice work to both of you. Are these repro examples small/fast-running enough to be worth adding as tests? |
Probably not this particular one.
It is still on my todo list to clean up my GC debugging branch and make it easier to run some of these (stress) tests on buildbots. (Hopefully next week.) |
It is small and fast runnig though. Just paste the code I had above #11313 (comment) into a file and run it and you should reproduce this almost 100% of the time within one second. I just don't think it would be helpful to catch future bugs. |
Okay, sounds good. Does this look related to you, by any chance? https://ci.appveyor.com/project/StefanKarpinski/julia/build/1.0.4793/job/vfqa988mt0tdr9ok It looks like it started building immediately before I hit merge on the fix though. |
The backtrace does look almost identical. |
IIRC the CI merge the master before the build? |
Just confirmed that it does fixes the original script (which uses |
in interpreted global var assignment. Fix JuliaLang#11313.
in interpreted global var assignment. Fix JuliaLang#11313.
Saw this when replying to a mailing list email.
Edit: See below #11313 (comment) for minimum example. First appears after #10380 is merged.
Script to reproduce
Putting in a function or run in a loop does not trigger the issue (even if the variable is declared to be global).
Backtrace
GC_VERIFY
did not catch it.Still investicating.
The text was updated successfully, but these errors were encountered: