-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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 running at_exit handler: Index out of bounds #5224
Comments
On macOS high Sierra, crystal HEAD, $ cat foo.cr
require "spec"
it "work" do
raise "bla"
end
$ ./bin/crystal build foo.cr
$ rm foo.dwarf
$ ./foo
E
Failures:
1) work
bla
~procProc(Nil)@foo.cr:3
it<String, String, Int32, Int32, &Proc(Nil)>:(Array(Spec::Result) | Nil)
__crystal_main
_crystal_main<Int32, Pointer(Pointer(UInt8))>:Nil
Crystal::main_user_code<Int32, Pointer(Pointer(UInt8))>:Nil
Crystal::main<Int32, Pointer(Pointer(UInt8))>:Int32
main
Finished in 124 microseconds
1 examples, 0 failures, 1 errors, 0 pending
Failed examples:
crystal spec foo.cr:3 # work So, I guess this issues comes from the error on decoding backtrace (at least related to DWARF). |
Error happens on this line: crystal/src/debug/dwarf/line_numbers.cr Line 363 in 2e00b8f
|
In case it is helpful, I also ran into this issue: https://gitter.im/crystal-lang/crystal?at=5a43f8815355812e572330d5 This line caused the problem: https://github.com/luckyframework/lucky/blob/a55bc0096b53fa30ddaa9e20b9fc5ee3b5fa5dfa/spec/lucky/log_handler_spec.cr#L41 It worked fine when I ran |
How can we fix this? It's pretty severe. Every spec I run that fails, I get this error. I have to pass |
To know what the problem is we just need to replace this line: Line 141 in c168035
by: STDERR.print "Error running at_exit handler: "
handler_ex.inspect_with_backtrace STDERR I was thinking PR-ing it after #5413 is merged, but it can definitely be done before if someone wants to! |
Oh, it's an index out of bounds. My question is: why does it happen? Something wrong with dwarf decoding? Wrong line numbers being generated? Should we silently ignore this index of out bounds? |
@asterite , @makenowjust share the offending line in #5224 (comment) I haven't track down / workaround the issue. Maybe been defensive in the dwarf parsing, at least in that line, is a way to not crash. Other than @ysbaddaden , I don't know someone that has dwarf format fresh enough to depic the bug in the code. |
Not reproducible on Ubuntu Trusty. The "index out of bounds" is unexpected: the Possible causes:
|
Can someone provide me with a macOS binary + .dwarf for the failing snippet? |
Yesterday I try to drill down a bit on this. Trying to reduce as well, nothing worth a sharing still. |
Thanks, my Mach-O reader reproduces the issue. |
in 0.24
The text was updated successfully, but these errors were encountered: