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
Meaningfull compiler backtraces #6574
Comments
Comment author: @damiendoligez patch_location: ok patch_misc: |
Comment author: @chambart If we don't want to change the behavior we could either reraise also in remove_file (leading to quite surprising, but complete stack traces), or check the presence of the file with Sys.readdir. |
Comment author: @alainfrisch We should probably expose reraise in the stdlib. |
Comment author: @gasche Looking at patch_misc again, I am not sure that doligez's remark about symlinks applies: this is Misc.remove_file, a function that is used only in the compiler codebase, not by external users. Looking at its call sites, I see it used only to remove a file that is, on non-error paths, created by the compiler itself, so we know that:
So I would argue that the patch is correct (the behavior is changed, but it is more correct than it was before). It is also simpler than adding a separate primitive for file removal without exceptions, as proposed in |
Comment author: @damiendoligez Merged in trunk (commit 355c982), choosing the "reraise" version of the patch. |
Original bug ID: 6574
Reporter: @chambart
Status: closed (set by @damiendoligez on 2016-01-12T15:53:44Z)
Resolution: fixed
Priority: normal
Severity: minor
Version: 4.03.0+dev / +beta1
Target version: 4.03.0+dev / +beta1
Fixed in version: 4.03.0+dev / +beta1
Category: ~DO NOT USE (was: OCaml general)
Bug description
The main functions of the compiler have a catch-all try-with that cut the exception backtraces:
patch_misc.diff, avoid raising in remove_file in the common case.
It can either be solved by hand-inlining it: patch_main.diff
or by using the reraise primitive in report_error: patch_location.diff
File attachments
The text was updated successfully, but these errors were encountered: