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

Crash with invalid struct definition #29064

Closed
christopheredsall opened this issue Sep 6, 2018 · 1 comment
Closed

Crash with invalid struct definition #29064

christopheredsall opened this issue Sep 6, 2018 · 1 comment
Assignees
Labels
bug Indicates an unexpected problem or unintended behavior compiler:lowering Syntax lowering (compiler front end, 2nd stage) regression Regression in behavior compared to a previous version

Comments

@christopheredsall
Copy link

As a beginner Julia user I attended an intro session given by @vchuravy at RSE2018 conference. Running on staging.juliabox.com

julia> versioninfo()
Julia Version 1.0.0
Commit 5d4eaca0c9 (2018-08-08 20:58 UTC)
Platform Info:
  OS: Linux (x86_64-pc-linux-gnu)
  CPU: Intel(R) Xeon(R) CPU E5-2673 v3 @ 2.40GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-6.0.0 (ORCJIT, haswell)
Environment:
  JULIA = /opt/julia-0.6/bin/julia
  JULIA_PKG_SERVER = https://pkg.juliacomputing.com
  JULIA_KERNELS = ['julia-0.6', 'julia-1.0']
  JULIABOX_ROLE =

I put in the following invalid syntax. Instead of getting an error the REPL crashes.

julia> struct X
           X::Int64
       end

julia> X(1)

signal (11): Segmentation fault
in expression starting at no file:0
unknown function (ip: 0x7f6f340d9c47)
unknown function (ip: 0x232e91f)
unknown function (ip: 0x7f6f340d9c56)
unknown function (ip: 0x3)
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2182
do_call at /buildworker/worker/package_linux64/build/src/interpreter.c:324
eval_value at /buildworker/worker/package_linux64/build/src/interpreter.c:428
eval_stmt_value at /buildworker/worker/package_linux64/build/src/interpreter.c:363 [inlined]
eval_body at /buildworker/worker/package_linux64/build/src/interpreter.c:686
jl_interpret_toplevel_thunk_callback at /buildworker/worker/package_linux64/build/src/interpreter.c:799
unknown function (ip: 0xfffffffffffffffe)
unknown function (ip: 0x7f6f3d3aad0f)
unknown function (ip: 0xffffffffffffffff)
jl_interpret_toplevel_thunk at /buildworker/worker/package_linux64/build/src/interpreter.c:808
jl_toplevel_eval_flex at /buildworker/worker/package_linux64/build/src/toplevel.c:787
jl_toplevel_eval_in at /buildworker/worker/package_linux64/build/src/builtins.c:622
eval at ./boot.jl:319
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2182
eval_user_input at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/REPL/src/REPL.jl:85
macro expansion at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/REPL/src/REPL.jl:117 [inlined]
#28 at ./task.jl:259
jl_fptr_trampoline at /buildworker/worker/package_linux64/build/src/gf.c:1829
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2182
jl_apply at /buildworker/worker/package_linux64/build/src/julia.h:1536 [inlined]
start_task at /buildworker/worker/package_linux64/build/src/task.c:268
unknown function (ip: 0xffffffffffffffff)
Allocations: 14347939 (Pool: 14344366; Big: 3573); GC: 31
Segmentation fault (core dumped)
jrun@notebook-dl8j4:/home/jrun$
@fredrikekre fredrikekre added the bug Indicates an unexpected problem or unintended behavior label Sep 6, 2018
@yuyichao
Copy link
Contributor

yuyichao commented Sep 6, 2018

I don't think the code is invalid and this seems to be an regression from 0.6.

julia> @code_lowered X(1)
CodeInfo(:(begin
        nothing
        return $(Expr(:new, :(Main.X), :((Base.convert)(Main.Int, X))))
    end))
julia> @code_lowered X(1)
CodeInfo(
2 1%1 = %new(X, X)                                                                           │
  └──      return %1                                                                            │
)

It's passing in the wrong name for the type.

@JeffBezanson JeffBezanson self-assigned this Sep 6, 2018
@JeffBezanson JeffBezanson added compiler:lowering Syntax lowering (compiler front end, 2nd stage) regression Regression in behavior compared to a previous version labels Sep 6, 2018
KristofferC pushed a commit that referenced this issue Sep 10, 2018
KristofferC pushed a commit that referenced this issue Feb 11, 2019
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 compiler:lowering Syntax lowering (compiler front end, 2nd stage) regression Regression in behavior compared to a previous version
Projects
None yet
Development

No branches or pull requests

4 participants