Skip to content

(benign?) assertion error on debug build #213

@shwestrick

Description

@shwestrick

Confirmed on commit 70bfe0f but seems like this error has been there for a while. (Makes sense because AFAICT the problem is just an overzealous assertion; there doesn't seem to be any real bug here.)

Here's an example of the failure:

$ make nearest-nbrs-ng.mpl-dbg.bin   # debug build: mpl -debug true -debug-runtime true -keep g ...
$ nearest-nbrs-ng.mpl-dbg.bin @mpl procs 30 set-affinity -- -n 100000 -repeat 2
...
nearest-nbrs-ng.mpl-dbg.bin: gc/local-heap.c:155: HM_ensureHierarchicalHeapAssurances: Assertion `invariantForMutatorFrontier (s)' failed.
Aborted (core dumped)

Specifically this part of the assertion is failing, i.e., it's checking that the amount of space remaining in the current chunk is larger than thread->bytesNeeded.
https://github.com/MPLLang/mpl/blob/70bfe0fc4eef5c5ead66eb2af8698b42185585aa/runtime/gc/invariant.c#L19C11-L19C74

This occurs within GC_HH_joinIntoParent; the assertions happen inside of this call.

The function GC_HH_joinIntoParent does not have any obligation to ensure bytes free. I believe the purpose of the HM_ensureHierarchicalHeapAssurances call is only to ensure that we are currently within a chunk at the current level (which interacts with lazily using an ancestor chunk for as long as possible).

Perhaps GC_HH_joinIntoParent should just ensure bytes free; this may be the simplest solution.

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