DescriptionStack 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 #
Messages
Total messages: 26 (10 generated)
|