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 crash on dual start #1

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft

Fix crash on dual start #1

wants to merge 3 commits into from

Conversation

lifezoned4
Copy link

The library crashes fatal when the start method is called twice.

  • Fix by protecting start without being in STOPPED state.
  • Added STOPPED/STARTED State management for protecting dual start.

void test_no_unusual_reset(){
const soc_reset_reason_t reason = esp_rom_get_reset_reason(0);
TEST_ASSERT_MESSAGE(reason != RESET_REASON_CPU0_SW, "Should not be software reset (lib crash?)");
if(reason == RESET_REASON_CPU0_SW) TEST_ABORT();
Copy link
Author

Choose a reason for hiding this comment

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

I am not 100% sure why the platformio testing framework (unity) is looping over the tests altough I try to abort them here. It still reaches the crash position and continue a rerun (fails on this one) but continue to loop.

This Unit Test construct can probably be cleaned up and been written in a better way.

@lifezoned4 lifezoned4 force-pushed the fix-dual-start-crash branch from 402e2a7 to 2ab70b1 Compare August 24, 2023 14:11
@mehtmehtsen mehtmehtsen force-pushed the fix-dual-start-crash branch from 9d86e0c to d98b9f1 Compare October 4, 2023 11:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants