Skip to content

fix: fix runtime error caused by memory allocation issues in MajorPeaks#24

Open
danichang1 wants to merge 1 commit into
25-26_devfrom
fix/majorPeaksCrashing
Open

fix: fix runtime error caused by memory allocation issues in MajorPeaks#24
danichang1 wants to merge 1 commit into
25-26_devfrom
fix/majorPeaksCrashing

Conversation

@danichang1

Copy link
Copy Markdown
Collaborator

Was experiencing an issue in VibroSonics where rebuilding a major peaks module too many times would eventually lead to the ESP32 crashing and resetting. Using an ESP32 crash decoder, decoded backtrace to see that crash was occurring when attempting to allocate memory in MajorPeaks::resetPeaksArrays().

To fix this issue, switched from dynamically allocating and deleting memory for outputFrequencies and outputAmplitudes during runtime to statically allocating the memory initially.

@aokiam aokiam left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

looks good to me! thanks for finding the bug

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.

2 participants