[main] Multiple dangling raw_ptrs in browser tests.

254 views
Skip to first unread message

Dmitry Grebenyuk

unread,
Feb 11, 2024, 6:42:43 PMFeb 11
to Chromium-dev
Hi,

I added
"enable_backup_ref_ptr_feature_flag": true,
"enable_dangling_raw_ptr_checks": true,
"enable_dangling_raw_ptr_feature_flag": true,
 to my local build and tried to run on main
`browser_tests --gtest_filter="*AppListSortLoginTest*".`

I got multiple dangling pointer errors in browser tests touching the `SearchController`.
http://gpaste/5929056925646848. The search controller runs on the UI thread and it is a bit of a mess there. It uses multiple search providers that depend on multiple ProfileKeyedServices.

I also tried to combine all the providers under a new ProfileKeyedServices and use DependsOn() https://crrev.com/c/5260258 but I still have the same errors.

1. How did these errors pass the CQ? Is it a new thing?
2. Is it the browser test or the search controller implementation bug?
3. What is the proper fix in this situation?

Kind regards,
Dmitry

Arthur Sonzogni

unread,
Feb 12, 2024, 5:09:46 AMFeb 12
to dgreb...@google.com, Chromium-dev
Hi Dmitry,

You will find more information, a guide, and the list of patches fixing dangling pointers:
We are preventing developers introducing new dangling pointers, but as you figured out, this is only as good as we are enforcing it against the CQ.
The current state is:

Bots:

Linux: 
Enabled by default for developers
To be precise: is_linux && !is_official_build && (is_debug || dcheck_always_on)

Other projects:
On top of Chrome, we are also supporting pdfium and Dawn (WebGPU) recently.

Future plans:
I guess you are running one of the non supported configurations? Among other things, I am going to enable it further during H1 2024, with the following (OKR @google):

KR6: DanglingPointerDetector: more activation

By knowing and eliminating dangling pointers, we make it easier to maintain our codebase and reduce debt in a visible way. Complexity around lifetime is what leads to mistakes that end up as stability issues, and sometimes security vulnerabilities.

This is currently enforced on the CQ @google  by specific bots config on Linux, Windows, Android, ChromeOS, and Mac. Linux developers also have the configuration enabled by default. Every kind of test is supported, except on Android.

Goal: 

      1. Enable every kind of test on Android.
      2. Enable by default for developers on Windows, Mac (stretch), ChromeOS (stretch), Android (stretch)
      3. Remove specific bots config.

Arthur @arthursonzogni


--
--
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 on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/fe6a98d2-47e2-4756-b981-3f778206be06n%40chromium.org.
Reply all
Reply to author
Forward
0 new messages