-
Notifications
You must be signed in to change notification settings - Fork 0
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
Fix user task exit by exception #226
Conversation
114b7cb
to
699c1f5
Compare
699c1f5
to
5036d5d
Compare
5036d5d
to
8329991
Compare
…force-cancelled There is no point in waiting for children to exit if the parent is force-cancelled Signed-off-by: Jukka Laitinen <[email protected]>
…using an exception We shouldn't panic the kernel when a user task excepts, we can just kill the user task and it's children. Do this by returning to _exit() in kernel context. Signed-off-by: Jukka Laitinen <[email protected]>
… currently running task in risc-v syscall If a context switch occurs in syscall, the g_running_task need to be recorded for assert logic. This copies the logic from arm platforms Signed-off-by: Jukka Laitinen <[email protected]>
8329991
to
13ea8e1
Compare
I reverted the running_task -> this_task change in favor of following the upstream g_running_tasks[thiscpu()] recording method. The reason why g_running_task method was not working was that it needs to be updated every time a context switch occurs, i.e. also in syscalls. Made another Pr for this in upstream: apache#11961. sorry for continuous updates to this PR, I decided to just put this into this same one as this was not yet merged. |
Summary
Fix the bugs DP-2143, DP-8522
I will still offer this to upstream review first
Impact
Increase resilience to SW bugs, don't crash the whole system if a userspace process excepts
Testing
Injected NULL dereference bugs in couple of PX4 processes, tried out that they exit without causing a panic.