PSA: LSC to replace DCHECK with CHECK

467 views
Skip to first unread message

Yuki Shiino

unread,
Aug 20, 2026, 10:29:03 PMAug 20
to Chromium-dev, nus...@chromium.org

Hi chromium-dev,


TL;DR: We are initiating a large-scale mechanical conversion from DCHECKs to CHECKs in primarily browser focused code directories. This is to improve Chrome's memory safety in production focused mainly on browser process side CHECKs (~26,000 DCHECKs).


Background & Motivation:

Multiple long-standing, high-severity vulnerabilities have recently been uncovered by an LLM-based tool (project fortify), and we found that some of them could have been mitigated if the invariant conditions of DCHECKs had been enforced in production. The hope is by hardening others more widely we can prevent discovering more in future.


This has been reviewed by the technical steering council, as well as other stakeholders, and approved for LSC and will start in M154.


Here is an explainer doc.


The target directories are:

//chrome/browser/

//chromecast/media/

//components/cast_streaming/

//content/browser/

//media/mojo/services/

//ui/


Action requested:

- No action requested.

- If and only if you have a concern about the conversion, you can opt-out of the mechanical conversion by adding the CHECK-exclusion: comment to each DCHECK (a TODO comment is not mandatory, it's optional).


Cheers,

Yuki Shiino


Adam Rice

unread,
Sep 4, 2026, 4:27:31 AMSep 4
to yukis...@chromium.org, Chromium-dev, nus...@chromium.org
What can OWNERS do if they want to apply this change to other directories?

--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev...@chromium.org.
To view this discussion visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/CAN0uC_R6i0T%2BmCWPY5jqYBNVOqeV_iWLAHGQHCbSER9ao413ig%40mail.gmail.com.

Yuki Shiino

unread,
Sep 4, 2026, 4:50:37 AMSep 4
to Adam Rice, yukis...@chromium.org, Chromium-dev, nus...@chromium.org
Here is a Python script that mechanically rewrites DCHECKs to CHECKs with adding base::NotFatalUntil::Mxxx and excluding the DCHECKs annotated with the "CHECK-exclusion:" comment. You can run this script for your selected directories, but you should update the _EXCLUDED_FILES variable before running it.

http://go/crashing-dchecks (Google internal) is a script that lists up the files containing the functions crashing with DCHECKs. Googlers can copy and modify and run it. Then, you can copy&paste the resulting file list into the _EXCLUDED_FILES variable in the above script, so that we won't rewrite the DCHECKs known to crash.

Cheers,
Yuki Shiino


2026年9月4日(金) 17:21 Adam Rice <ri...@chromium.org>:

Stephen Nusko

unread,
Sep 24, 2026, 5:05:06 AMSep 24
to Yuki Shiino, Adam Rice, Chromium-dev, nus...@chromium.org
Oh one additional note: If you intend to do this and want the automated crash detection to file bugs for reverts with the same policy. You need to tag your CLs in gerrit (either through CL description or manually) as "dcheck-to-check", as the crash infra only follows our revert policy if it tracks the offending CL back to a tagged CL.

image.png
Reply all
Reply to author
Forward
0 new messages