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/MethodError in complex use case #31666

Closed
oschulz opened this issue Apr 10, 2019 · 6 comments · Fixed by #31670
Closed

Internal error/MethodError in complex use case #31666

oschulz opened this issue Apr 10, 2019 · 6 comments · Fixed by #31670
Assignees
Labels
bug Indicates an unexpected problem or unintended behavior compiler:inference Type inference

Comments

@oschulz
Copy link
Contributor

oschulz commented Apr 10, 2019

With a certain application (actually in several cases) involving BAT.jl and a host of other packages, I get this error (reproducible):

Internal error: encountered unexpected error in runtime:
MethodError(f=typeof(Core.Compiler.fieldindex)(), args=(Random123.Philox4x{T, R} where R where T<:Union{UInt32, UInt64}, :ctr1, false), world=0x0000000000000eb9)

Apologies up front: I tried very hard, but wasn't able to create an MWE - as soon as I simplify things too much, the error goes away. On the other hand, I haven't been able to find a workaround that works for the actual (non-reduced) application either.

So here's a script (long, but as reduced as far as I could) "bat_julia_internal_error.jl", together with a Project and Manifest file that reproducibly causes the error: https://gist.github.com/oschulz/d2417a6259684861071ad098e3cafffa

Here's my system info:

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-7700 CPU @ 3.60GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-6.0.1 (ORCJIT, skylake)

OS: Ubuntu Linux 16.04, 64-bit

@vtjnash vtjnash self-assigned this Apr 10, 2019
@vtjnash
Copy link
Member

vtjnash commented Apr 10, 2019

Did you get a backtrace? I see some problems, but wanted to see if they were likely to be the same as your issue.

@oschulz
Copy link
Contributor Author

oschulz commented Apr 10, 2019

Oh, sure - sorry, forgot about that. I just added a "backtrace.txt" to the gist (https://gist.github.com/oschulz/d2417a6259684861071ad098e3cafffa)

vtjnash added a commit that referenced this issue Apr 10, 2019
@JeffBezanson JeffBezanson added bug Indicates an unexpected problem or unintended behavior compiler:inference Type inference labels Apr 10, 2019
@oschulz
Copy link
Contributor Author

oschulz commented Apr 12, 2019

@vtjnash, thanks for looking into this. Does my backtrace match what you see?

I discovered one more thing: The error only occurs if BAT.unsafe_density_logval is not type stable (BAT.jl uses it's return type to set type parameters of multiple structs it uses, so this results in a propagation of type-instability). When I change the last line in BAT.unsafe_density_logval to Float64(sum(LL))::Float64, the Julia-internal error goes away.

Hope this helps tracking down what's happening here ... still haven't been able to do a proper MWE, it seems this error really only occurs when things are quite complex, resp. deeply nested.

@vtjnash
Copy link
Member

vtjnash commented Apr 12, 2019

Yes, thanks. I believe #31670 should fix that

@oschulz
Copy link
Contributor Author

oschulz commented Apr 12, 2019

Wow that was fast, thanks a lot @vtjnash!

@oschulz
Copy link
Contributor Author

oschulz commented Apr 19, 2019

Thanks again!

KristofferC pushed a commit that referenced this issue Apr 20, 2019
JeffBezanson pushed a commit that referenced this issue Feb 20, 2020
KristofferC pushed a commit that referenced this issue Feb 20, 2020
KristofferC pushed a commit that referenced this issue Feb 20, 2020
KristofferC pushed a commit that referenced this issue Feb 22, 2020
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 compiler:inference Type inference
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants