Skip to content

add GosCompatMemoryTests#361

Open
inthewaves wants to merge 1 commit into
GrapheneOS:16-qpr2from
inthewaves:goscompatmemorytests
Open

add GosCompatMemoryTests#361
inthewaves wants to merge 1 commit into
GrapheneOS:16-qpr2from
inthewaves:goscompatmemorytests

Conversation

@inthewaves

@inthewaves inthewaves commented Jun 3, 2026

Copy link
Copy Markdown
Member

Adds tests that runs a /proc/self/smaps streaming parser with memory allocations for each VMA based on GrapheneOS/os-issue-tracker#7916. The test is run with hardened_malloc disabled as a control and run with hardened_malloc enabled. Tests will stop at a high limit of VMAs rather than go until an out of memory error / low memory killer is invoked

Current failure also prints out a histogram of VMAs:

signal 6 (SIGABRT), code -1 (SI_QUEUE)
abort message: simple_smaps_parser guard abort after element allocation guard: accepted_vma_records=16385 max_accepted_vma_records=16384 bytes_allocated=31457360 max_bytes_allocated=201326592
memory mappings:
  total=18975
  18726 [anon:malloc 96]
  50 [anon:malloc slab region gap]
  23 <anonymous>
  17 [anon:malloc allocator_state]
  13 [anon:.bss]
  13 [anon:bionic_alloc_small_objects]
  7 [anon:cfi shadow]
  7 [page size compat]
  4 /apex/com.android.runtime/bin/linker64
  4 /apex/com.android.runtime/lib64/bionic/libc.so
  4 /apex/com.android.runtime/lib64/bionic/libm.so
  4 /data/local/tmp/goscompat_smaps_native_runner
  ... 76 more mapping names

The test purposely makes 80-byte allocations for each VMA, so adding the 8-byte canary leads to 88 bytes and rounded up to the 96-byte class

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