Skip to content

FreeRTOS: fix SIGSEV on shutdown by checking if heapTrackingAlive#197

Merged
NeroBurner merged 1 commit into
mainfrom
fix_sigsev_on_shutdown
Jul 6, 2026
Merged

FreeRTOS: fix SIGSEV on shutdown by checking if heapTrackingAlive#197
NeroBurner merged 1 commit into
mainfrom
fix_sigsev_on_shutdown

Conversation

@NeroBurner

@NeroBurner NeroBurner commented Jul 5, 2026

Copy link
Copy Markdown
Collaborator

On shutdown some global variables are cleaned up. In our case it is the allocatedMemory global variable.

Check if the heap tracking is still possible by logging the bool variable heapTrackingAlive to false on destructor. Then we can ignore heap tracking as the allocatedMemory map is already freed.

Patch provided by @sofar in #190 (comment)

Co-authored-by: https://github.com/sofar

Fixes: #190

On shutdown some global variables are cleaned up. In our case it is the
`allocatedMemory` global variable.

Check if the heap tracking is still possible by logging the bool
variable `heapTrackingAlive` to `false` on destructor. Then we can
ignore heap tracking as the `allocatedMemory` map is already freed.

Co-authored-by: https://github.com/sofar
@NeroBurner NeroBurner self-assigned this Jul 5, 2026
@NeroBurner NeroBurner added the bug Something isn't working label Jul 5, 2026
@NeroBurner

Copy link
Copy Markdown
Collaborator Author

@sofar I applied your patch. Could you verify my commit message if I understood it correctly?

@NeroBurner NeroBurner mentioned this pull request Jul 5, 2026
@sofar

sofar commented Jul 6, 2026

Copy link
Copy Markdown

Yeah, that looks fine.

@NeroBurner NeroBurner merged commit 18fb562 into main Jul 6, 2026
2 checks passed
@NeroBurner NeroBurner deleted the fix_sigsev_on_shutdown branch July 6, 2026 09:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SIGSEGV on shutdown

2 participants