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

tuple splatting bug with simple program #31824

Closed
BrianGun opened this issue Apr 24, 2019 · 3 comments
Closed

tuple splatting bug with simple program #31824

BrianGun opened this issue Apr 24, 2019 · 3 comments
Assignees
Labels
domain:types and dispatch Types, subtyping and method dispatch kind:bug Indicates an unexpected problem or unintended behavior kind:regression Regression in behavior compared to a previous version
Milestone

Comments

@BrianGun
Copy link

BrianGun commented Apr 24, 2019

version information:

Julia Version 1.0.3
Commit 099e826241 (2018-12-18 01:34 UTC)
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: Intel(R) Xeon(R) CPU E5-2680 v4 @ 2.40GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-6.0.0 (ORCJIT, broadwell)
Environment:
  JULIA_EDITOR = "C:\JuliaPro-1.0.3.1\app-1.32.2\atom.exe" -a
  JULIA_NUM_THREADS = 16
  JULIA_PKG_SERVER = https://pkg.juliacomputing.com/
  JULIA_PKG_TOKEN_PATH = C:\Users\bguenter\.juliapro\token.toml

Smallest function that produces the bug

julia> function test(input...)
       b::NTuple = input
       end
test (generic function with 1 method)

How to produce the bug

julia> test(1,2,3)

Unreachable reached at 000000001DBCAA98

Please submit a bug report with steps to reproduce this fault, and any error messages that follow (i
n their entirety). Thanks.
Exception: EXCEPTION_ILLEGAL_INSTRUCTION at 0x1dbcaa98 -- test at .\none:2
in expression starting at no file:0
test at .\none:2
jl_fptr_trampoline at /home/Administrator/buildbot/worker/package_win64/build/src\gf.c:1831
jl_apply_generic at /home/Administrator/buildbot/worker/package_win64/build/src\gf.c:2184do_call at /home/Administrator/buildbot/worker/package_win64/build/src\interpreter.c:324
eval_value at /home/Administrator/buildbot/worker/package_win64/build/src\interpreter.c:430
eval_stmt_value at /home/Administrator/buildbot/worker/package_win64/build/src\interpreter.c:363 [in
lined]
eval_body at /home/Administrator/buildbot/worker/package_win64/build/src\interpreter.c:678
jl_interpret_toplevel_thunk_callback at /home/Administrator/buildbot/worker/package_win64/build/src\
interpreter.c:806
unknown function (ip: FFFFFFFFFFFFFFFE)
unknown function (ip: 00000000119D37FF)
unknown function (ip: FFFFFFFFFFFFFFFF)
jl_toplevel_eval_flex at /home/Administrator/buildbot/worker/package_win64/build/src\toplevel.c:805
jl_toplevel_eval_in at /home/Administrator/buildbot/worker/package_win64/build/src\builtins.c:622
eval at .\boot.jl:319 [inlined]
repleval at C:\Users\bguenter\.juliapro\JuliaPro_v1.0.3.1\packages\Atom\v2iqN\src\repl.jl:139
jl_apply_generic at /home/Administrator/buildbot/worker/package_win64/build/src\gf.c:2184#164 at C:\Users\bguenter\.juliapro\JuliaPro_v1.0.3.1\packages\Atom\v2iqN\src\repl.jl:161with_logstate at .\logging.jl:395
with_logger at .\logging.jl:491 [inlined]
evalrepl at C:\Users\bguenter\.juliapro\JuliaPro_v1.0.3.1\packages\Atom\v2iqN\src\repl.jl:152
jl_apply_generic at /home/Administrator/buildbot/worker/package_win64/build/src\gf.c:2184do_call at /home/Administrator/buildbot/worker/package_win64/build/src\interpreter.c:324
eval_value at /home/Administrator/buildbot/worker/package_win64/build/src\interpreter.c:430
eval_stmt_value at /home/Administrator/buildbot/worker/package_win64/build/src\interpreter.c:363 [in
lined]
eval_body at /home/Administrator/buildbot/worker/package_win64/build/src\interpreter.c:678
jl_interpret_toplevel_thunk_callback at /home/Administrator/buildbot/worker/package_win64/build/src\
interpreter.c:806
unknown function (ip: FFFFFFFFFFFFFFFE)
unknown function (ip: 00000000119D348F)
unknown function (ip: FFFFFFFFFFFFFFFF)
jl_toplevel_eval_flex at /home/Administrator/buildbot/worker/package_win64/build/src\toplevel.c:805
jl_toplevel_eval_in at /home/Administrator/buildbot/worker/package_win64/build/src\builtins.c:622
eval at .\boot.jl:319
jl_apply_generic at /home/Administrator/buildbot/worker/package_win64/build/src\gf.c:2184eval_user_input at C:\Users\julia\AppData\Local\Julia-1.0.3\share\julia\stdlib\v1.0\REPL\src\REPL.jl
:85
macro expansion at C:\Users\julia\AppData\Local\Julia-1.0.3\share\julia\stdlib\v1.0\REPL\src\REPL.jl
:117 [inlined]
#28 at .\task.jl:259
jl_fptr_trampoline at /home/Administrator/buildbot/worker/package_win64/build/src\gf.c:1831
jl_apply_generic at /home/Administrator/buildbot/worker/package_win64/build/src\gf.c:2184jl_apply at /home/Administrator/buildbot/worker/package_win64/build/src\julia.h:1537 [inlined]
start_task at /home/Administrator/buildbot/worker/package_win64/build/src\task.c:268
Allocations: 30636752 (Pool: 30631301; Big: 5451); GC: 69

Julia has exited. Press Enter to start a new session.
@ararslan ararslan added kind:bug Indicates an unexpected problem or unintended behavior kind:regression Regression in behavior compared to a previous version labels Apr 24, 2019
@ararslan
Copy link
Member

I can reproduce on Linux with Julia 1.0, 1.1, and current master. It works as expected on 0.6 and 0.7.

@JeffBezanson
Copy link
Sponsor Member

Looks like the behavior change is due to changing the tuple convert methods, but all versions have this root cause:

T = Tuple{Type{NTuple}, Tuple}

julia> typeintersect(T, Tuple{Type{Tuple{Vararg{V}}}, Tuple} where V)
Tuple{Type{Tuple{Vararg{T,N}} where T where N},Tuple}

julia> typeintersect(T, Tuple{Type{Tuple{Vararg{V}}}, Tuple{Vararg{V}}} where V)
Union{}

They should probably both be Union{} (in which case we might have to add a method), but making the second one non-empty would fix this too.

@JeffBezanson
Copy link
Sponsor Member

Looks related to the first example here: #24166 (comment)
also this comment in the code:

# TODO: These currently can't be used since
#   Type{NTuple} <: (Type{Tuple{Vararg{S}}} where S) is true
#   even though the value S doesn't exist

@JeffBezanson JeffBezanson added the domain:types and dispatch Types, subtyping and method dispatch label Apr 24, 2019
@JeffBezanson JeffBezanson self-assigned this Apr 24, 2019
JeffBezanson added a commit that referenced this issue Apr 25, 2019
JeffBezanson added a commit that referenced this issue Apr 25, 2019
JeffBezanson added a commit that referenced this issue Apr 25, 2019
JeffBezanson added a commit that referenced this issue Apr 26, 2019
JeffBezanson added a commit that referenced this issue Apr 26, 2019
JeffBezanson added a commit that referenced this issue May 9, 2019
JeffBezanson added a commit that referenced this issue May 29, 2019
JeffBezanson added a commit that referenced this issue Jun 24, 2019
@JeffBezanson JeffBezanson added this to the 1.4 milestone Nov 6, 2019
JeffBezanson added a commit that referenced this issue Dec 11, 2019
@JeffBezanson JeffBezanson modified the milestones: 1.4, 1.5 Dec 16, 2019
JeffBezanson added a commit that referenced this issue Jan 7, 2020
JeffBezanson added a commit that referenced this issue Jan 7, 2020
JeffBezanson added a commit that referenced this issue Jan 15, 2020
KristofferC pushed a commit that referenced this issue Apr 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain:types and dispatch Types, subtyping and method dispatch kind:bug Indicates an unexpected problem or unintended behavior kind:regression Regression in behavior compared to a previous version
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants