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

"Internal error" with reduce on vector of named tuples #27187

Closed
nalimilan opened this issue May 21, 2018 · 1 comment
Closed

"Internal error" with reduce on vector of named tuples #27187

nalimilan opened this issue May 21, 2018 · 1 comment
Assignees
Labels
bug Indicates an unexpected problem or unintended behavior types and dispatch Types, subtyping and method dispatch

Comments

@nalimilan
Copy link
Member

@jlapeyre spotted this error on master (#26440). Funnily, the result is correct.

julia> reduce(merge,[(a=1,b=2),(c=3,d=4)])
Internal error: encountered unexpected error in runtime:
ErrorException("NamedTuple names and field types must have matching lengths")
rec_backtrace at /home/milan/Dev/julia/src/stackwalk.c:94
record_backtrace at /home/milan/Dev/julia/src/task.c:246
jl_throw at /home/milan/Dev/julia/src/task.c:577
jl_error at /home/milan/Dev/julia/src/rtutils.c:41
inst_datatype_inner at /home/milan/Dev/julia/src/jltypes.c:1232
inst_datatype_env at /home/milan/Dev/julia/src/jltypes.c:1309 [inlined]
inst_datatype_env at /home/milan/Dev/julia/src/jltypes.c:1313 [inlined]
inst_datatype_env at /home/milan/Dev/julia/src/jltypes.c:1313 [inlined]
inst_datatype at /home/milan/Dev/julia/src/jltypes.c:1319 [inlined]
jl_apply_type at /home/milan/Dev/julia/src/jltypes.c:855
intersect at /home/milan/Dev/julia/src/subtype.c:2063
intersect_unionall_ at /home/milan/Dev/julia/src/subtype.c:1559
intersect_unionall at /home/milan/Dev/julia/src/subtype.c:1604
intersect at /home/milan/Dev/julia/src/subtype.c:2006
intersect_unionall_ at /home/milan/Dev/julia/src/subtype.c:1563
intersect_unionall at /home/milan/Dev/julia/src/subtype.c:1604
intersect at /home/milan/Dev/julia/src/subtype.c:1980
intersect_tuple at /home/milan/Dev/julia/src/subtype.c:1706 [inlined]
intersect at /home/milan/Dev/julia/src/subtype.c:2020
intersect_all at /home/milan/Dev/julia/src/subtype.c:2092
jl_type_intersection_env_s at /home/milan/Dev/julia/src/subtype.c:2200
jl_typemap_intersection_node_visitor at /home/milan/Dev/julia/src/typemap.c:480
ml_matches at /home/milan/Dev/julia/src/gf.c:2476
jl_matching_methods at /home/milan/Dev/julia/src/gf.c:1724
abstract_call_gf_by_type at ./reflection.jl:677
jl_apply_generic at /home/milan/Dev/julia/src/gf.c:2140
abstract_call at ./compiler/abstractinterpretation.jl:712
jl_apply_generic at /home/milan/Dev/julia/src/gf.c:2140
abstract_eval_call at ./compiler/abstractinterpretation.jl:741
abstract_eval at ./compiler/abstractinterpretation.jl:813
jl_apply_generic at /home/milan/Dev/julia/src/gf.c:2140
abstract_interpret at ./compiler/abstractinterpretation.jl:931
jl_apply_generic at /home/milan/Dev/julia/src/gf.c:2140
typeinf_work at ./compiler/typeinfer.jl:273
typeinf at ./compiler/typeinfer.jl:407
typeinf_frame at ./compiler/typeinfer.jl:96 [inlined]
typeinf_code at ./compiler/typeinfer.jl:191
typeinf_ext at ./compiler/typeinfer.jl:233
jfptr_typeinf_ext_12 at /home/milan/Dev/julia/usr/lib/julia/sys.so (unknown line)
jl_apply_generic at /home/milan/Dev/julia/src/gf.c:2140
jl_apply at /home/milan/Dev/julia/src/julia.h:1540 [inlined]
jl_apply_with_saved_exception_state at /home/milan/Dev/julia/src/rtutils.c:257
jl_type_infer at /home/milan/Dev/julia/src/gf.c:274
jl_compile_method_internal at /home/milan/Dev/julia/src/gf.c:1778
jl_fptr_trampoline at /home/milan/Dev/julia/src/gf.c:1822
jl_apply_generic at /home/milan/Dev/julia/src/gf.c:2140
_mapreduce_dim at ./reducedim.jl:280
jl_fptr_trampoline at /home/milan/Dev/julia/src/gf.c:1823
jl_apply_generic at /home/milan/Dev/julia/src/gf.c:2140
#mapreduce#537 at ./reducedim.jl:276
jl_fptr_trampoline at /home/milan/Dev/julia/src/gf.c:1823
jl_apply_generic at /home/milan/Dev/julia/src/gf.c:2140
mapreduce at ./reducedim.jl:276
jl_fptr_trampoline at /home/milan/Dev/julia/src/gf.c:1823
jl_apply_generic at /home/milan/Dev/julia/src/gf.c:2140
_reduce_dim at ./reducedim.jl:328
jl_fptr_trampoline at /home/milan/Dev/julia/src/gf.c:1823
jl_apply_generic at /home/milan/Dev/julia/src/gf.c:2140
#reduce#539 at ./reducedim.jl:325
jl_fptr_trampoline at /home/milan/Dev/julia/src/gf.c:1823
jl_apply_generic at /home/milan/Dev/julia/src/gf.c:2140
reduce at ./reducedim.jl:325
jl_fptr_trampoline at /home/milan/Dev/julia/src/gf.c:1823
jl_apply_generic at /home/milan/Dev/julia/src/gf.c:2140
do_call at /home/milan/Dev/julia/src/interpreter.c:324
eval_value at /home/milan/Dev/julia/src/interpreter.c:416
eval_body at /home/milan/Dev/julia/src/interpreter.c:559
jl_interpret_toplevel_thunk_callback at /home/milan/Dev/julia/src/interpreter.c:798
unknown function (ip: 0xfffffffffffffffe)
unknown function (ip: 0x7f4e7cac02af)
unknown function (ip: 0x8)
jl_interpret_toplevel_thunk at /home/milan/Dev/julia/src/interpreter.c:807
jl_toplevel_eval_flex at /home/milan/Dev/julia/src/toplevel.c:856
jl_toplevel_eval_in at /home/milan/Dev/julia/src/builtins.c:631
eval at ./boot.jl:317 [inlined]
eval at /home/milan/Dev/julia/usr/share/julia/stdlib/v0.7/REPL/src/REPL.jl:5
jl_apply_generic at /home/milan/Dev/julia/src/gf.c:2140
eval_user_input at /home/milan/Dev/julia/usr/share/julia/stdlib/v0.7/REPL/src/REPL.jl:85
jl_apply_generic at /home/milan/Dev/julia/src/gf.c:2140
macro expansion at /home/milan/Dev/julia/usr/share/julia/stdlib/v0.7/REPL/src/REPL.jl:116 [inlined]
#28 at ./event.jl:92
jl_fptr_trampoline at /home/milan/Dev/julia/src/gf.c:1823
jl_apply_generic at /home/milan/Dev/julia/src/gf.c:2140
jl_apply at /home/milan/Dev/julia/src/julia.h:1540 [inlined]
start_task at /home/milan/Dev/julia/src/task.c:268
unknown function (ip: 0xffffffffffffffff)
(a = 1, b = 2, c = 3, d = 4)
@JeffBezanson JeffBezanson self-assigned this May 21, 2018
@JeffBezanson JeffBezanson added the types and dispatch Types, subtyping and method dispatch label May 21, 2018
@jlapeyre
Copy link
Contributor

Another data point. This

reduce(merge, [(a=1,b=2), (a=1,b=3,c=4)])

does not trigger the bug.

@JeffBezanson JeffBezanson added the bug Indicates an unexpected problem or unintended behavior label May 21, 2018
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 types and dispatch Types, subtyping and method dispatch
Projects
None yet
Development

No branches or pull requests

3 participants