Skip to content
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

Regression with --compile=min for 1.2/master compared to 1.0/1.1 #31965

Closed
fredrikekre opened this issue May 8, 2019 · 9 comments · Fixed by #31967
Closed

Regression with --compile=min for 1.2/master compared to 1.0/1.1 #31965

fredrikekre opened this issue May 8, 2019 · 9 comments · Fixed by #31967
Assignees
Labels
bug Indicates an unexpected problem or unintended behavior

Comments

@fredrikekre
Copy link
Member

fredrikekre commented May 8, 2019

The following segfaults on 1.0.3, works fine on 1.1.0, and errors on master:

julia --compile=min -e 'using Pkg; pkg"add https://github.com/JuliaLang/Example.jl"'

1.0.3:

signal (11): Segmentation fault
in expression starting at no file:0
jl_isa at /home/fredrik/julia10/src/subtype.c:1251
jl_typemap_entry_assoc_exact at /home/fredrik/julia10/src/typemap.c:169
jl_typemap_assoc_exact at /home/fredrik/julia10/src/julia_internal.h:883 [inlined]
jl_lookup_generic_ at /home/fredrik/julia10/src/gf.c:2135 [inlined]
jl_apply_generic at /home/fredrik/julia10/src/gf.c:2181
do_call at /home/fredrik/julia10/src/interpreter.c:324
eval_value at /home/fredrik/julia10/src/interpreter.c:430
eval_stmt_value at /home/fredrik/julia10/src/interpreter.c:363 [inlined]
eval_body at /home/fredrik/julia10/src/interpreter.c:682
jl_interpret_call_callback at /home/fredrik/julia10/src/interpreter.c:777
unknown function (ip: 0xfffffffffffffffe)
...

master (b126788):

ERROR: this intrinsic must be compiled to be calledfatal: error thrown and no exception handler available.
ErrorException("type MethodInstance has no field inferred")
rec_backtrace at /home/fredrik/julia-master/src/stackwalk.c:94
record_backtrace at /home/fredrik/julia-master/src/task.c:210 [inlined]
jl_throw at /home/fredrik/julia-master/src/task.c:417
jl_errorf at /home/fredrik/julia-master/src/rtutils.c:77
jl_field_index at /home/fredrik/julia-master/src/datatype.c:903
jl_f_getfield at /home/fredrik/julia-master/src/builtins.c:731
getproperty at ./Base.jl:20 [inlined]
lookup at ./stacktraces.jl:127
#process_backtrace#647 at ./errorshow.jl:607
jfptr_#process_backtrace#647_5792 at /home/fredrik/julia-master/usr/lib/julia/sys.so (unknown line)
jl_apply_generic at /home/fredrik/julia-master/src/gf.c:2191
do_call at /home/fredrik/julia-master/src/interpreter.c:326
eval_value at /home/fredrik/julia-master/src/interpreter.c:414
eval_stmt_value at /home/fredrik/julia-master/src/interpreter.c:365 [inlined]
eval_body at /home/fredrik/julia-master/src/interpreter.c:775
jl_interpret_call_callback at /home/fredrik/julia-master/src/interpreter.c:857
Interpreter frame (ip: 0)
...
@fredrikekre fredrikekre added the bug Indicates an unexpected problem or unintended behavior label May 8, 2019
@fredrikekre
Copy link
Member Author

Works on the 1.0.4 backport branch.

@KristofferC
Copy link
Member

KristofferC commented May 8, 2019

Seems the problem with the backtrace is the inferred field access at:

julia/base/stacktraces.jl

Lines 126 to 127 in b126788

if ip.code isa Core.MethodInstance && ip.code.def isa Method
codeinfo = ip.code.inferred

@fredrikekre
Copy link
Member Author

Hmm, I could reproduce the segfault on 1.0.3 consistenly 10 times in a row before opening the issue, but not anymore so I guess this is just a problem on master then...

@fredrikekre
Copy link
Member Author

Same error on the 1.2 backport branch as on master.

@fredrikekre fredrikekre changed the title Segfault with --compile=min Regression with --compile=min for 1.2/master compared to 1.0/1.1 May 8, 2019
@JeffBezanson
Copy link
Member

The initial problem is the atomic_add! for the refcount in LibGit2 constructors.

@fredrikekre
Copy link
Member Author

Here is another example which results in the same segfault as in my original post:

bug.jl:

using Plots
x = range(0, stop=6π, length=1000)
y = sin.(x)
r = plot(x, y)

function display_dict(x)
    @info "in display_dict"
    buf = IOBuffer()
    show(IOContext(buf, :limit=>true, :color=>true), MIME("text/plain"), x)
    return String(take!(buf))
end

str = display_dict(r)
println(str)

Now,

$ julia --compile=min bug.jl

crashes with the same stracktrace as the original post on Julia 1.0.3. Seems to crash from show.

@JeffBezanson
Copy link
Member

I can't reproduce the segfault. I either get ERROR: this intrinsic must be compiled (on master) or it works (on the branch of my PR).

@fredrikekre
Copy link
Member Author

Yea only happens on 1.0.3

@fredrikekre
Copy link
Member Author

@JeffBezanson do you have any idea what might have fixed #31965 (comment) ? Worth a bisect for a backport to 1.0?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants