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

Error Tracebacks for Domain and Bounds Errors Incorrect within Loops #7154

Closed
jlepird opened this issue Jun 6, 2014 · 5 comments
Closed
Labels
kind:bug Indicates an unexpected problem or unintended behavior

Comments

@jlepird
Copy link

jlepird commented Jun 6, 2014

Domain Errors and Bounds Errors provide incorrect tracebacks when called within loops. For example, if a file contains

while true
10^(-1)
end

then the domain error is traced back to line 1, instead of line 2. Bounds errors provide incorrect tracebacks in the following example:

function do_something()
foo = rand(4)
foo[5]
end

while true
do_something()
end

In this case, the error is traced back to the do_something() line, instead of where the error actually occurs at the foo[5] line.

I'm running Julia commit 74a41d2 on Windows.

@pao
Copy link
Member

pao commented Jun 6, 2014

Remarkably, this appears to not be a duplicate any of the previous error reporting related issues. But cf. #4744 (general error improvements), #6179 (for syntax errors).

@mbauman
Copy link
Sponsor Member

mbauman commented Jun 6, 2014

I think the second one is #1189 (debug metadata for inlined functions).

@pao
Copy link
Member

pao commented Jun 6, 2014

Yes, from code_typed() it does look like the do_something() method body gets inlined.

@JeffBezanson
Copy link
Sponsor Member

The first part might be windows-specific; on linux I get

julia> include("i7154.jl")
ERROR: DomainError
 in power_by_squaring at intfuncs.jl:70
 in anonymous at no file:2
 in include at boot.jl:244

@ihnorton ihnorton added the bug label Jul 2, 2014
@JeffBezanson
Copy link
Sponsor Member

closing as dup of #1189

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind:bug Indicates an unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

5 participants