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

Turn jet sometimes doesn't save the call stack of the gate if the gate crashes #243

Open
philipquirk opened this issue Jun 19, 2024 · 2 comments

Comments

@philipquirk
Copy link
Contributor

I sometimes crash and get a call stack that gives a call to turn and the line numbers go from the turn call all the way to the end of the gate. If I comment out the turn jet in hot.rs then I get the line number of the exact crash. So sometimes the turn jet isn't passing the call stack of the crashing gate up.

I looked at the code and if the gate is jetted it calls jet()? with ? passing the error up. If the gate isn't jetted, then it calls interpret()? passing the error up. But then I looked in interpret() where it calls jets and it basically does the same thing (it matches on the error but if its not JetPunt then it passes it up). So I'm not sure exactly how the call stack gets passed or where the bug is.

@philipquirk
Copy link
Contributor Author

I should add that I have seen call stacks go through turn, and I'm guessing it depends on whether the gate itself is jetted, but I haven't looked into it to make sure.

@joemfb joemfb mentioned this issue Jun 24, 2024
4 tasks
@litlep-nibbyt
Copy link
Contributor

litlep-nibbyt commented Sep 20, 2024

I was looking at this issue. It seem like the call stack containing the crash line does get returned, but it's at the bottom of the trace. Since 'turn' is a jet which calls interpret the failure stack trace of the gate gets propagated back to the initial nock 9 call as an error. Inside of exit, the call stack containing the gate crash then gets appended to the end of the existing call stack. See: https://github.com/zorp-corp/sword/blob/status/rust/sword/src/interpreter.rs#L1232.

Naively prepending the gate crash call stack doesn't work because errors must return a list of tangs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants