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

sdk: set a panic handler to pipe extra info #387

Closed
raulk opened this issue Mar 11, 2022 · 2 comments
Closed

sdk: set a panic handler to pipe extra info #387

raulk opened this issue Mar 11, 2022 · 2 comments
Milestone

Comments

@raulk
Copy link
Member

raulk commented Mar 11, 2022

Context

Right now, eventual actor panics raise a Wasm trap which is caught by the invocation container (find description of logic here) and converted to an aborto with exit code SysErrActorPanic at the FVM level.

Proposal

Having the SDK set a panic handler would allow us to pipe extra information to the client, presumably for logging purposes. The panic handler could then abort with SysErrActorPanic and record the backtrace in the log file for later inspection. The node would only actually handle the backtrace if debug mode is enabled (which we would do when, e.g. getting execution traces). This is to avoid actor-driven spamming of log files.

Something to consider is whether we want to charge for the message being sent through. Probably not because the actor would've already incurred memory expansion cost to create that message. And enabling debug is an explicit opt-in user action that should come with big warning labels.

Obviously, there is no guarantee that user-deployed actor will use the SDK, so this issue doesn't imply the removal of panic handling logic at the FVM level.

@raulk raulk added this to the Phase 2 milestone Mar 11, 2022
@Stebalien
Copy link
Member

We currently catch panics inside the bultin-actors, and turn them into USR_ASSERTION_FAILED exit codes (sending the panic message to the kernel via the abort call). But this functionality lives in the builtin-actors runtime, not the sdk.

@Stebalien
Copy link
Member

Fixed in #896

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