|
|
Created:
4 years, 8 months ago by Wez Modified:
3 years, 6 months ago CC:
chromium-reviews, blink-reviews, blink-reviews-wtf_chromium.org, Mikhail, laforge, dcheng, gab, Primiano Tucci (use gerrit) Base URL:
https://chromium.googlesource.com/chromium/src.git@master Target Ref:
refs/pending/heads/master Project:
chromium Visibility:
Public. |
DescriptionImplement Dump-on-DCHECK (via alternate DCHECK and DCHECK_OP macro implementations).
This patch adds new DCHECK and DCHECK_OP macro implementations which upload a dump without actually crashing, and only
do so on the first DUMP-severity failure. A new DCHECK_IS_DUMP_WITHOUT_CRASHING macro is introduced, to enable the new behaviour in DCHECK_IS_ON()[1] builds.
A new build argument, dump_on_first_dcheck, is set in the GN configuration to enable the DCHECK_IS_DUMP_WITHOUT_CRASHING macro.
All non-DCHECK_IS_ON() behaviours, e.g. CHECK, PCHECK, SECURITY_CHECK, are unchanged and continue to be mapped to the LOG_FATAL severity.
Dump-on-DCHECK will be enabled in one-off Canary builds by temporarily landing this patch, and reverting it as soon as the Canary build has been cut.
BUG=596231
[1] DCHECK_IS_ON() is set in Debug builds, and Release builds with DCHECK_ALWAYS_ON.
Patch Set 1 #
Total comments: 2
Patch Set 2 : Original dump-on-DCHECK #Patch Set 3 : Tweak DCHECK_OP to match CHECK_OP implementation #Patch Set 4 : Reference operator<<(val1/val2) to avoid unused-function errors. #Patch Set 5 : Enable for non-official, to allow tries #Patch Set 6 : Use dump_on_first_dcheck and enable for all platforms for try coverage #Patch Set 7 : Use Check#name#Impl() for DCHECK_OP after all #Patch Set 8 : Enable WTF ASSERTS, and fix DumpWithoutCrashing() call-site #Patch Set 9 : Update for dependent patches #Patch Set 10 : Fix DCHECK_AT for dump-on-DCHECK #Patch Set 11 : Reinstate LOG_DCHECK #Patch Set 12 : Pull the Official Windows build default in, and rebase #Patch Set 13 : Fix NDEBUG conditionals, use DFATAL #Patch Set 14 : Fix DCHECK_AT #Patch Set 15 : Move cleanups to separate CL #Patch Set 16 : Rebase on cleanups #
Depends on Patchset: Messages
Total messages: 101 (80 generated)
Description was changed from ========== Patch to try dump-on-DCHECK. This patch does two things: 1. Adds a flag to switch DCHECK from logging, dumping, and then crashing the process, to only uploading a crash dump, and only on the first failed DCHECK in each process. 2. Forces that flag, and DCHECK_ALWAYS_ON, on in Windows official builds. All non-debug e.g. CHECK behaviours remain unchanged; the intended effect is for DCHECKs to switch from no-ops to uploading dumps without crashing, in Windows official builds. Note that this CL is intended to be landed, a branch cut to release from, and then immediately reverted; it is not intended to be landed in Chromium for any longer period. BUG=596231 ========== to ========== Patch to try dump-on-DCHECK. This patch does two things: 1. Adds a flag to switch DCHECK from logging, dumping, and then crashing the process, to only uploading a crash dump, and only on the first failed DCHECK in each process. The implementation follows the approach taken for CHECK & CHECK_OP in official-branded builds, and strips out any log messages associated with the check. 2. Forces that flag, and DCHECK_ALWAYS_ON, on in Windows official builds. All non-debug e.g. CHECK behaviours remain unchanged; the intended effect is for DCHECKs to switch from no-ops to uploading dumps without crashing, in Windows official builds. Note that this CL is intended to be landed, a branch cut to release from, and then immediately reverted; it is not intended to be landed in Chromium for any longer period. BUG=596231 ==========
wez@chromium.org changed reviewers: + danakj@chromium.org, scottmg@chromium.org, thakis@chromium.org
is this different from the other one? if so, can you upload the original as patch set 1 somewhere and the tweak as patch set 2?
On Wed, Apr 13, 2016 at 7:22 PM, <thakis@chromium.org> wrote: > is this different from the other one? if so, can you upload the original as > patch set 1 somewhere and the tweak as patch set 2? > +1. Or just use the original CL. -- You received this message because you are subscribed to the Google Groups "Blink Reviews" group. To unsubscribe from this group and stop receiving emails from it, send an email to blink-reviews+unsubscribe@chromium.org.
On Wed, Apr 13, 2016 at 7:22 PM, <thakis@chromium.org> wrote: > is this different from the other one? if so, can you upload the original as > patch set 1 somewhere and the tweak as patch set 2? > +1. Or just use the original CL. -- You received this message because you are subscribed to the Google Groups "Chromium-reviews" group. To unsubscribe from this group and stop receiving emails from it, send an email to chromium-reviews+unsubscribe@chromium.org.
nick@chromium.org changed reviewers: + nick@chromium.org
lgtm https://codereview.chromium.org/1884023002/diff/1/base/logging.h File base/logging.h (right): https://codereview.chromium.org/1884023002/diff/1/base/logging.h#newcode717 base/logging.h:717: DCHECK((val1) op (val2)) This looks correct.
I did a quick test on an official build of base_unittests and DCHECK_EQ seems to do the correct thing now afaics, so lgtm.
This is what happens if you start reviewing before I've hit Publish+Mail Comments. ;) Have uploaded the original dump-on-DCHECK and re-uploaded the tweaked version, so the diff is obvious. Note that this version can't land until I've tidied up https://bugs.chromium.org/p/chromium/issues/detail?id=596277 since DCHECK_<op>() doesn't normally trigger tautologous-comparison warnings by the compiler, whereas this version does. This version also fails to reference operator<<(ostream, T) for the DCHECK_<op>'s parameters, which leads to at least one build error; I may simply tag the logging on the end of the DCHECK() in the new impl, so the compiler sees them referenced but will then optimize them out. https://codereview.chromium.org/1884023002/diff/1/base/logging.h File base/logging.h (right): https://codereview.chromium.org/1884023002/diff/1/base/logging.h#newcode717 base/logging.h:717: DCHECK((val1) op (val2)) On 2016/04/14 18:41:34, ncarter wrote: > This looks correct. Unfortunately, though, there is an operator<<(ostream, enum class) in the TouchHandle code that becomes an "unused function" with this version, so I need to fix that first.
To work-around the operator<<() I've added logging of the values in the DCHECK, so that the compiler sees the operator<<() for the logged types being used - my understanding is that EAT_STREAM_PARAMETERS is sufficiently inline/simple that the compiler will optimize that out in the actual build. Scott, does that sound right to you? :P
On 2016/04/15 00:19:43, Wez wrote: > To work-around the operator<<() I've added logging of the values in the DCHECK, > so that the compiler sees the operator<<() for the logged types being used - my > understanding is that EAT_STREAM_PARAMETERS is sufficiently inline/simple that > the compiler will optimize that out in the actual build. Scott, does that sound > right to you? :P Other than failing to compile on all platforms, that seems reasonable. :) I checked Win official, and the << args seems to disappear as expected in normal use, and I don't get unused variable warnings. I did notice if I put e.g. a base::debug::Alias() call in the << chain it'll still get evaluated. I suspect it gets maintained because that function is non-optimized and extern. I doubt this behaviour would cause a problem in practice, but I'm not entirely sure of that.
Thanks for checking, Scott. I'm adding logging of the values, so I suppose it's possible for the operator<< impl for a lot of those to be extern, in which case this could result in a bigger binary? On 15 April 2016 at 09:32, <scottmg@chromium.org> wrote: > On 2016/04/15 00:19:43, Wez wrote: > > To work-around the operator<<() I've added logging of the values in the > DCHECK, > > so that the compiler sees the operator<<() for the logged types being > used - > my > > understanding is that EAT_STREAM_PARAMETERS is sufficiently > inline/simple that > > the compiler will optimize that out in the actual build. Scott, does that > sound > > right to you? :P > > Other than failing to compile on all platforms, that seems reasonable. :) > > I checked Win official, and the << args seems to disappear as expected in > normal > use, and I don't get unused variable warnings. > > I did notice if I put e.g. a base::debug::Alias() call in the << chain > it'll > still get evaluated. I suspect it gets maintained because that function is > non-optimized and extern. I doubt this behaviour would cause a problem in > practice, but I'm not entirely sure of that. > > https://codereview.chromium.org/1884023002/ > -- You received this message because you are subscribed to the Google Groups "Blink Reviews" group. To unsubscribe from this group and stop receiving emails from it, send an email to blink-reviews+unsubscribe@chromium.org.
Thanks for checking, Scott. I'm adding logging of the values, so I suppose it's possible for the operator<< impl for a lot of those to be extern, in which case this could result in a bigger binary? On 15 April 2016 at 09:32, <scottmg@chromium.org> wrote: > On 2016/04/15 00:19:43, Wez wrote: > > To work-around the operator<<() I've added logging of the values in the > DCHECK, > > so that the compiler sees the operator<<() for the logged types being > used - > my > > understanding is that EAT_STREAM_PARAMETERS is sufficiently > inline/simple that > > the compiler will optimize that out in the actual build. Scott, does that > sound > > right to you? :P > > Other than failing to compile on all platforms, that seems reasonable. :) > > I checked Win official, and the << args seems to disappear as expected in > normal > use, and I don't get unused variable warnings. > > I did notice if I put e.g. a base::debug::Alias() call in the << chain > it'll > still get evaluated. I suspect it gets maintained because that function is > non-optimized and extern. I doubt this behaviour would cause a problem in > practice, but I'm not entirely sure of that. > > https://codereview.chromium.org/1884023002/ > -- You received this message because you are subscribed to the Google Groups "Chromium-reviews" group. To unsubscribe from this group and stop receiving emails from it, send an email to chromium-reviews+unsubscribe@chromium.org.
P.S. The try-bot failures are due to tautologous DCHECK_OPs in the QUIC code, which I've made a separate patch for.
On 2016/04/15 23:47:11, Wez wrote: > P.S. The try-bot failures are due to tautologous DCHECK_OPs in the QUIC code, > which I've made a separate patch for. This one looks QUIC related, https://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium... but this one looks different fwiw https://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel... . Dunno.
On 2016/04/15 23:46:19, Wez wrote: > Thanks for checking, Scott. I'm adding logging of the values, so I suppose > it's possible for the operator<< impl for a lot of those to be extern, in > which case this could result in a bigger binary? Yes, possibly larger which seems not-too-big-a-deal for this use. It could cause an unwanted side-effect too, but since the dcheck is failing, presumably it wouldn't do anything too unexpected.
On 2016/04/15 23:50:25, scottmg wrote: > On 2016/04/15 23:47:11, Wez wrote: > > P.S. The try-bot failures are due to tautologous DCHECK_OPs in the QUIC code, > > which I've made a separate patch for. > > This one looks QUIC related, > https://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium... > but this one looks different fwiw > https://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel... > . Dunno. I'll look into the TouchHandleOrientation thing; that's the operator that motivated adding the << logging in the first place...
The CQ bit was checked by wez@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1884023002/100001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1884023002/100001
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: win_chromium_compile_dbg_ng on tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_comp...) win_chromium_x64_rel_ng on tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_x64_...)
The CQ bit was checked by wez@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1884023002/100001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1884023002/100001
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: win_clang on tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_clang/builds/...)
The CQ bit was checked by wez@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: 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_...)
The CQ bit was checked by wez@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: ios-device on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-device/builds...) ios-simulator on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-simulator/bui...)
The CQ bit was checked by wez@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: linux_chromium_asan_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...)
The CQ bit was checked by wez@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: ios-device-xcode-clang on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-device-xcode-...)
The CQ bit was checked by wez@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: ios-simulator on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-simulator/bui...)
The CQ bit was checked by wez@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: ios-simulator on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-simulator/bui...)
The CQ bit was checked by wez@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: ios-device on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-device/builds...) ios-device-xcode-clang on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-device-xcode-...) ios-simulator on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-simulator/bui...) ios-simulator-xcode-clang on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-simulator-xco...)
The CQ bit was checked by wez@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: chromeos_daisy_chromium_compile_only_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromeos_daisy_...)
thakis: This is the alternative dump-on-DCHECK implementation to https://codereview.chromium.org/2288473002/, avoiding the need for a new LogSeverity. The main downside of this implementation is that it won't dump from anything that uses the LOG_DCHECK or LOG_DFATAL severity names (i.e. LOG(DFATAL) will just log an error, not dump). WDYT?
thakis: PTAL
The CQ bit was checked by wez@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: chromeos_daisy_chromium_compile_only_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromeos_daisy_...) ios-device on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-device/builds...)
Description was changed from ========== Patch to try dump-on-DCHECK. This patch does two things: 1. Adds a flag to switch DCHECK from logging, dumping, and then crashing the process, to only uploading a crash dump, and only on the first failed DCHECK in each process. The implementation follows the approach taken for CHECK & CHECK_OP in official-branded builds, and strips out any log messages associated with the check. 2. Forces that flag, and DCHECK_ALWAYS_ON, on in Windows official builds. All non-debug e.g. CHECK behaviours remain unchanged; the intended effect is for DCHECKs to switch from no-ops to uploading dumps without crashing, in Windows official builds. Note that this CL is intended to be landed, a branch cut to release from, and then immediately reverted; it is not intended to be landed in Chromium for any longer period. BUG=596231 ========== to ========== Implement Dump-on-DCHECK (via alternate DCHECK and DCHECK_OP macro implementations). This patch adds new DCHECK and DCHECK_OP macro implementations which upload a dump without actually crashing, and only do so on the first DUMP-severity failure. A new DCHECK_IS_DUMP_WITHOUT_CRASHING macro is introduced, to enable the new behaviour in DCHECK_IS_ON()[1] builds. A new build argument, dump_on_first_dcheck, is set in the GN configuration to enable the DCHECK_IS_DUMP_WITHOUT_CRASHING macro. All non-DCHECK_IS_ON() behaviours, e.g. CHECK, PCHECK, SECURITY_CHECK, are unchanged and continue to be mapped to the LOG_FATAL severity. Dump-on-DCHECK will be enabled in one-off Canary builds by temporarily landing this patch, and reverting it as soon as the Canary build has been cut. BUG=596231 [1] DCHECK_IS_ON() is set in Debug builds, and Release builds with DCHECK_ALWAYS_ON. ==========
The CQ bit was checked by wez@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: 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_androi...)
The CQ bit was checked by wez@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by wez@chromium.org
The CQ bit was checked by wez@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: android_n5x_swarming_rel on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_n5x_...)
The CQ bit was checked by wez@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: 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_androi...)
Patchset #5 (id:80001) has been deleted
Patchset #9 (id:180001) has been deleted
Patchset #12 (id:260001) has been deleted
Patchset #15 (id:340001) has been deleted
Patchset #12 (id:280001) has been deleted
Patchset #12 (id:300001) has been deleted
Patchset #13 (id:360001) has been deleted
The CQ bit was checked by wez@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: linux_chromium_chromeos_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...)
The CQ bit was checked by wez@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
The CQ bit was checked by wez@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was checked by wez@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Folks, I've moved out dependent changes to a separate CL, so this should be the minimal CL we need to land & revert to run the dump-on-DCHECK experiment. thakis: PTAL & let me know if this looks OK to you - thanks.
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run. |