Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(280)

Issue 1423583002: Stack sampling profiler: handle unloaded and unloading modules (Closed)

Created:
5 years, 2 months ago by Mike Wittman
Modified:
5 years, 1 month ago
CC:
chromium-reviews, vmpstr+watch_chromium.org, danduong
Base URL:
https://chromium.googlesource.com/chromium/src.git@lkcr
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Stack sampling profiler: handle unloading and unloaded modules Attempt to increment the reference count for the module at the instruction pointer before unwinding the frame. If successful the module is guaranteed be in memory while the stack is being processed. If not successful, the module has been unloaded and unwinding from the frame is not possible. Fixes crashes attempting to unwind frames from modules that get unloaded between copying the stack and walking the copy of the stack. In theory it could happen that a module is unloaded then another module is immediately loaded in a similar memory region, such that the new module contains an instruction pointer associated with the unloaded module. This likely would result in a crash unwinding the frame with the instruction pointer. It's not clear that there's anything that can be done to detect/avoid this case; the hope is that it occurs rarely. BUG=545051 Committed: https://crrev.com/f2d564443af10160ebb9ce97e9d1f103f8544fe0 Cr-Commit-Position: refs/heads/master@{#357453}

Patch Set 1 #

Patch Set 2 : . #

Total comments: 4

Patch Set 3 : add comments #

Total comments: 12

Patch Set 4 : address comments #

Patch Set 5 : non-Win compile fixes #

Patch Set 6 : fix new presubmit check #

Patch Set 7 : fix gcc compile #

Unified diffs Side-by-side diffs Delta from patch set Stats (+743 lines, -122 lines) Patch
M base/BUILD.gn View 1 2 chunks +14 lines, -1 line 0 comments Download
M base/base.gyp View 1 2 chunks +18 lines, -0 lines 0 comments Download
M base/profiler/native_stack_sampler.h View 1 2 3 4 5 3 chunks +24 lines, -1 line 0 comments Download
M base/profiler/native_stack_sampler.cc View 1 chunk +4 lines, -0 lines 0 comments Download
M base/profiler/native_stack_sampler_posix.cc View 1 chunk +2 lines, -1 line 0 comments Download
M base/profiler/native_stack_sampler_win.cc View 9 chunks +32 lines, -48 lines 0 comments Download
M base/profiler/stack_sampling_profiler.h View 1 2 3 chunks +10 lines, -1 line 0 comments Download
M base/profiler/stack_sampling_profiler.cc View 2 chunks +15 lines, -5 lines 0 comments Download
M base/profiler/stack_sampling_profiler_unittest.cc View 1 2 3 4 5 6 15 chunks +417 lines, -40 lines 0 comments Download
A base/profiler/test_support_library.cc View 1 chunk +30 lines, -0 lines 0 comments Download
M base/profiler/win32_stack_frame_unwinder.h View 4 chunks +31 lines, -1 line 0 comments Download
M base/profiler/win32_stack_frame_unwinder.cc View 1 2 3 6 chunks +53 lines, -1 line 0 comments Download
M base/profiler/win32_stack_frame_unwinder_unittest.cc View 1 12 chunks +89 lines, -23 lines 0 comments Download
M base/scoped_native_library.h View 1 1 chunk +2 lines, -0 lines 0 comments Download
M base/scoped_native_library_unittest.cc View 1 1 chunk +2 lines, -0 lines 0 comments Download

Messages

Total messages: 26 (10 generated)
Mike Wittman
PTAL This is a bit long, but most of the changes are in support of ...
5 years, 2 months ago (2015-10-21 23:01:25 UTC) #3
cpu_(ooo_6.6-7.5)
wouldn't it deadlock if somebody who is suspended has acquired the loader lock?
5 years, 2 months ago (2015-10-22 22:16:20 UTC) #4
Mike Wittman
On 2015/10/22 22:16:20, cpu wrote: > wouldn't it deadlock if somebody who is suspended has ...
5 years, 2 months ago (2015-10-22 22:51:33 UTC) #5
cpu_(ooo_6.6-7.5)
we are getting deeper in the weeds here, it is clear that the facility that ...
5 years, 1 month ago (2015-10-29 21:22:20 UTC) #7
Mike Wittman
On 2015/10/29 21:22:20, cpu wrote: > we are getting deeper in the weeds here, it ...
5 years, 1 month ago (2015-10-29 23:23:28 UTC) #8
brucedawson
Where does the reference count get incremented? I expected to see this in Win32StackFrameUnwinder::TryUnwind but ...
5 years, 1 month ago (2015-10-30 00:16:00 UTC) #9
Mike Wittman
On 2015/10/30 00:16:00, brucedawson wrote: > Where does the reference count get incremented? I expected ...
5 years, 1 month ago (2015-10-30 17:08:07 UTC) #10
brucedawson
Sorry for the delayed reply. > I've added a comment to Win32UnwindFunctions::GetModuleForProgramCounter to call this ...
5 years, 1 month ago (2015-10-30 23:40:57 UTC) #11
cpu_(ooo_6.6-7.5)
lgtm
5 years, 1 month ago (2015-11-01 22:38:20 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1423583002/60001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1423583002/60001
5 years, 1 month ago (2015-11-02 17:43:15 UTC) #14
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/114741)
5 years, 1 month ago (2015-11-02 17:54:17 UTC) #16
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1423583002/80001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1423583002/80001
5 years, 1 month ago (2015-11-02 20:25:52 UTC) #19
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/114817)
5 years, 1 month ago (2015-11-02 20:40:34 UTC) #21
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1423583002/120001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1423583002/120001
5 years, 1 month ago (2015-11-02 21:24:43 UTC) #24
commit-bot: I haz the power
Committed patchset #7 (id:120001)
5 years, 1 month ago (2015-11-02 22:38:47 UTC) #25
commit-bot: I haz the power
5 years, 1 month ago (2015-11-02 22:39:35 UTC) #26
Message was sent while issue was closed.
Patchset 7 (id:??) landed as
https://crrev.com/f2d564443af10160ebb9ce97e9d1f103f8544fe0
Cr-Commit-Position: refs/heads/master@{#357453}

Powered by Google App Engine
This is Rietveld 408576698