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




a year ago
6 months ago


(Reporter: jchen, Unassigned)


Firefox Tracking Flags

(Not tracked)


`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].

I'm not sure it's even possible to get into this state, as a native frame should always be first. I'll mark it as P5 as we can accept a patch to fix this, but I don't think it'll hit that code path. If I'm wrong let's elevate the priority.
Priority: -- → P5
IIRC I was seeing this on worker threads, which don't necessarily start with a native frame.
You need to log in before you can comment on or make changes to this bug.