Skip to content

RawMemoryFreeList can't get more space from mmap #1091

@wks

Description

@wks

I observed the following error when the CI was running for #1067

The GitHub Action link: https://github.com/mmtk/mmtk-core/actions/runs/8293161626/job/22695757005?pr=1067

---- util::raw_memory_freelist::tests::alloc_exhaust stdout ----
thread 'util::raw_memory_freelist::tests::alloc_exhaust' panicked at 'Can't get more space with mmap()', src/util/raw_memory_freelist.rs:202:9
stack backtrace:
   0: rust_begin_unwind
             at /rustc/eb26296b556cef10fb713a38f3d16b9886080f26/library/std/src/panicking.rs:593:5
   1: core::panicking::panic_fmt
             at /rustc/eb26296b556cef10fb713a38f3d16b9886080f26/library/core/src/panicking.rs:67:14
   2: mmtk::util::raw_memory_freelist::RawMemoryFreeList::mmap
             at ./src/util/raw_memory_freelist.rs:202:9
   3: mmtk::util::raw_memory_freelist::RawMemoryFreeList::raise_high_water
             at ./src/util/raw_memory_freelist.rs:196:9
   4: mmtk::util::raw_memory_freelist::RawMemoryFreeList::grow_list_by_blocks
             at ./src/util/raw_memory_freelist.rs:144:13
   5: mmtk::util::raw_memory_freelist::RawMemoryFreeList::grow_freelist
             at ./src/util/raw_memory_freelist.rs:134:9
   6: mmtk::util::raw_memory_freelist::tests::new_raw_memory_freelist
             at ./src/util/raw_memory_freelist.rs:279:9
   7: mmtk::util::raw_memory_freelist::tests::alloc_exhaust
             at ./src/util/raw_memory_freelist.rs:474:40
   8: mmtk::util::raw_memory_freelist::tests::alloc_exhaust::{{closure}}
             at ./src/util/raw_memory_freelist.rs:473:24
   9: core::ops::function::FnOnce::call_once
             at /rustc/eb26296b556cef10fb713a38f3d16b9886080f26/library/core/src/ops/function.rs:250:5
  10: core::ops::function::FnOnce::call_once
             at /rustc/eb26296b556cef10fb713a38f3d16b9886080f26/library/core/src/ops/function.rs:250:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

I think it is unrelated to #1067. I suspect it is related to address space layout randomization (ASLR) and the tight address space of 32-bit architecture, and that particular execution may unfortunately allocated the free list at a place that cannot be grown.

I'll re-run the test and see if the problem persists.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions