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

StackOverflow in type inference #20344

Closed
jrevels opened this issue Jan 31, 2017 · 5 comments
Closed

StackOverflow in type inference #20344

jrevels opened this issue Jan 31, 2017 · 5 comments
Assignees
Labels
bug Indicates an unexpected problem or unintended behavior priority This should be addressed urgently types and dispatch Types, subtyping and method dispatch
Milestone

Comments

@jrevels
Copy link
Member

jrevels commented Jan 31, 2017

This is a pretty nifty one that @andreasnoack ran into. Probably related to #20103, but doesn't seem exactly the same.

To reproduce, checkout JuliaStats/Distributions.jl@3e8d9f9 and JuliaDiff/ForwardDiff.jl@791cd93 (at the time of writing, these are both the head of the master branches of these packages).

Then, run the following:

julia> using Distributions

julia> using ForwardDiff

julia> tmp1 = vcat([1,1], 1, 1)
WARNING: An error occurred during inference. Type inference is now partially disabled.
StackOverflowError()
intersect at /Users/jarrettrevels/data/repos/julia6/src/subtype.c:1626
intersect_ufirst at /Users/jarrettrevels/data/repos/julia6/src/subtype.c:1032 [inlined]
intersect_var at /Users/jarrettrevels/data/repos/julia6/src/subtype.c:1100
intersect at /Users/jarrettrevels/data/repos/julia6/src/subtype.c:1626
intersect_ufirst at /Users/jarrettrevels/data/repos/julia6/src/subtype.c:1032 [inlined]
intersect_var at /Users/jarrettrevels/data/repos/julia6/src/subtype.c:1100
intersect at /Users/jarrettrevels/data/repos/julia6/src/subtype.c:1626
 # stacktace repeats for a while until it bubbles back up out of the recursion
4-element Array{Int64,1}:
 1
 1
 1
 1

The best part is that this bug can be circumvented by commenting out Base.zero and Base.one definitions on lines 132 and 135 here.

versioninfo:

julia> versioninfo()
Julia Version 0.6.0-dev.2478
Commit dbf41c0 (2017-01-30 18:58 UTC)
Platform Info:
  OS: macOS (x86_64-apple-darwin13.4.0)
  CPU: Intel(R) Core(TM) i5-4288U CPU @ 2.60GHz
  WORD_SIZE: 64
  BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Haswell)
  LAPACK: libopenblas64_
  LIBM: libopenlibm
  LLVM: libLLVM-3.9.1 (ORCJIT, haswell)
@jrevels jrevels added bug Indicates an unexpected problem or unintended behavior types and dispatch Types, subtyping and method dispatch labels Jan 31, 2017
@andreasnoack
Copy link
Member

FWIW 93a725d caused this.

@mlubin
Copy link
Member

mlubin commented Feb 1, 2017

I also see a similar error on this branch of JuMP. At the moment this is blocking me from doing any more work on JuMP compatibility with 0.6.

@tkelman tkelman added the priority This should be addressed urgently label Feb 2, 2017
@tkelman
Copy link
Contributor

tkelman commented Feb 2, 2017

I get a similar error from Pkg.test("BaseBenchmarks") on current master of that (and branch tk/drop0.4 of FileIO)

@tkelman tkelman added this to the 0.6.0 milestone Feb 2, 2017
@JeffBezanson JeffBezanson self-assigned this Feb 2, 2017
@andreasnoack
Copy link
Member

@JeffBezanson This was broken by 93a725d, i.e. the commit that fixed JuliaLang/LinearAlgebra.jl#399

@JeffBezanson
Copy link
Member

See how far #20448 gets you.

JeffBezanson added a commit that referenced this issue Feb 4, 2017
small change to type intersection that fixes #20344
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 priority This should be addressed urgently types and dispatch Types, subtyping and method dispatch
Projects
None yet
Development

No branches or pull requests

5 participants