Closed Bug 1695604 Opened 5 years ago Closed 5 years ago

Windows' MozStackWalk{,Thread} self-skip too much

Categories

(Core :: mozglue, defect)

Unspecified
Windows
defect

Tracking

()

RESOLVED DUPLICATE of bug 1515229

People

(Reporter: mozbugz, Assigned: mozbugz)

References

Details

Attachments

(1 obsolete file)

When walking the stack of the current thread, MozStackWalkThread skips 3 frames in order not to expose the stack-walking code.
This dates from before 2008: Bug 374689 is the earliest I can go to, and it modified even larger skipping values! The compiled code has probably changed since then.
While working on it for bug 1635987, I noticed that it was skipping too many frames, and ended up skipping some non-stack-walking functions.

One of the main users (Gecko Profiler markers) also doesn't want to expose its own code, so it ends up not being an issue there. But there may be other code that would want their full stacks? It should be fixed anyway.

One related issue is that there are no automated tests for these functions. It would be nice to write some tests to verify the upcoming fix, and to catch future regressions.

Note: I'm focusing on Windows here because that's where I'm working at the moment, I'll examine other platforms in the near future...

Tests on Windows now verify that the leaf stack frames are as expected (preset, in the correct order, starting from the leaf-most frame, and excluding the stack walker code itself).
This confirmed that Windows' MozStackWalk and MozStackWalkThread self-skipping were incorrect at 3. These are now fixed to be 2 and 1 respectively.

Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → DUPLICATE

Comment on attachment 9206553 [details]
Bug 1695604 - Fix MozStackWalk self-skipping, add gtests - r?mstange!,canaltinova

Revision D107029 was moved to bug 1515229. Setting attachment 9206553 [details] to obsolete.

Attachment #9206553 - Attachment is obsolete: true
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: