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

BoundsError in invoke #9520

Closed
yuyichao opened this issue Dec 31, 2014 · 9 comments
Closed

BoundsError in invoke #9520

yuyichao opened this issue Dec 31, 2014 · 9 comments
Labels
bug Indicates an unexpected problem or unintended behavior priority This should be addressed urgently

Comments

@yuyichao
Copy link
Contributor

I've got a very weird BoundError when trying use invoke. See minimized demonstration below

julia> f(::Any, ::Any, ::Any, args...) = Any
f (generic function with 1 method)

julia> invoke(f, (Any, Any, Any), 1, 1, 1)
ERROR: BoundsError()
 in typeinf at /usr/lib/julia/sys.so
 in typeinf_ext at /usr/lib/julia/sys.so

The error goes away if I remove the args... or one of the arguments so I guess I'm using invoke in the right way.

julia> f2(::Any, ::Any, args...) = Any
f2 (generic function with 1 method)

julia> invoke(f2, (Any, Any), 1, 1)
Any

julia> f3(::Any, ::Any, ::Any) = Any
f3 (generic function with 1 method)

julia> invoke(f3, (Any, Any, Any), 1, 1, 1)
Any

P.S. It might be helpful to keep linenumber info of the original source file in sys.so. This would be especially useful when pre-compiling packages support is added.

@timholy
Copy link
Member

timholy commented Dec 31, 2014

The quality of backtraces varies with your platform, due (IIUC) to limitations in LLVM rather than julia. For example:

julia> f(::Any, ::Any, ::Any, args...) = Any
f (generic function with 1 method)

julia> invoke(f, (Any, Any, Any), 1, 1, 1)
ERROR: BoundsError()
 in typeinf at ./inference.jl:1397
 in typeinf_ext at ./inference.jl:1242

What platform are you on?

@vtjnash
Copy link
Member

vtjnash commented Dec 31, 2014

are you running julia0.3 with llvm3.5? i'm guess so because of your install location. i think i've fixed the line number issue for that platform on the latest master.

@vtjnash vtjnash added bug Indicates an unexpected problem or unintended behavior priority This should be addressed urgently labels Dec 31, 2014
@yuyichao
Copy link
Contributor Author

I'm running latest master with llvm 3.5 on Linux.

@yuyichao
Copy link
Contributor Author

Just tested a few more cases and it actually fails with 3 or more arguments.

@tkelman
Copy link
Contributor

tkelman commented Jan 4, 2015

should the fix here be scheduled for backporting?

@vtjnash
Copy link
Member

vtjnash commented Jan 4, 2015

Yes

@tkelman
Copy link
Contributor

tkelman commented Jan 6, 2015

I think this one would be more appropriate for 0.3.6.

@tkelman tkelman added this to the 0.3.6 milestone Jan 6, 2015
@tkelman
Copy link
Contributor

tkelman commented Jan 16, 2015

any change in backporting opinion now that these tests have been causing issues?

@vtjnash
Copy link
Member

vtjnash commented Jan 16, 2015

I guess it probably fine to wait until someone fixes the rest of the bug

@tkelman tkelman removed this from the 0.3.6 milestone Jan 18, 2015
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
Projects
None yet
Development

No branches or pull requests

4 participants