Skip to content
This repository has been archived by the owner on Jun 19, 2024. It is now read-only.

Only exit on panic in custom tasks #46

Open
doinkythederp opened this issue Jan 15, 2024 · 0 comments
Open

Only exit on panic in custom tasks #46

doinkythederp opened this issue Jan 15, 2024 · 0 comments
Labels
scope:platform_support Updates Rust support (e.g. panic handler, allocator, etc) type:enhancement New feature or request

Comments

@doinkythederp
Copy link
Member

What's the motivation for this feature?

The current panic handler will exit the entire program on a panic. However, it may improve reliability to keep the program running if a sub-task panics.

Describe the solution you'd like

Unwind and run destructors on panic, then if it's the main/entrypoint task, exit

Describe the drawbacks, if any

We would have to figure out how to get unwinding working. Also continuing the program could cause some sort of invalid state if using incorrectly.

Describe the alternative solutions, if any

We could just delete the current task instead of unwinding. This would mean destructors aren't run and memory isn't deallocated. We would have to store a list of mutexes that are locked by the current task and poison them.

Additional context

I know PROS does some unwinding stuff related to C++ destructors, so it might be possible to hook into those APIs.

@doinkythederp doinkythederp added type:enhancement New feature or request scope:platform_support Updates Rust support (e.g. panic handler, allocator, etc) labels Jan 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
scope:platform_support Updates Rust support (e.g. panic handler, allocator, etc) type:enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant