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

Avoid crashes during fault handler #11970

Merged
merged 1 commit into from
Dec 4, 2019
Merged

Conversation

kjbracey
Copy link
Contributor

Description

Summary of change

If the fault handler was hit before the stdio console was used and initialised, the initialisation code caused a "mutex in ISR" trap, stopping the register dump from happening.

Temporarily set the error_in_progress flag at the top of the fault handler, and restore it before calling mbed_error. Take the opportunity to suppress fault dumps on recursive crashes, much as is done inside mbed_error.

Fixes #11584.


Pull request type

[X] Patch update (Bug fix / Target update / Docs update / Test update / Refactor)
[] Feature update (New feature / Functionality change / New API)
[] Major update (Breaking change E.g. Return code change / API behaviour change)

Test results

[] No Tests required for this change (E.g docs only update)
[X] Covered by existing mbed-os tests (Greentea or Unittest)
[] Tests / results supplied as part of this PR

@kjbracey kjbracey force-pushed the fault_crash branch 2 times, most recently from 0130151 to bc7e217 Compare November 28, 2019 11:19
@ciarmcom ciarmcom requested review from a team November 28, 2019 12:00
@ciarmcom
Copy link
Member

@kjbracey-arm, thank you for your changes.
@ARMmbed/mbed-os-core @ARMmbed/mbed-os-maintainers please review.

If the fault handler was hit before the stdio console was used and
initialised, the initialisation code caused a "mutex in ISR" trap,
stopping the register dump from happening.

Temporarily set the `error_in_progress` flag at the top of the fault
handler, and restore it before calling `mbed_error`. Take the
opportunity to suppress fault dumps on recursive crashes, much as is
done inside `mbed_error`.
@0xc0170
Copy link
Contributor

0xc0170 commented Dec 3, 2019

CI started

@0xc0170 0xc0170 added the release-version: 6.0.0-alpha-1 First pre-release version of 6.0.0 label Dec 3, 2019
@mbed-ci
Copy link

mbed-ci commented Dec 3, 2019

Test run: SUCCESS

Summary: 11 of 11 test jobs passed
Build number : 1
Build artifacts

@kjbracey
Copy link
Contributor Author

kjbracey commented Dec 4, 2019

This is a pretty straightforward and important fix - it should be for 5.15.1

@0xc0170 0xc0170 removed the needs: CI label Dec 4, 2019
@0xc0170
Copy link
Contributor

0xc0170 commented Dec 4, 2019

This is a pretty straightforward and important fix - it should be for 5.15.1

After 5.15, there will be 6.0. This could be requested to get in rc2.

I'll merge this and we can fix version if agreed.

@0xc0170 0xc0170 merged commit 64d172c into ARMmbed:master Dec 4, 2019
@kjbracey kjbracey deleted the fault_crash branch December 4, 2019 09:38
@0xc0170 0xc0170 added release-version: 5.15.0-rc2 and removed release-version: 6.0.0-alpha-1 First pre-release version of 6.0.0 labels Dec 4, 2019
@0xc0170
Copy link
Contributor

0xc0170 commented Dec 4, 2019

Set to 5.15.0rc2

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

Successfully merging this pull request may close these issues.

Faults before console init cause "mutex in ISR" error
5 participants