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

StackOverflowError in jl_has_concrete_subtype #31062

Closed
rdeits opened this issue Feb 13, 2019 · 0 comments · Fixed by #31064
Closed

StackOverflowError in jl_has_concrete_subtype #31062

rdeits opened this issue Feb 13, 2019 · 0 comments · Fixed by #31064
Labels
bug Indicates an unexpected problem or unintended behavior types and dispatch Types, subtyping and method dispatch

Comments

@rdeits
Copy link
Contributor

rdeits commented Feb 13, 2019

I can reliably generate a stack overflow in jl_has_concrete_subtype with the following code:

julia> struct Bar
           x::NTuple{N, Bar} where N
       end

julia> b = Bar(());
Internal error: encountered unexpected error in runtime:
StackOverflowError()
jl_has_concrete_subtype at /buildworker/worker/package_linux64/build/src/gf.c:2573
jl_has_concrete_subtype at /buildworker/worker/package_linux64/build/src/gf.c:2590
jl_has_concrete_subtype at /buildworker/worker/package_linux64/build/src/gf.c:2590
jl_has_concrete_subtype at /buildworker/worker/package_linux64/build/src/gf.c:2590
.... (truncated)

FWIW I don't see the error in Julia v0.6, but I get it in v0.7-1.1.

julia> versioninfo()
Julia Version 1.1.0
Commit 80516ca202 (2019-01-21 21:24 UTC)
Platform Info:
  OS: Linux (x86_64-pc-linux-gnu)
  CPU: Intel(R) Core(TM) i7-8650U CPU @ 1.90GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-6.0.1 (ORCJIT, skylake)
@Keno Keno added the bug Indicates an unexpected problem or unintended behavior label Feb 13, 2019
Keno added a commit that referenced this issue Feb 14, 2019
jl_concrete_subtype was recursing into the vararg element of a tuple,
which I don't think is correct (because it could be zero-length and
thus be constructible even if the element type is not). Fix that and
as a bonus get we are now able to get rid of the previous condition
that (accidentally) special cased tuples to have that behavior.

Fixes #31062
Keno added a commit that referenced this issue Feb 14, 2019
jl_concrete_subtype was recursing into the vararg element of a tuple,
which I don't think is correct (because it could be zero-length and
thus be constructible even if the element type is not). Fix that and
as a bonus get we are now able to get rid of the previous condition
that (accidentally) special cased tuples to have that behavior.

Fixes #31062
@JeffBezanson JeffBezanson added the types and dispatch Types, subtyping and method dispatch label Mar 7, 2019
Keno added a commit that referenced this issue Jun 7, 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 types and dispatch Types, subtyping and method dispatch
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants