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

Truncated error, with message SYSTEM: show(lasterr) caused an error #8651

Closed
dpsanders opened this issue Oct 11, 2014 · 9 comments
Closed

Truncated error, with message SYSTEM: show(lasterr) caused an error #8651

dpsanders opened this issue Oct 11, 2014 · 9 comments
Labels
error handling Handling of exceptions by Julia or the user

Comments

@dpsanders
Copy link
Contributor

With my branch parametrised_intervals of ValidatedNumerics
(https://github.com/dpsanders/ValidatedNumerics.jl/tree/parametrised_intervals):

julia> using ValidatedNumerics

julia> a = @interval(1)
[1e+00, 1e+00] with 53 bits of precision

julia> z = zero(a)
[0e+00, 0e+00] with 53 bits of precision

julia> z == 0.0
ERROR: `BigFloat` has no method matching BigFloat(
 in promote at promotion.jl:123
 in == at promotion.jl:168SYSTEM: show(lasterr) caused an error

This happens on Julia v0.3 and v0.4.

@dpsanders
Copy link
Contributor Author

This seems to have been due to a mixing missing convert method. But this is what I was hoping the error message would tell me...!

@ivarne ivarne added the error handling Handling of exceptions by Julia or the user label Oct 14, 2014
@ivarne
Copy link
Member

ivarne commented Oct 14, 2014

I have tried various commits on the parametrised_intervals branch of ValidatedNumerics, but I can't reproduce. Do you have a commit with the error?

@dpsanders
Copy link
Contributor Author

Thanks. I have a new branch truncated_error_message which shows the problem.
The only difference is that I commented out the first convert definition in interval_definition.jl.

@jballanc
Copy link
Contributor

Just attempted reproducing this locally (OS X v10.10). On the truncated_error_message branch I get:

> julia -v
julia version 0.4.0-dev+2957
> julia -E 'Pkg.checkout("ValidatedNumerics", "truncated_error_message"); using ValidatedNumerics; a = @interval(0.0); z = zero(a); z == 0.0'
INFO: Checking out ValidatedNumerics truncated_error_message...
INFO: Pulling ValidatedNumerics latest truncated_error_message...
INFO: No packages to install, update or remove
ERROR: StackOverflowError:

Bisecting back through the commits between master and truncated_error_message, I found that dpsanders/ValidatedNumerics.jl@d23924 gave the following:

> julia -E "using ValidatedNumerics; a = @interval(0.0); z = zero(a); z == 0.0"
ERROR: no promotion exists for ValidatedNumerics.Interval{Base.MPFR.BigFloat} and Float64
 in promote_to_super at promotion.jl:154
 in == at promotion.jl:170
 in process_options at ./client.jl:248
 in _start at ./client.jl:403

which, if I understand correctly, is the desired error message. I'm not yet familiar enough with the type promotion system to say if the stack overflow is a bug in Julia or ValidatedNumerics, but the original issue seems to be resolved.

@garborg
Copy link
Contributor

garborg commented Jan 30, 2015

This just happened to me on the latest commit:

               _
   _       _ _(_)_     |  A fresh approach to technical computing
  (_)     | (_) (_)    |  Documentation: http://docs.julialang.org
   _ _   _| |_  __ _   |  Type "help()" for help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 0.4.0-dev+2993 (2015-01-30 01:32 UTC)
 _/ |\__'_|_|_|\__'_|  |  Commit 2d23b6f* (0 days old master)
|__/                   |  x86_64-apple-darwin14.1.0

julia> readline("comments/before_after_data_windows.csv")
ERROR: MethodError: `readline` has no method matching readline(::ASCIIString)SYSTEM: show(lasterr) caused an error

@jballanc
Copy link
Contributor

Nice! I can reproduce the readline based version.

@ivarne
Copy link
Member

ivarne commented Jan 30, 2015

try 
    readline("comments/before_after_data_windows.csv")
catch e
    showerror(STDOUT, e, catch_backtrace())
end
MethodError: `readline` has no method matching readline(::ASCIIString)ERROR: BoundsError: attempt to access ()
  at index [0]
 in getindex at /Users/ivarne/dev/julia/usr/lib/julia/sys.dylib
 in show_method_candidates at replutil.jl:213
 in showerror at replutil.jl:169
 in showerror at replutil.jl:81

So this is a bug in the code to show "closest" method matches when you get a MethodError. cc: @jhasse and @dhoegh.

The full backtrace isn't shown by default, because that could trigger a recursive error dumping.

@dhoegh
Copy link
Contributor

dhoegh commented Jan 30, 2015

I think there is two sepperate issues, I have fixed the one posted by @garborg in #9968

ivarne added a commit that referenced this issue Jan 30, 2015
Fix `show_method_candidates` so it do not fail for methods with zero args.
@tkelman
Copy link
Contributor

tkelman commented Apr 12, 2016

@dpsanders is this fixed now? Could we reduce it to a test case to make sure it stays that way?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
error handling Handling of exceptions by Julia or the user
Projects
None yet
Development

No branches or pull requests

6 participants