Skip to content

test: add coverage for untested allocator error paths - #369

Open
jvoisin wants to merge 1 commit into
GrapheneOS:mainfrom
jvoisin:moartests
Open

test: add coverage for untested allocator error paths#369
jvoisin wants to merge 1 commit into
GrapheneOS:mainfrom
jvoisin:moartests

Conversation

@jvoisin

@jvoisin jvoisin commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Add three small-allocation test cases and wire them into the Makefile and test_smc.py harness:

  • invalid_free_aligned_sized_small: free_aligned_sized() with a non-power-of-two alignment, covering the "invalid sized deallocation alignment (small)" fatal path.
  • invalid_malloc_object_size_small_canary: malloc_object_size() queried at an offset past the usable region, covering the "invalid malloc_object_size (canary)" fatal path.
  • read_canary_after_small: revive the orphaned test that verifies the slack past a small request stays zeroed across alloc/free cycles; fix the NULL check that ran after the memset and tidy indentation.

Comment thread test/read_canary_after_small.c Outdated
Add two small-allocation test cases and wire them into the Makefile and
test_smc.py harness:

- invalid_free_aligned_sized_small: free_aligned_sized() with a
  non-power-of-two alignment, covering the "invalid sized deallocation
  alignment (small)" fatal path.
- invalid_malloc_object_size_small_canary: malloc_object_size() queried
  at an offset past the usable region, covering the
  "invalid malloc_object_size (canary)" fatal path.
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