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

Issue 2213933003: Change EXPECT/ASSERT_DCHECK_DEATH macro to not expose the |regex| parameter. (Closed)

Created:
4 years, 4 months ago by gab
Modified:
4 years, 4 months ago
Reviewers:
Lei Zhang, jam
CC:
chromium-reviews, sadrul, robliao+watch_chromium.org, gavinp+memory_chromium.org, fdoray+watch_chromium.org, asvitkine+watch_chromium.org, gab+watch_chromium.org, fdoray, robliao
Base URL:
https://chromium.googlesource.com/chromium/src.git@b2b0_simplethreadJoinable
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Change EXPECT/ASSERT_DCHECK_DEATH macro to not expose the |regex| parameter. Most users of the macro were ignoring the regex, now it makes sure a DCHECK caused the death (message contains "Check failed") without adding burden on callers to encode the exact error message. This catched an error in SchedulerLock which was generating an exception in std::unordered_map::at() instead of hitting the DCHECK it was intending to hit. Fixed in precursor CL @ https://codereview.chromium.org/2218443002/. Also caught http://crbug.com/634552, disabled TaskSchedulerTaskTrackerTest.SingletonAllowed's death test on OS_LINUX for now because of it. Also updated thread_restrictions.cc to use NOTREACHED() instead of LOG(FATAL) in order for it to generate a DCHECK failure (it's only defined when DCHECK_IS_ON() so it makes sense to align it with that). BUG=553459, 634552 Committed: https://crrev.com/5e69cff93950ddd3959f995dcffff2069ff097c0 Cr-Commit-Position: refs/heads/master@{#409980}

Patch Set 1 #

Patch Set 2 : Fix SchedulerLock unittests to actually generate a DCHECK, not an exception #

Total comments: 2

Patch Set 3 : rebase on https://codereview.chromium.org/2218443002/ #

Patch Set 4 : merge up to r409903 #

Patch Set 5 : Disabling a death test which crashed instead of DCHECKing : http://crbug.com/634552 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+58 lines, -65 lines) Patch
M base/bind_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
M base/memory/weak_ptr_unittest.cc View 5 chunks +5 lines, -5 lines 0 comments Download
M base/message_loop/message_pump_io_ios_unittest.cc View 1 chunk +1 line, -3 lines 0 comments Download
M base/message_loop/message_pump_libevent_unittest.cc View 1 chunk +2 lines, -6 lines 0 comments Download
M base/metrics/field_trial_unittest.cc View 1 chunk +1 line, -2 lines 0 comments Download
M base/metrics/histogram_unittest.cc View 1 chunk +2 lines, -4 lines 0 comments Download
M base/metrics/persistent_sample_map_unittest.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M base/metrics/sample_map_unittest.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M base/metrics/sample_vector_unittest.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M base/numerics/safe_numerics_unittest.cc View 1 chunk +1 line, -2 lines 0 comments Download
M base/synchronization/atomic_flag_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
M base/task_scheduler/priority_queue_unittest.cc View 1 chunk +1 line, -2 lines 0 comments Download
M base/task_scheduler/scheduler_lock_unittest.cc View 6 chunks +6 lines, -6 lines 0 comments Download
M base/task_scheduler/scheduler_worker_pool_impl_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
M base/task_scheduler/scheduler_worker_stack_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
M base/task_scheduler/task_tracker_unittest.cc View 1 2 3 4 2 chunks +4 lines, -3 lines 0 comments Download
M base/test/gtest_util.h View 2 chunks +10 lines, -6 lines 0 comments Download
M base/threading/non_thread_safe_unittest.cc View 2 chunks +2 lines, -3 lines 0 comments Download
M base/threading/simple_thread_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
M base/threading/thread_restrictions.cc View 3 chunks +11 lines, -11 lines 0 comments Download
M base/threading/thread_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download

Dependent Patchsets:

Messages

Total messages: 47 (27 generated)
gab
Rob PTAL at base/task_scheduler/scheduler_lock_impl.cc (don't bother with the rest of the CL, I'll send to ...
4 years, 4 months ago (2016-08-04 15:57:33 UTC) #4
robliao
https://codereview.chromium.org/2213933003/diff/20001/base/task_scheduler/scheduler_lock_impl.cc File base/task_scheduler/scheduler_lock_impl.cc (right): https://codereview.chromium.org/2213933003/diff/20001/base/task_scheduler/scheduler_lock_impl.cc#newcode76 base/task_scheduler/scheduler_lock_impl.cc:76: // This asserts that lock's registered predecessor is safe. ...
4 years, 4 months ago (2016-08-04 17:25:20 UTC) #9
gab
Lei PTAL, I added these new death tests for DCHECKs recently and am realizing that ...
4 years, 4 months ago (2016-08-04 17:43:05 UTC) #12
gab
On 2016/08/04 17:43:05, gab wrote: > Lei PTAL, I added these new death tests for ...
4 years, 4 months ago (2016-08-04 17:44:14 UTC) #13
gab
+jam for thread_restrictions.cc per base\threading\OWNERS mentioning specific ownership of those files by you (see CL ...
4 years, 4 months ago (2016-08-04 17:48:19 UTC) #16
Lei Zhang
lgtm
4 years, 4 months ago (2016-08-04 19:17:33 UTC) #17
gab
On 2016/08/04 17:48:19, gab wrote: > +jam for thread_restrictions.cc per base\threading\OWNERS mentioning specific > ownership ...
4 years, 4 months ago (2016-08-04 21:17:24 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2213933003/40001
4 years, 4 months ago (2016-08-04 21:18:03 UTC) #21
Lei Zhang
On 2016/08/04 21:17:24, gab wrote: > jam says he only cares about things that add ...
4 years, 4 months ago (2016-08-04 21:18:03 UTC) #22
commit-bot: I haz the power
Try jobs failed on following builders: mac_chromium_compile_dbg_ng on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_compile_dbg_ng/builds/245805)
4 years, 4 months ago (2016-08-04 21:20:59 UTC) #24
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2213933003/60001
4 years, 4 months ago (2016-08-04 21:32:27 UTC) #27
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_chromeos_ozone_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_chromeos_ozone_rel_ng/builds/212940)
4 years, 4 months ago (2016-08-04 21:54:54 UTC) #29
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2213933003/100001
4 years, 4 months ago (2016-08-05 00:13:57 UTC) #34
gab
FYI, had to disable TaskSchedulerTaskTrackerTest.SingletonAllowed's death test on OS_LINUX as well because this CL caught ...
4 years, 4 months ago (2016-08-05 00:14:41 UTC) #35
commit-bot: I haz the power
Try jobs failed on following builders: linux_android_rel_ng on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/linux_android_rel_ng/builds/116658)
4 years, 4 months ago (2016-08-05 01:28:36 UTC) #37
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2213933003/100001
4 years, 4 months ago (2016-08-05 01:29:16 UTC) #39
commit-bot: I haz the power
Try jobs failed on following builders: linux_android_rel_ng on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/linux_android_rel_ng/builds/116678)
4 years, 4 months ago (2016-08-05 02:29:50 UTC) #41
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2213933003/100001
4 years, 4 months ago (2016-08-05 02:56:08 UTC) #43
commit-bot: I haz the power
Committed patchset #5 (id:100001)
4 years, 4 months ago (2016-08-05 03:26:37 UTC) #45
commit-bot: I haz the power
4 years, 4 months ago (2016-08-05 03:30:21 UTC) #47
Message was sent while issue was closed.
Patchset 5 (id:??) landed as
https://crrev.com/5e69cff93950ddd3959f995dcffff2069ff097c0
Cr-Commit-Position: refs/heads/master@{#409980}

Powered by Google App Engine
This is Rietveld 408576698