Skip to content
This repository was archived by the owner on Nov 1, 2020. It is now read-only.
This repository was archived by the owner on Nov 1, 2020. It is now read-only.

Wasm: Question: conservative gc and heap_segment_allocated #8205

@yowl

Description

@yowl

In https://raw.githubusercontent.com/dotnet/corert/master/src/Native/gc/gc.cpp at line 17681 there is (this is too big a file for github to view normally, hence no permalink)

(printfs mine obviously)

        heap_segment* seg = find_segment (interior, FALSE);
        if (seg
#ifdef FEATURE_CONSERVATIVE_GC
            && (GCConfig::GetConservativeGC() || interior <= heap_segment_allocated(seg))
#endif
            )
        {
            // If interior falls within the first free object at the beginning of a generation,
            // we don't have brick entry for it, and we may incorrectly treat it as on large object heap.
            int align_const = get_alignment_constant (heap_segment_read_only_p (seg)
#ifdef FEATURE_CONSERVATIVE_GC
                                                       || (GCConfig::GetConservativeGC() && !heap_segment_uoh_p (seg))
#endif
                                                      );
#ifdef FEATURE_CONSERVATIVE_GC
            printf("conservative gc\n");
#endif
            if (interior >= heap_segment_allocated(seg))
            {
                printf("interior %08x seg %d heap_segment_allocated(seg) %08x\n", interior, seg, heap_segment_allocated(seg));
            }
            assert (interior < heap_segment_allocated (seg));

The first if condition has GCConfig::GetConservativeGC() || interior <= heap_segment_allocated(seg) so its possible to get inside with interior > heap_segment_allocated(seg) when GetConservativeGC() is true . A few lines later, there is the assert on interior < heap_segment_allocated (seg) which would fail in this scenario . I'm hitting this assert, so if this assert looks correct for conservative GC then I've got something wrong somewhere else. Can someone confirm this assert is valid for conservative GC?
Thanks.

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