MergeStacks can get stuck when pseudo-stack does not start with C++ frame

NEW
Unassigned

Status

()

Core
Gecko Profiler
13 days ago
13 days ago

People

(Reporter: jchen, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

13 days ago
`MergeStacks` in platform.cpp assumes that the first frame (index 0) of the pseudo-stack is a C++ frame, in order to initialize `lastPseudoCppStackAddr`.

If, however, the first frame is not a C++ frame (or a JS_OSR frame), `pseudoIndex` is never incremented elsewhere, and `lastPseudoCppStackAddr` is never initialized. This results in an infinite loop because the condition `pseudoIndex != pseudoCount` is never satisfied. In debug builds, this should trigger an assertion at [1].

[1] https://searchfox.org/mozilla-central/rev/b24e6342d744c5a83fab5c15972e11eeb69d68e6/tools/profiler/core/platform.cpp#857
You need to log in before you can comment on or make changes to this bug.