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

Issue 10700080: Prevent code folding in the ThreadWatcher ThreadUnresponsive_X functions. (Closed)

Created:
8 years, 5 months ago by Robert Sesek
Modified:
8 years, 5 months ago
CC:
chromium-reviews, MAD, Ilya Sherman
Visibility:
Public.

Description

Prevent code folding in the ThreadWatcher ThreadUnresponsive_X functions. Compiler optimizations were folding all the CHECK(false) lines into a single, causing them to bucket the same on the crash server. This alters the bodies of the functions to avoid folding. Inlining will still happen, but the DWARF data should still be able to identify the instructions as coming from these functions. If not, a noinline attribute will need to be applied. BUG=134254 TEST=Crash stats. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=146414

Patch Set 1 #

Total comments: 3

Patch Set 2 : __LINE__ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+13 lines, -9 lines) Patch
M chrome/browser/metrics/thread_watcher.cc View 1 2 chunks +13 lines, -9 lines 0 comments Download

Messages

Total messages: 12 (0 generated)
Robert Sesek
8 years, 5 months ago (2012-07-03 14:12:14 UTC) #1
jar (doing other things)
drive by commentary: The way I usually avoid this confusion is be re-implementing CHECK(false) with ...
8 years, 5 months ago (2012-07-03 16:43:25 UTC) #2
eroman
lgtm https://chromiumcodereview.appspot.com/10700080/diff/1/chrome/browser/metrics/thread_watcher.cc File chrome/browser/metrics/thread_watcher.cc (right): https://chromiumcodereview.appspot.com/10700080/diff/1/chrome/browser/metrics/thread_watcher.cc#newcode43 chrome/browser/metrics/thread_watcher.cc:43: CHECK(false) << __FUNCTION__; I am slightly surprised that ...
8 years, 5 months ago (2012-07-03 19:00:38 UTC) #3
Robert Sesek
https://chromiumcodereview.appspot.com/10700080/diff/1/chrome/browser/metrics/thread_watcher.cc File chrome/browser/metrics/thread_watcher.cc (right): https://chromiumcodereview.appspot.com/10700080/diff/1/chrome/browser/metrics/thread_watcher.cc#newcode43 chrome/browser/metrics/thread_watcher.cc:43: CHECK(false) << __FUNCTION__; On 2012/07/03 19:00:38, eroman wrote: > ...
8 years, 5 months ago (2012-07-10 18:43:09 UTC) #4
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/rsesek@chromium.org/10700080/1
8 years, 5 months ago (2012-07-10 18:43:24 UTC) #5
jar (doing other things)
https://chromiumcodereview.appspot.com/10700080/diff/1/chrome/browser/metrics/thread_watcher.cc File chrome/browser/metrics/thread_watcher.cc (right): https://chromiumcodereview.appspot.com/10700080/diff/1/chrome/browser/metrics/thread_watcher.cc#newcode43 chrome/browser/metrics/thread_watcher.cc:43: CHECK(false) << __FUNCTION__; On 2012/07/10 18:43:09, rsesek wrote: > ...
8 years, 5 months ago (2012-07-10 20:05:23 UTC) #6
Robert Sesek
On 2012/07/10 20:05:23, jar wrote: > https://chromiumcodereview.appspot.com/10700080/diff/1/chrome/browser/metrics/thread_watcher.cc > File chrome/browser/metrics/thread_watcher.cc (right): > > https://chromiumcodereview.appspot.com/10700080/diff/1/chrome/browser/metrics/thread_watcher.cc#newcode43 > ...
8 years, 5 months ago (2012-07-12 15:14:18 UTC) #7
jar (doing other things)
lgtm
8 years, 5 months ago (2012-07-12 18:16:44 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/rsesek@chromium.org/10700080/4
8 years, 5 months ago (2012-07-12 18:18:00 UTC) #9
eroman
Still LGTM. Note that for our Windows builds this sort of trick sometimes gets defeated ...
8 years, 5 months ago (2012-07-12 18:33:44 UTC) #10
commit-bot: I haz the power
Change committed as 146414
8 years, 5 months ago (2012-07-12 19:33:56 UTC) #11
jar (doing other things)
8 years, 5 months ago (2012-07-12 20:05:37 UTC) #12
The stack (above the segv function) gets you "close," and the number should
clinch uniqueness.

My only minor concern with this game is being sure the number is not "too
large," such that you don't get the SEGV on a reserved page.  His line numbers
are plenty small, so this is not a problem.

If we wanted to be fancy, we'd have some header with a mother-of-all exit codes,
and use that.  We'd then have unique codes across the system, and could even
move to fancier games (if we were afraid we had too many codes), such as
explicitly pushing the code on the stack, and then crashing.

I've found the segv-offset game, plus the stack above it, to be very distinctive
though.  I also like that the offset is in-my-face when I look at a crash dump
(and don't have to dig through stacks with a debugger to get everything right).


On 2012/07/12 18:33:44, eroman wrote:
> Still LGTM.
> 
> Note that for our Windows builds this sort of trick sometimes gets defeated by
> whole program optimization, since the number has to be unique across the
entire
> program. We have had several functions that crashed intentionally by writing
> *((int*)0) = 0;, and the symbol name that would appear in callstack was pretty
> arbitrary. So the author would then go and tweak the address to something more
> random. Meh.

Powered by Google App Engine
This is Rietveld 408576698