Last Comment Bug 713278 - Teach NS_StackWalk to walk the stack of other threads too on Windows
: Teach NS_StackWalk to walk the stack of other threads too on Windows
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: XPCOM (show other bugs)
: unspecified
: x86 Mac OS X
: -- normal (vote)
: mozilla12
Assigned To: :Ehsan Akhgari (out sick)
:
Mentors:
Depends on: 763723 767479
Blocks: 713227
  Show dependency treegraph
 
Reported: 2011-12-23 12:16 PST by :Ehsan Akhgari (out sick)
Modified: 2012-07-09 14:57 PDT (History)
6 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Patch (v1) (6.45 KB, patch)
2011-12-23 12:43 PST, :Ehsan Akhgari (out sick)
no flags Details | Diff | Review
Patch (v2) (9.93 KB, patch)
2011-12-23 14:26 PST, :Ehsan Akhgari (out sick)
dbaron: review+
Details | Diff | Review

Description :Ehsan Akhgari (out sick) 2011-12-23 12:16:02 PST
We need this for the profiler.  Vladan needs this for his chromehang work.  Seems like everybody wants a smarter NS_StackWalk!
Comment 1 :Ehsan Akhgari (out sick) 2011-12-23 12:43:07 PST
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.
Comment 2 :Ehsan Akhgari (out sick) 2011-12-23 14:26:24 PST
Created attachment 584125 [details] [diff] [review]
Patch (v2)

No default arguments in C!
Comment 3 Mozilla RelEng Bot 2011-12-23 15:30:27 PST
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 Mozilla RelEng Bot 2011-12-23 23:01:00 PST
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 5 David Baron :dbaron: ⌚️UTC-7 (review requests must explain patch) 2011-12-27 12:33:13 PST
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
Comment 6 :Ehsan Akhgari (out sick) 2011-12-28 08:44:04 PST
https://hg.mozilla.org/integration/mozilla-inbound/rev/1b72fc52dfe1
Comment 7 Marco Bonardo [::mak] 2011-12-29 03:24:58 PST
https://hg.mozilla.org/mozilla-central/rev/1b72fc52dfe1

Note You need to log in before you can comment on or make changes to this bug.