Teach NS_StackWalk to walk the stack of other threads too on Windows

RESOLVED FIXED in mozilla12

Status

()

Core
XPCOM
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: Ehsan, Assigned: Ehsan)

Tracking

unspecified
mozilla12
x86
Mac OS X
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

We need this for the profiler.  Vladan needs this for his chromehang work.  Seems like everybody wants a smarter NS_StackWalk!
Created attachment 584102 [details] [diff] [review]
Patch (v1)

I used uintptr_t, because there seems to be no good way of getting a HANDLE out of a PRThread.
Assignee: nobody → ehsan
Status: NEW → ASSIGNED
Attachment #584102 - Flags: review?(dbaron)
Created attachment 584125 [details] [diff] [review]
Patch (v2)

No default arguments in C!
Attachment #584102 - Attachment is obsolete: true
Attachment #584102 - Flags: review?(dbaron)
Attachment #584125 - Flags: review?(dbaron)

Comment 3

5 years ago
Try run for a0ded2d34b1a is complete.
Detailed breakdown of the results available here:
    https://tbpl.mozilla.org/?tree=Try&rev=a0ded2d34b1a
Results (out of 14 total builds):
    exception: 4
    failure: 10
Builds (or logs if builds failed) available at:
http://ftp.mozilla.org/pub/mozilla.org/firefox/try-builds/eakhgari@mozilla.com-a0ded2d34b1a

Comment 4

5 years ago
Try run for 7120721080de is complete.
Detailed breakdown of the results available here:
    https://tbpl.mozilla.org/?tree=Try&rev=7120721080de
Results (out of 207 total builds):
    exception: 1
    success: 180
    warnings: 26
Builds (or logs if builds failed) available at:
http://ftp.mozilla.org/pub/mozilla.org/firefox/try-builds/eakhgari@mozilla.com-7120721080de
Comment on attachment 584125 [details] [diff] [review]
Patch (v2)

>+    HANDLE targetThread = ::GetCurrentThread();
>+    if (aThread) {
>+        targetThread = reinterpret_cast<HANDLE> (aThread);
>+    }

Why not do an if/else to avoid the GetCurrentThread call?



I suspect you'll have to adjust this code a bit once you try to add a second platform (e.g., uintptr_t as the thread type, 0/null as the indicator for current thread), but I guess you'll hit that when you hit that, and this seems ok for now.

r=dbaron
Attachment #584125 - Flags: review?(dbaron) → review+
https://hg.mozilla.org/integration/mozilla-inbound/rev/1b72fc52dfe1
Target Milestone: --- → mozilla12
https://hg.mozilla.org/mozilla-central/rev/1b72fc52dfe1
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Depends on: 767488, 763723
Depends on: 767479
No longer depends on: 763723
Depends on: 763723
No longer depends on: 767488
You need to log in before you can comment on or make changes to this bug.