Skip to content

Fixed NOR reclaim allocation failure reporting - #84

Merged
fdesbiens merged 3 commits into
eclipse-threadx:devfrom
miracoli:fix/lx-direct-read-uninitialized-status
Sep 25, 2026
Merged

fdesbiens merged 3 commits into
eclipse-threadx:devfrom
miracoli:fix/lx-direct-read-uninitialized-status

Conversation

@miracoli

@miracoli miracoli commented Aug 10, 2026 •

Copy link
Copy Markdown
Contributor

On allocation failure, NOR block reclaim compared a null sector address with block pointers before reporting the error; in direct read builds, the old return could also use an uninitialized status.

Return LX_SYSTEM_ALLOCATION_FAILED and skip address comparisons when allocation leaves its output null. Regression checks failures on the initial allocation and retry in buffered and direct read builds. Thanks to @jiri-novotny for identifying the status defect in #21.

GCC 14 CMake/Ninja tests passed 50/50 across ten configurations with the #83 fix on dev. Merged coverage reached 1,646/2,404 lines (68.47%) and 1,614/2,451 branches (65.85%). GitHub repository checks, ECA, and the full regression job passed. Not run on hardware.

@rahmanih rahmanih left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM 💯

Physical-sector allocation clears both output pointers on failure. Reclaim compared
the null sector address with block pointers before reporting the error, which has
undefined behavior in C99.

Check the mapping output before both address range tests. Add a regression that
fails the first allocation or its retry and verifies the returned error,
diagnostic, and absence of writes or erases.

GCC 14 CMake/Ninja: 4/4 tests passed in standalone buffered, standalone direct
read, and ThreadX linked direct read builds. The coverage build passed its
focused test; gcov recorded two allocation failure returns.

Assisted-by: Codex (GPT-6) <noreply@openai.com>
@fdesbiens fdesbiens changed the title reclaim: fix uninitialized status when LX_DIRECT_READ is used Fixed NOR reclaim allocation failure reporting Sep 25, 2026
@fdesbiens

Copy link
Copy Markdown
Contributor

Thank you, @miracoli, for the fix, @rahmanih for the review, and @jiri-novotny for identifying the status defect. This will be part of the v6.5.2 release next week.

@fdesbiens
fdesbiens merged commit 6a278ec into eclipse-threadx:dev Sep 25, 2026
4 checks passed
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