Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(73)

Issue 1034002: Don't do work inside assert(). Ever. (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 10 months ago by Mark Mentovai
Modified:
10 years, 10 months ago
Reviewers:
shess, rsesek
CC:
google-breakpad-dev_googlegroups.com
Base URL:
http://google-breakpad.googlecode.com/svn/trunk/
Visibility:
Public.

Description

Don't do work inside assert(). Ever.

The Mac crash key manipulation code was intended to be thread-safe through the
provision of a mutex. The mutex operations were done inside an assert().
assert() is a no-op in NDEBUG (release) builds. Therefore, in release builds,
these operations were occurring without being protected by any mutex at all,
and were nowhere near thread-safe.

BUG=chromium:331268
R=rsesek@chromium.org

Committed: https://code.google.com/p/google-breakpad/source/detail?r=1270

Patch Set 1 #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats Patch
M src/client/ios/Breakpad.mm View 2 chunks +13 lines, -16 lines 0 comments Download
M src/client/mac/Framework/Breakpad.mm View 2 chunks +13 lines, -16 lines 2 comments Download

Messages

Total messages: 6
Mark Mentovai
I looked through all of the other uses of assert() in the rest of Breakpad ...
10 years, 10 months ago #1
rsesek
LGTM. This has bitten me before with DCHECK.
10 years, 10 months ago #2
Mark Mentovai
https://breakpad.appspot.com/1034002/diff/1/src/client/mac/Framework/Breakpad.mm File src/client/mac/Framework/Breakpad.mm (left): https://breakpad.appspot.com/1034002/diff/1/src/client/mac/Framework/Breakpad.mm#oldcode108 src/client/mac/Framework/Breakpad.mm:108: if (allocator_ ) { I got rid of the ...
10 years, 10 months ago #3
rsesek
https://breakpad.appspot.com/1034002/diff/1/src/client/mac/Framework/Breakpad.mm File src/client/mac/Framework/Breakpad.mm (left): https://breakpad.appspot.com/1034002/diff/1/src/client/mac/Framework/Breakpad.mm#oldcode108 src/client/mac/Framework/Breakpad.mm:108: if (allocator_ ) { On 2014/01/10 19:37:46, Mark Mentovai ...
10 years, 10 months ago #4
Mark Mentovai
I guess the original thought was that it would just be a mutex in that ...
10 years, 10 months ago #5
Mark Mentovai
10 years, 10 months ago #6
Message was sent while issue was closed.
Committed patchset #1 manually as r1270 (presubmit successful).
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld 1004:630ec63f810e-tainted