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

Issue 306753003: Add some function and URLs to induce ASan crashes. (Closed)

Created:
6 years, 6 months ago by Sébastien Marchand
Modified:
6 years, 6 months ago
CC:
chromium-reviews, nasko+codewatch_chromium.org, darin-cc_chromium.org, erikwright+watch_chromium.org, jam, creis+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Visibility:
Public.

Description

Add some function to induce ASan crashes. This will allows to induce ASan crashes in the browser and in the renderer processes, this is really useful when trying to debug an ASan crash (to make sure that the build is really instrumented). This code add the following crash urls to chrome: chrome://crash/browser-heap-overflow chrome://crash/browser-heap-underflow chrome://crash/browser-use-after-free chrome://crash/browser-corrupt-heap-block chrome://crash/browser-corrupt-heap Those URLs induce a crash in the browser process, while those: chrome://crash/heap-overflow chrome://crash/heap-underflow chrome://crash/use-after-free chrome://crash/corrupt-heap-block chrome://crash/corrupt-heap induce a crash in the renderer process. We need this because as these process use a different DLL (chrome.dll vs chrome_child.dll) one of them could be ASan-instrumented while the other one isn't... So the current code in renderer/ is useless for the browser-only instrumented builds... BUG= Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=277201

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : #

Patch Set 4 : Fix the test on Linux. #

Patch Set 5 : Move the tests to tools_sanity_unittests. #

Patch Set 6 : Use the new Asan debug functions in the crash urls. #

Total comments: 14

Patch Set 7 : Address Timur's comments. #

Patch Set 8 : Fix a compilation bug. #

Total comments: 6

Patch Set 9 : Address Timur and nasko's comments. #

Total comments: 4

Patch Set 10 : Address Nico's comments. #

Patch Set 11 : Add a check to ensure that the URL scheme is 'chrome://' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+263 lines, -39 lines) Patch
M base/base.gypi View 1 2 3 4 5 6 7 8 9 1 chunk +2 lines, -0 lines 0 comments Download
A base/debug/asan_invalid_access.h View 1 2 3 4 5 6 7 8 1 chunk +46 lines, -0 lines 0 comments Download
A base/debug/asan_invalid_access.cc View 1 2 3 4 5 6 7 8 1 chunk +94 lines, -0 lines 0 comments Download
M base/tools_sanity_unittest.cc View 1 2 3 4 5 6 7 8 4 chunks +36 lines, -2 lines 0 comments Download
M content/browser/frame_host/debug_urls.cc View 1 2 3 4 5 6 7 8 9 10 5 chunks +71 lines, -1 line 0 comments Download
M content/renderer/render_frame_impl.cc View 1 2 3 4 5 6 7 8 9 3 chunks +14 lines, -36 lines 0 comments Download

Messages

Total messages: 34 (0 generated)
Sébastien Marchand
Hey Reid, any idea why the code in base/memory/asan_invalid_access.cc doesn't trigger an ASan error on ...
6 years, 6 months ago (2014-05-28 22:56:04 UTC) #1
Reid Kleckner
+timur My theory is that ASan disables its checks after fork. What happens if you ...
6 years, 6 months ago (2014-05-29 00:34:41 UTC) #2
Timur Iskhodzhanov
glider@ is likely to know
6 years, 6 months ago (2014-05-29 10:23:21 UTC) #3
Alexander Potapenko
On 2014/05/29 00:34:41, Reid Kleckner wrote: > +timur > > My theory is that ASan ...
6 years, 6 months ago (2014-05-29 12:14:22 UTC) #4
Alexander Potapenko
On 2014/05/29 12:14:22, Alexander Potapenko wrote: > On 2014/05/29 00:34:41, Reid Kleckner wrote: > > ...
6 years, 6 months ago (2014-05-29 12:16:49 UTC) #5
Alexander Potapenko
On 2014/05/29 12:16:49, Alexander Potapenko wrote: > On 2014/05/29 12:14:22, Alexander Potapenko wrote: > > ...
6 years, 6 months ago (2014-05-29 12:24:58 UTC) #6
Sébastien Marchand
So it turns out that the base::Alias(...) wasn't enough on Linux to prevent the variable ...
6 years, 6 months ago (2014-05-29 19:30:19 UTC) #7
Sébastien Marchand
Can one of you take care of reviewing the changes in tools_sanity_unittest ? And maybe ...
6 years, 6 months ago (2014-06-04 20:44:39 UTC) #8
Timur Iskhodzhanov
See the comments for the base/ part. https://codereview.chromium.org/306753003/diff/150001/base/debug/asan_invalid_access.cc File base/debug/asan_invalid_access.cc (right): https://codereview.chromium.org/306753003/diff/150001/base/debug/asan_invalid_access.cc#newcode19 base/debug/asan_invalid_access.cc:19: // when ...
6 years, 6 months ago (2014-06-05 15:32:08 UTC) #9
Timur Iskhodzhanov
https://codereview.chromium.org/306753003/diff/150001/base/debug/asan_invalid_access.cc File base/debug/asan_invalid_access.cc (right): https://codereview.chromium.org/306753003/diff/150001/base/debug/asan_invalid_access.cc#newcode46 base/debug/asan_invalid_access.cc:46: // order to trigger an Address Sanitizer (ASAN) error ...
6 years, 6 months ago (2014-06-05 15:32:58 UTC) #10
Sébastien Marchand
Thanks for the review Timur, PTanL. (I'm looking for other reviewers for the other files). ...
6 years, 6 months ago (2014-06-05 19:44:34 UTC) #11
Sébastien Marchand
+nasko@ for content/browser/frame_host/debug_urls.cc +jamesr@ for content/renderer/render_frame_impl.cc +thakis@ for owner approval for the files in base/ ...
6 years, 6 months ago (2014-06-05 19:54:45 UTC) #12
Sébastien Marchand
+thakis@ for real this time.
6 years, 6 months ago (2014-06-05 19:55:13 UTC) #13
jamesr
lgtm
6 years, 6 months ago (2014-06-05 20:01:35 UTC) #14
Timur Iskhodzhanov
https://codereview.chromium.org/306753003/diff/150001/base/tools_sanity_unittest.cc File base/tools_sanity_unittest.cc (right): https://codereview.chromium.org/306753003/diff/150001/base/tools_sanity_unittest.cc#newcode207 base/tools_sanity_unittest.cc:207: HARMFUL_ACCESS(AsanHeapOverflow(), "AsanRuntime::OnError") :( Maybe we can handle only that ...
6 years, 6 months ago (2014-06-06 11:36:56 UTC) #15
nasko
lgtm https://codereview.chromium.org/306753003/diff/230001/base/debug/asan_invalid_access.h File base/debug/asan_invalid_access.h (right): https://codereview.chromium.org/306753003/diff/230001/base/debug/asan_invalid_access.h#newcode1 base/debug/asan_invalid_access.h:1: // Copyright (c) 2014 The Chromium Authors. All ...
6 years, 6 months ago (2014-06-06 17:08:46 UTC) #16
Sébastien Marchand
Thanks. Timur, PTAnL. https://codereview.chromium.org/306753003/diff/150001/base/tools_sanity_unittest.cc File base/tools_sanity_unittest.cc (right): https://codereview.chromium.org/306753003/diff/150001/base/tools_sanity_unittest.cc#newcode207 base/tools_sanity_unittest.cc:207: HARMFUL_ACCESS(AsanHeapOverflow(), "AsanRuntime::OnError") On 2014/06/06 11:36:56, Timur ...
6 years, 6 months ago (2014-06-09 14:47:39 UTC) #17
Timur Iskhodzhanov
base/ part LGTM, but I'm not an OWNER.
6 years, 6 months ago (2014-06-09 16:08:22 UTC) #18
Sébastien Marchand
+brettw@ for base/ lgtm.
6 years, 6 months ago (2014-06-09 20:05:30 UTC) #19
Nico
Does this need to be in base? It looks like there's only one client, could ...
6 years, 6 months ago (2014-06-12 18:13:18 UTC) #20
Sébastien Marchand
Well this code is called from content/{browser|renderer} and from base/tools_sanity_unittest.cc . If you prefer I ...
6 years, 6 months ago (2014-06-12 18:20:47 UTC) #21
Nico
After looking at the rest of the CL, I'm pretty confused by it. It looks ...
6 years, 6 months ago (2014-06-12 18:36:56 UTC) #22
Sébastien Marchand
This code add the following crash urls to chrome: chrome://crash/browser-heap-overflow chrome://crash/browser-heap-underflow chrome://crash/browser-use-after-free chrome://crash/browser-corrupt-heap-block chrome://crash/browser-corrupt-heap Those ...
6 years, 6 months ago (2014-06-12 19:54:13 UTC) #23
Nico
The new CL description is much easier for me to understand, thanks! Sorry, I can't ...
6 years, 6 months ago (2014-06-12 21:10:44 UTC) #24
Sébastien Marchand
Here's the one in the renderer: https://code.google.com/p/chromium/codesearch#chromium/src/content/renderer/render_frame_impl.cc&l=305 As for the URLs in the browser I've ...
6 years, 6 months ago (2014-06-12 22:05:41 UTC) #25
Nico
lgtm
6 years, 6 months ago (2014-06-13 18:35:48 UTC) #26
Sébastien Marchand
The CQ bit was checked by sebmarchand@chromium.org
6 years, 6 months ago (2014-06-13 18:36:38 UTC) #27
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/sebmarchand@chromium.org/306753003/310001
6 years, 6 months ago (2014-06-13 18:38:08 UTC) #28
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). The failing builders are: android_dbg_triggered_tests on tryserver.chromium ...
6 years, 6 months ago (2014-06-13 22:48:37 UTC) #29
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 6 months ago (2014-06-13 22:51:06 UTC) #30
commit-bot: I haz the power
Try jobs failed on following builders: mac_chromium_rel on tryserver.chromium (http://build.chromium.org/p/tryserver.chromium/builders/mac_chromium_rel/builds/39168)
6 years, 6 months ago (2014-06-13 22:51:08 UTC) #31
Sébastien Marchand
The CQ bit was checked by sebmarchand@chromium.org
6 years, 6 months ago (2014-06-14 03:51:11 UTC) #32
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/sebmarchand@chromium.org/306753003/310001
6 years, 6 months ago (2014-06-14 03:53:33 UTC) #33
commit-bot: I haz the power
6 years, 6 months ago (2014-06-14 08:29:47 UTC) #34
Message was sent while issue was closed.
Change committed as 277201

Powered by Google App Engine
This is Rietveld 408576698