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

Fix minimal-printf stack overflow #12508

Merged
merged 1 commit into from
Mar 3, 2020

Conversation

evedon
Copy link
Contributor

@evedon evedon commented Feb 25, 2020

Summary of changes

In nightly test, mbed-os-example-crash-reporting fails on GCC_ARM when linking with minimal-printf due to a stack overflow. The fix is to allocate the two int2hex arrays in mbed_minimal_formatted_string_hexadecimal from the heap instead of the stack.

The test now passes although the amount of stack left in the main thread is minimal.

This is the crash reporting Mbed OS example
1st run: Inject the fault exception

++ MbedOS Fault Handler ++

FaultType: HardFault

(...)
-- MbedOS Fault Handler --

++ MbedOS Error Info ++
Error Status: 0x80FF013D Code: 317 Module: 255
Error Message: Fault exception
Location: 0xE64
Error Value: 0x1FFF0400
Current Thread: main Id: 0x20000E74 Entry: 0x2DC7 StackSize: 0x1000 StackMem: 0x20001E60 SP: 0x20002E38

Impact of changes

Fix mbed-os-example-crash-reporting nightly test.

Migration actions required

None

Documentation

N/A


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

Reviewers


@evedon evedon requested a review from hugueskamba February 25, 2020 09:58
@ciarmcom ciarmcom requested review from a team February 25, 2020 10:00
@ciarmcom
Copy link
Member

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

@0xc0170
Copy link
Contributor

0xc0170 commented Feb 25, 2020

Please fix the style (see astyle failures)

@evedon evedon force-pushed the ed-mprintf-stack-overflow branch from caf20e7 to a02f4b4 Compare February 25, 2020 10:44
@evedon
Copy link
Contributor Author

evedon commented Feb 25, 2020

astyle issue fixed.

@0xc0170
Copy link
Contributor

0xc0170 commented Feb 26, 2020

CI started

@mbed-ci
Copy link

mbed-ci commented Feb 26, 2020

Test run: FAILED

Summary: 1 of 8 test jobs failed
Build number : 1
Build artifacts

Failed test jobs:

  • jenkins-ci/mbed-os-ci_cloud-client-pytest

@evedon
Copy link
Contributor Author

evedon commented Feb 28, 2020

@0xc0170 Can you restart CI for cloud-client-test please as I don't think it is related to my PR?

@0xc0170
Copy link
Contributor

0xc0170 commented Mar 2, 2020

I restarted the client test. There is an issue somewhere, reported few days back. I am trying to find out the status today as it has been still failing recently

@0xc0170
Copy link
Contributor

0xc0170 commented Mar 2, 2020

Client restarted

@0xc0170
Copy link
Contributor

0xc0170 commented Mar 3, 2020

Restarted again, the test was disabled until its fixed, tracked internally.

@0xc0170 0xc0170 merged commit d94965f into ARMmbed:master Mar 3, 2020
@evedon evedon deleted the ed-mprintf-stack-overflow branch March 26, 2020 15:20
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.

4 participants