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

A function with "local variable T conflicts with a static parameter" warning invokes Illegal instruction error #29429

Closed
tkf opened this issue Sep 29, 2018 · 2 comments · Fixed by #30184
Assignees
Labels
compiler:lowering Syntax lowering (compiler front end, 2nd stage) minor change Marginal behavior change acceptable for a minor release

Comments

@tkf
Copy link
Member

tkf commented Sep 29, 2018

I found that the following (incorrect) function leads to the Illegal instruction error. I can see that it prints warnings so maybe I should not be surprised when it ends up in Illegal instruction? I checked it with 1.0.0 and 1.1.0-DEV.334.

julia> function illegal_instruction(e::T) where {T}
           try
               return string(T)
           catch
               try
                   io = IOBuffer()
                   Base.show_datatype(io, T)
                   T = String(take!(io))
               catch
                   T = "_UNKNOWN_TYPE_"
               end
               return string(T)
           end
       end
WARNING: local variable T conflicts with a static parameter in illegal_instruction at REPL[1]:2.
WARNING: local variable T conflicts with a static parameter in illegal_instruction at REPL[1]:2.
illegal_instruction (generic function with 1 method)

julia> println(illegal_instruction(1))
Unreachable reached at 0x7fce8009d4ee

signal (4): Illegal instruction
in expression starting at no file:0
illegal_instruction at ./REPL[1]:7
unknown function (ip: 0x7fce8009d503)
jl_fptr_trampoline at /home/takafumi/repos/watch/julia/src/gf.c:1843
jl_apply_generic at /home/takafumi/repos/watch/julia/src/gf.c:2198
do_call at /home/takafumi/repos/watch/julia/src/interpreter.c:324
eval_value at /home/takafumi/repos/watch/julia/src/interpreter.c:430
eval_stmt_value at /home/takafumi/repos/watch/julia/src/interpreter.c:363 [inlined]
eval_body at /home/takafumi/repos/watch/julia/src/interpreter.c:678
jl_interpret_toplevel_thunk_callback at /home/takafumi/repos/watch/julia/src/interpreter.c:808
unknown function (ip: 0xfffffffffffffffe)
unknown function (ip: 0x7fce8a38621f)
unknown function (ip: 0xffffffffffffffff)
jl_interpret_toplevel_thunk at /home/takafumi/repos/watch/julia/src/interpreter.c:817
jl_toplevel_eval_flex at /home/takafumi/repos/watch/julia/src/toplevel.c:818
jl_toplevel_eval_in at /home/takafumi/repos/watch/julia/src/builtins.c:622
eval at ./boot.jl:319
jl_apply_generic at /home/takafumi/repos/watch/julia/src/gf.c:2198
eval_user_input at /home/takafumi/repos/watch/julia/usr/share/julia/stdlib/v1.1/REPL/src/REPL.jl:85
macro expansion at /home/takafumi/.julia/packages/Revise/aU3Za/src/Revise.jl:764 [inlined]
#41 at ./task.jl:259
jl_fptr_trampoline at /home/takafumi/repos/watch/julia/src/gf.c:1843
jl_apply_generic at /home/takafumi/repos/watch/julia/src/gf.c:2198
jl_apply at /home/takafumi/repos/watch/julia/src/julia.h:1559 [inlined]
start_task at /home/takafumi/repos/watch/julia/src/task.c:271
unknown function (ip: 0xffffffffffffffff)
Allocations: 10007756 (Pool: 10005494; Big: 2262); GC: 21
@JeffBezanson
Copy link
Member

This warning should probably become an error.

@JeffBezanson JeffBezanson added compiler:lowering Syntax lowering (compiler front end, 2nd stage) minor change Marginal behavior change acceptable for a minor release triage This should be discussed on a triage call labels Oct 1, 2018
@StefanKarpinski
Copy link
Member

Triage dixit: we should make this an error now and then open an issue about allowing it that someone can do if and when they feel like it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler:lowering Syntax lowering (compiler front end, 2nd stage) minor change Marginal behavior change acceptable for a minor release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants