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

Issue 62140: Print backtraces on FATAL log messages in debug mode. (Closed)

Created:
11 years, 8 months ago by awong
Modified:
9 years, 7 months ago
CC:
chromium-reviews_googlegroups.com
Visibility:
Public.

Description

Print backtraces on FATAL log messages in debug mode. This provides basic support for looking up backtrace information on GNU libc systems and in Windows. The code is only enabled for FATAL log messages in debug mode. In a release build, it is unlikely that symbols will be available making the backtrace less useful.

Patch Set 1 #

Total comments: 23

Patch Set 2 : Revision 2 for backtrace loging on FATAL logs. Correct style + Windows thread-safety. #

Patch Set 3 : Same as patch-2 but with silly compile error caused by bad header ordering fixed. #

Total comments: 1

Patch Set 4 : Change Mac Unittest since mac symbols doesn't resolve nicely. #

Total comments: 20

Patch Set 5 : Delay load, better lock factoring, respect debugger. #

Total comments: 1

Patch Set 6 : Add dbghelp.dll into chrome.dll.deps #

Patch Set 7 : Remove static from static const. #

Patch Set 8 : Add delay load into common.gypi #

Patch Set 9 : redo after rebase #

Patch Set 10 : Make unittest behave w/o symbols. #

Total comments: 2

Patch Set 11 : Address andrew's comments. #

Total comments: 1

Patch Set 12 : Lower stack frame count in windows. #

Patch Set 13 : Add todo for stackwalk64 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+314 lines, -17 lines) Patch
M base/base.gyp View 1 2 3 4 5 6 7 1 chunk +1 line, -0 lines 0 comments Download
M base/debug_util.h View 1 3 chunks +7 lines, -3 lines 0 comments Download
M base/debug_util_posix.cc View 1 2 3 4 5 6 7 8 9 10 3 chunks +34 lines, -4 lines 0 comments Download
A base/debug_util_unittest.cc View 1 2 3 4 5 6 7 8 9 1 chunk +72 lines, -0 lines 0 comments Download
M base/debug_util_win.cc View 1 2 3 4 5 6 7 8 9 10 11 12 3 chunks +184 lines, -6 lines 0 comments Download
M base/logging.cc View 1 2 3 4 5 3 chunks +9 lines, -2 lines 0 comments Download
M build/common.gypi View 1 2 3 4 5 6 7 8 2 chunks +6 lines, -2 lines 0 comments Download
M chrome/app/chrome.dll.deps View 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 21 (0 generated)
awong
Hey guys, This is draft one of the CL I'm thinking of sending out. The ...
11 years, 8 months ago (2009-04-08 03:39:34 UTC) #1
scherkus (not reviewing)
yeah mostly lint-type stuff looking good though! http://codereview.chromium.org/62140/diff/1/2 File base/base.gyp (right): http://codereview.chromium.org/62140/diff/1/2#newcode529 Line 529: 'debug_util_unittest.cc', ...
11 years, 8 months ago (2009-04-08 18:05:39 UTC) #2
awong
Thanks for the review Andrew! I fixed the lint issues, and then tried to fix ...
11 years, 8 months ago (2009-04-08 21:28:11 UTC) #3
awong
Hi Adam, I thought I'd add the backtrace printing logic into LOG(FATAL) on debug builds ...
11 years, 8 months ago (2009-04-08 22:14:06 UTC) #4
agl
I can't comment on the Windows code, but the Linux code looks good with one ...
11 years, 8 months ago (2009-04-08 22:22:00 UTC) #5
awong
[ +cpu@ ] Thanks Adam, I'll move the -rdynamic flag into the Debug section. will ...
11 years, 8 months ago (2009-04-08 23:05:23 UTC) #6
awong
rdynamic moved. Mac unittest ifdef-ed. Apparently there is no rdynamic equivalent in osX currently. Lame. ...
11 years, 8 months ago (2009-04-09 01:41:11 UTC) #7
cpu_(ooo_6.6-7.5)
http://codereview.chromium.org/62140/diff/33/1022 File base/debug_util_win.cc (right): http://codereview.chromium.org/62140/diff/33/1022#newcode14 Line 14: #pragma comment(lib, "dbghelp.lib") don't forget to make sure ...
11 years, 8 months ago (2009-04-09 21:06:32 UTC) #8
awong
Hi Carlos, I've addressed most of your comments. There are 3 issues I didn't quite ...
11 years, 8 months ago (2009-04-14 04:02:40 UTC) #9
cpu_(ooo_6.6-7.5)
LGTM on my side. Ask maruel@ for advice about the delay load part. I am ...
11 years, 8 months ago (2009-04-14 17:25:35 UTC) #10
awong
[ +maruel ] Could you check over the vsprops changes for essential.vsprops? I'm trying to ...
11 years, 8 months ago (2009-04-14 18:50:12 UTC) #11
M-A Ruel
lgtm Yep, VS is dumb about vsprops. I'd recommend you to check-in the vsprops separately ...
11 years, 8 months ago (2009-04-14 18:59:13 UTC) #12
awong
On 2009/04/14 18:59:13, M-A wrote: > lgtm > > Yep, VS is dumb about vsprops. ...
11 years, 8 months ago (2009-04-14 19:32:44 UTC) #13
M-A Ruel
BTW, you can't check-in this change as-is. You need to update chrome.dll.deps. Do a release ...
11 years, 8 months ago (2009-04-14 20:14:31 UTC) #14
awong
On 2009/04/14 20:14:31, M-A wrote: > BTW, you can't check-in this change as-is. You need ...
11 years, 8 months ago (2009-04-16 02:04:11 UTC) #15
M-A Ruel
On 2009/04/16 02:04:11, awong wrote: > On 2009/04/14 20:14:31, M-A wrote: > > BTW, you ...
11 years, 8 months ago (2009-04-16 10:08:50 UTC) #16
awong
On 2009/04/16 10:08:50, M-A wrote: > On 2009/04/16 02:04:11, awong wrote: > > On 2009/04/14 ...
11 years, 8 months ago (2009-04-17 03:51:34 UTC) #17
M-A Ruel
lgtm, please check-in. Apologies for the delay. We discussed offline about refactoring some code in ...
11 years, 8 months ago (2009-04-18 01:16:32 UTC) #18
awong
One last pass. This time for sure! I added (a) handling of not getting any ...
11 years, 8 months ago (2009-04-22 22:19:34 UTC) #19
scherkus (not reviewing)
LGTM http://codereview.chromium.org/62140/diff/10001/10004 File base/debug_util_posix.cc (right): http://codereview.chromium.org/62140/diff/10001/10004#newcode120 Line 120: // number, but window's but since we ...
11 years, 8 months ago (2009-04-23 22:36:54 UTC) #20
stoyan
11 years, 8 months ago (2009-04-23 23:50:18 UTC) #21
IIRC if you have symbols around, it's better to use StackWalk64() instead of
RtlCaptureStackBackTrace(), since it will consider the FPO.

http://codereview.chromium.org/62140/diff/9030/8016
File base/debug_util_win.cc (right):

http://codereview.chromium.org/62140/diff/9030/8016#newcode258
Line 258: int count = CaptureStackBackTrace(0, kMaxCallers, callers, NULL);
From MSDN: "Windows Server 2003 and Windows XP:  The sum of the FramesToSkip and
FramesToCapture parameters must be less than 64."

In practice it has to be less than 63, otherwise you will always get 0 as result
(at least on XPSP2, don't have win2003 around).

Powered by Google App Engine
This is Rietveld 408576698