New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 692250 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Apr 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 3
Type: Bug



Sign in to add a comment

Garbled blink_gc types

Project Member Reported by dskiba@chromium.org, Feb 14 2017

Issue description

I noticed that blink_gc heap dumps from Android feature garbled types. See attached screenshot taken from this trace: https://drive.google.com/file/d/0B_Hmi138MnbJSkpyTVd6ckRNSTg/view?usp=sharing

When I dug deeper I found that all of those types are instances of "blink::CSSValue" and "blink::Node".

The problem is code that submits those types declares 'const char typeName[]' array on the stack:

    const char typeName[] = "blink::CSSValue";
    return ThreadHeap::allocateOnArenaIndex(
        state, size,
        isEager ? BlinkGC::EagerSweepArenaIndex : BlinkGC::CSSValueArenaIndex,
        GCInfoTrait<CSSValue>::index(), typeName);

This creates 'const char typeName[16]' array on the stack and initializes it with "blink::CSSValue" chars. Code then submits that pointer to allocateOnArenaIndex(), where it's interned by BlinkGCMemoryDumpProvider.

By the time we're reading that interned pointer (in OnMemoryDump) the original content of typeName is long gone, and we end up reading random bytes from the stack.

The fix is simple: either make that array static, or declare it as 'const char*' pointer.
 
blink_gc-types.png
66.2 KB View Download
Owner: tasak@chromium.org
Status: Fixed (was: Untriaged)
Fixed by https://codereview.chromium.org/2750003002.

Sign in to add a comment