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

Unexpected error in runtime when squaring static diagonal matrices #29424

Closed
mschauer opened this issue Sep 29, 2018 · 5 comments
Closed

Unexpected error in runtime when squaring static diagonal matrices #29424

mschauer opened this issue Sep 29, 2018 · 5 comments

Comments

@mschauer
Copy link
Contributor

Possibly caused by a bug in StaticArrays but it looks to me something deeper goes wrong.

   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.1.0-DEV.276 (2018-09-17)
 _/ |\__'_|_|_|\__'_|  |  Commit 1324ceb81b* (11 days old master)
|__/                   |

julia> using StaticArrays

julia> x = @SVector rand(2)
2-element SArray{Tuple{2},Float64,1,2}:
 0.6358630318698844 
 0.27836149277496847

julia> Diagonal(x)^2
ERROR: UndefVarError: Diagonal not defined
Stacktrace:
 [1] top-level scope at none:0

julia> using LinearAlgebra

julia> Diagonal(x)^2
Internal error: encountered unexpected error in runtime:
MethodError(f=typeof(Base.string)(), args=(Expr(:call, :<, Expr(:., :ssa, :(:id)), Expr(:., :compact, :(:result_idx))),), world=0x0000000000000e7c)
rec_backtrace at /Users/schauermr/julia/src/stackwalk.c:94
record_backtrace at /Users/schauermr/julia/src/task.c:249 [inlined]
jl_throw at /Users/schauermr/julia/src/task.c:580
jl_method_error_bare at /Users/schauermr/julia/src/gf.c:1628
jl_method_error at /Users/schauermr/julia/src/gf.c:1646
jl_lookup_generic_ at /Users/schauermr/julia/src/gf.c:2174
jl_apply_generic at /Users/schauermr/julia/src/gf.c:2194
getindex at ./compiler/ssair/ir.jl:555
simple_walk at ./compiler/ssair/passes.jl:127
simple_walk_constraint at ./compiler/ssair/passes.jl:157
getfield_elim_pass! at ./compiler/ssair/passes.jl:641
run_passes at ./compiler/ssair/driver.jl:123
optimize at ./compiler/optimize.jl:162
typeinf at ./compiler/typeinfer.jl:35
typeinf_edge at ./compiler/typeinfer.jl:492
abstract_call_method at ./compiler/abstractinterpretation.jl:342
abstract_call_gf_by_type at ./compiler/abstractinterpretation.jl:81
abstract_call at ./compiler/abstractinterpretation.jl:790
abstract_eval_call at ./compiler/abstractinterpretation.jl:819
abstract_eval at ./compiler/abstractinterpretation.jl:904
typeinf_local at ./compiler/abstractinterpretation.jl:1147
typeinf_nocycle at ./compiler/abstractinterpretation.jl:1203
typeinf at ./compiler/typeinfer.jl:15
typeinf_edge at ./compiler/typeinfer.jl:492
abstract_call_method at ./compiler/abstractinterpretation.jl:342
abstract_call_gf_by_type at ./compiler/abstractinterpretation.jl:81
abstract_call at ./compiler/abstractinterpretation.jl:790
abstract_eval_call at ./compiler/abstractinterpretation.jl:819
abstract_eval at ./compiler/abstractinterpretation.jl:904
typeinf_local at ./compiler/abstractinterpretation.jl:1147
typeinf_nocycle at ./compiler/abstractinterpretation.jl:1203
typeinf at ./compiler/typeinfer.jl:15
typeinf_ext at ./compiler/typeinfer.jl:567
typeinf_ext at ./compiler/typeinfer.jl:604
jfptr_typeinf_ext_1 at /Users/schauermr/julia/usr/lib/julia/sys.dylib (unknown line)
jl_apply at /Users/schauermr/julia/src/./julia.h:1559 [inlined]
jl_apply_with_saved_exception_state at /Users/schauermr/julia/src/rtutils.c:252
jl_type_infer at /Users/schauermr/julia/src/gf.c:275
jl_compile_method_internal at /Users/schauermr/julia/src/gf.c:1798
jl_fptr_trampoline at /Users/schauermr/julia/src/gf.c:1842
do_call at /Users/schauermr/julia/src/interpreter.c:324
eval_stmt_value at /Users/schauermr/julia/src/interpreter.c:363 [inlined]
eval_body at /Users/schauermr/julia/src/interpreter.c:697
jl_interpret_toplevel_thunk_callback at /Users/schauermr/julia/src/interpreter.c:797
unknown function (ip: 0xfffffffffffffffe)
unknown function (ip: 0x1196f85af)
unknown function (ip: 0x2)
jl_interpret_toplevel_thunk at /Users/schauermr/julia/src/interpreter.c:806
jl_toplevel_eval_flex at /Users/schauermr/julia/src/toplevel.c:818
jl_toplevel_eval_in at /Users/schauermr/julia/src/builtins.c:622
eval at ./boot.jl:319
eval_user_input at /Users/schauermr/julia/usr/share/julia/stdlib/v1.1/REPL/src/REPL.jl:85
macro expansion at /Users/schauermr/julia/usr/share/julia/stdlib/v1.1/REPL/src/REPL.jl:117 [inlined]
#28 at ./task.jl:259
jl_apply at /Users/schauermr/julia/src/./julia.h:1559 [inlined]
start_task at /Users/schauermr/julia/src/task.c:271
2×2 Diagonal{Float64,SArray{Tuple{2},Float64,1,2}}:
 0.404322   ⋅       
  ⋅        0.0774851
@dpsanders
Copy link
Contributor

Works fine for me with 1.1.0-DEV.308 (5 days old)

@mschauer
Copy link
Contributor Author

Works on master for me as well. -11 days to -5 days is a short interval, is there something which might have fixed this or does it take a different code path by chance?

@mschauer
Copy link
Contributor Author

mschauer commented Sep 30, 2018

Bisected to #29265 so perhaps not fixed yet

@mschauer
Copy link
Contributor Author

Additional ref to #29107 which keeps track of perhaps related bugs

@mschauer
Copy link
Contributor Author

Fixed by #29140

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants