Skip to content

Keep process metadata alive until reaping - #13

Closed
JaxCalder wants to merge 1 commit into
mainfrom
fix/process-command-lifetime
Closed

JaxCalder wants to merge 1 commit into
mainfrom
fix/process-command-lifetime

Conversation

@JaxCalder

@JaxCalder JaxCalder commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Process metadata must survive module unloading until its parent reaps the process. Commands were retagged to the module context's allocation bucket and could be collected by Dmod_Unload before process_destroy freed or inspected them. Other metadata created through the legacy system-side strdup could also inherit a caller's lifetime.

Keep process-owned allocations under the process implementation's allocator and release them explicitly at process destruction. Add a regression allocator that performs module GC between command creation and reaping, covering both command setters and checking final cleanup.

Validation: 180 existing process checks and the new command lifetime test pass. Repeated STM32 TLS diagnostics exit and are reaped successfully alongside the FreeRTOS termination fix.

Related FreeRTOS termination fix: choco-technologies/dmosi-freertos#74. TLS implementation: choco-technologies/dmtls#1.

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.

1 participant