Uh oh!
There was an error while loading. Please reload this page.
safety: show error return trace when unwrapping error in switch - #12807
safety: show error return trace when unwrapping error in switch#12807Vexu wants to merge 2 commits into
Conversation
andrewrk
commented
Sep 12, 2022
Looks great. It would be nice to get rid of these frames from the stack trace too: |
6233823 to
72f132dCompareandrewrk
commented
Sep 14, 2022
I rebased this against master branch, updated the CI tarballs for windows and macos, and force pushed. |
andrewrk
left a comment
There was a problem hiding this comment.
I suggest instead of inline calls, to have these functions use @returnAddress() and then pass this forward into the panic system so that this value ends up passed to panicImpl as the first_trace_addr parameter. Maybe this means we have to make a breaking change to the panic function signature to add this parameter. If that is the case, I'm fine with it.
This will be more appropriate for cold functions to do, and result in less bloat from inlined things.
As a side note, I'm a little uncomfortable with how much std lib formatting is being dragged in by builtin panic helper functions, and by the fact that overriding the panic handler still results in a bunch of formatting stuff being outputted. But, I don't have any concrete suggestions for improvement on that, and it's not relevant to this PR, and I think that the helpful debugging messages are worth it in the end.
Vexu
commented
Sep 14, 2022
That would require changing
How about a |
andrewrk
commented
Sep 14, 2022
Let's do it.
Worth considering. Now that you mention it, I can think of a couple other options worth considering as well. Sounds like we should discuss in a separate proposal that does not block this PR, yeah? |
Vexu
commented
Sep 14, 2022
Any ideas to what could be causing this? I don't think |
andrewrk
commented
Sep 14, 2022
Can I see the corresponding function signature from the LLVM module? |
Vexu
commented
Sep 14, 2022
How do I pass |
andrewrk
commented
Sep 14, 2022
My suggestion is to invoke make like this: |
c340698 to
19b4503Compare
A small quality-of-life improvement I thought of while trying to figure out where an
error.GenericPoisonwas coming from.Example situation:
before:
after:
This also makes
@panicshow error return trace in these same situations which you can test by uncommenting lines in the example.