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 non-determinstic boot hang with crashdumps #16130

Merged
merged 1 commit into from
Nov 5, 2020

Conversation

amikhalev
Copy link
Contributor

Describe problem solved by this pull request
Sometimes my FCU would hang on boot, before the boot tune but after the bootloader.
On boot, if board_hardfault_init finds a hardfault stored in BBSRAM, it
checks if there is any data available on stdin to see if there is
somebody there to respond to a prompt. But on boards such as cubeorange
where there is not a serial console by default, the ioctl fails and
bytesWaiting is uninitialized. So it will non-deterministally hang the
boot process with no outside feedback if that value is not zero.

Describe your solution
Initialize bytesWaiting

Describe possible alternatives
N/A

Test data / coverage
I have tested this and it fixed my boot hang.

On boot, if board_hardfault_init finds a hardfault stored in BBSRAM, it
checks if there is any data available on stdin to see if there is
somebody there to respond to a prompt. But on boards such as cubeorange
where there is not a serial console by default, the ioctl fails and
bytesWaiting is uninitialized. So it will non-deterministally hang the
boot process with no outside feedback if that value is not zero.

Signed-off-by: Alex Mikhalev <alexmikhalevalex@gmail.com>
@mhkabir mhkabir requested review from dagar and davids5 November 5, 2020 19:19
@dagar dagar added the bug label Nov 5, 2020
Copy link
Member

@davids5 davids5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@amikhalev Great find! Thank you!

@davids5 davids5 merged commit 91d1825 into PX4:master Nov 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants