Kernel exception: fixed top level finally. (#70) #71

Merged
sb10q merged 1 commits from pca006132/artiq-zynq:exception into master 2020-07-23 14:48:45 +08:00

Fixes #70.

This is due to the exception handling code calling terminate directly after _Unwind_RaiseException returns _URC_END_OF_STACK, meaning that no exception handler for that exception is found. However, it would miss the potential cleanup routines which should be called by a forced unwind.

Libunwind does not provide a forced unwind for us, and it seems difficult to do so. This fix uses a hack, reporting handler found when it finds a cleanup routine, which would trick the unwinder to do phase two unwinding (actually calling the cleanup routines) even if no routine would catch the exception.

Fixes #70. This is due to the exception handling code calling `terminate` directly after `_Unwind_RaiseException` returns `_URC_END_OF_STACK`, meaning that no exception handler for that exception is found. However, it would miss the potential cleanup routines which should be called by a forced unwind. Libunwind does not provide a forced unwind for us, and it seems difficult to do so. This fix uses a hack, reporting handler found when it finds a cleanup routine, which would trick the unwinder to do phase two unwinding (actually calling the cleanup routines) even if no routine would catch the exception.
sb10q closed this pull request 2020-07-23 14:48:45 +08:00
Sign in to join this conversation.
No reviewers
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: M-Labs/artiq-zynq#71
There is no content yet.