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

Issue 1356483002: Call reset(nullptr) in scoped_ptr's. (Closed)

Created:
5 years, 3 months ago by Anand Mistry (off Chromium)
Modified:
5 years, 1 month ago
Reviewers:
danakj, Peter Kasting
CC:
chromium-reviews, gavinp+memory_chromium.org, chrome-apps-syd-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Call reset(nullptr) in scoped_ptr's destructor. This behaviour is consistent with libc++. The original goal of this change is to make Chrome crash more often and closer to the source when there's a use-after-free bug that accesses a destroyed scoped_ptr. BUG=535321 Committed: https://crrev.com/cf9db6ef148d1493dbf6bdc6693f9c79e3ac2afc Cr-Commit-Position: refs/heads/master@{#357297} Committed: https://crrev.com/7fa14e3f35b1be8476a2ac61cbad7f3e05a22a18 Cr-Commit-Position: refs/heads/master@{#357756}

Patch Set 1 #

Total comments: 5

Patch Set 2 : Set null before detete, and add test. #

Total comments: 4

Patch Set 3 : Rebase and change to reset(). #

Total comments: 5

Patch Set 4 : Comment update #

Patch Set 5 : Rebase #

Patch Set 6 : Rebase #

Patch Set 7 : Rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+22 lines, -6 lines) Patch
M base/memory/scoped_ptr.h View 1 2 1 chunk +11 lines, -5 lines 0 comments Download
M base/memory/scoped_ptr_unittest.cc View 1 2 3 1 chunk +11 lines, -1 line 0 comments Download

Dependent Patchsets:

Messages

Total messages: 48 (11 generated)
Anand Mistry (off Chromium)
This might be a bit contentious, but I'm sending it out anyways. Hopefully, this change ...
5 years, 3 months ago (2015-09-17 04:33:25 UTC) #2
danakj
What does unique_ptr do? We should match that, since we'll be switching to use it ...
5 years, 3 months ago (2015-09-17 17:48:48 UTC) #3
Anand Mistry (off Chromium)
On 2015/09/17 17:48:48, danakj wrote: > What does unique_ptr do? We should match that, since ...
5 years, 3 months ago (2015-09-18 00:12:26 UTC) #4
danakj
https://codereview.chromium.org/1356483002/diff/1/base/memory/scoped_ptr.h File base/memory/scoped_ptr.h (right): https://codereview.chromium.org/1356483002/diff/1/base/memory/scoped_ptr.h#newcode228 base/memory/scoped_ptr.h:228: data_.ptr = nullptr; In libc++ they null the member ...
5 years, 3 months ago (2015-09-21 21:40:52 UTC) #5
danakj
https://codereview.chromium.org/1356483002/diff/1/base/memory/scoped_ptr.h File base/memory/scoped_ptr.h (right): https://codereview.chromium.org/1356483002/diff/1/base/memory/scoped_ptr.h#newcode228 base/memory/scoped_ptr.h:228: data_.ptr = nullptr; On 2015/09/21 21:40:52, danakj wrote: > ...
5 years, 3 months ago (2015-09-21 21:43:08 UTC) #6
Anand Mistry (off Chromium)
https://codereview.chromium.org/1356483002/diff/1/base/memory/scoped_ptr.h File base/memory/scoped_ptr.h (right): https://codereview.chromium.org/1356483002/diff/1/base/memory/scoped_ptr.h#newcode228 base/memory/scoped_ptr.h:228: data_.ptr = nullptr; On 2015/09/21 21:43:08, danakj wrote: > ...
5 years, 3 months ago (2015-09-22 01:13:53 UTC) #7
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1356483002/1 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1356483002/1
5 years, 3 months ago (2015-09-22 01:14:47 UTC) #9
tapted
https://codereview.chromium.org/1356483002/diff/1/base/memory/scoped_ptr.h File base/memory/scoped_ptr.h (right): https://codereview.chromium.org/1356483002/diff/1/base/memory/scoped_ptr.h#newcode228 base/memory/scoped_ptr.h:228: data_.ptr = nullptr; On 2015/09/22 01:13:53, Anand Mistry wrote: ...
5 years, 3 months ago (2015-09-22 02:53:10 UTC) #10
Anand Mistry (off Chromium)
https://codereview.chromium.org/1356483002/diff/1/base/memory/scoped_ptr.h File base/memory/scoped_ptr.h (right): https://codereview.chromium.org/1356483002/diff/1/base/memory/scoped_ptr.h#newcode228 base/memory/scoped_ptr.h:228: data_.ptr = nullptr; On 2015/09/22 02:53:09, tapted wrote: > ...
5 years, 3 months ago (2015-09-22 03:14:15 UTC) #11
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: win8_chromium_ng on tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win8_chromium_ng/builds/43669)
5 years, 3 months ago (2015-09-22 04:02:08 UTC) #13
danakj
On 2015/09/22 02:53:10, tapted wrote: > https://codereview.chromium.org/1356483002/diff/1/base/memory/scoped_ptr.h > File base/memory/scoped_ptr.h (right): > > https://codereview.chromium.org/1356483002/diff/1/base/memory/scoped_ptr.h#newcode228 > ...
5 years, 3 months ago (2015-09-22 18:01:31 UTC) #14
danakj
On 2015/09/22 18:01:31, danakj wrote: > On 2015/09/22 02:53:10, tapted wrote: > > https://codereview.chromium.org/1356483002/diff/1/base/memory/scoped_ptr.h > ...
5 years, 3 months ago (2015-09-22 18:02:34 UTC) #15
Anand Mistry (off Chromium)
PTAL.
5 years, 3 months ago (2015-09-23 01:10:15 UTC) #16
Peter Kasting
https://codereview.chromium.org/1356483002/diff/20001/base/memory/scoped_ptr.h File base/memory/scoped_ptr.h (right): https://codereview.chromium.org/1356483002/diff/20001/base/memory/scoped_ptr.h#newcode227 base/memory/scoped_ptr.h:227: // references |this| after running the deleter. It looks ...
5 years, 3 months ago (2015-09-23 01:14:39 UTC) #18
Anand Mistry (off Chromium)
https://codereview.chromium.org/1356483002/diff/20001/base/memory/scoped_ptr.h File base/memory/scoped_ptr.h (right): https://codereview.chromium.org/1356483002/diff/20001/base/memory/scoped_ptr.h#newcode227 base/memory/scoped_ptr.h:227: // references |this| after running the deleter. On 2015/09/23 ...
5 years, 3 months ago (2015-09-23 01:44:52 UTC) #19
Peter Kasting
https://codereview.chromium.org/1356483002/diff/20001/base/memory/scoped_ptr.h File base/memory/scoped_ptr.h (right): https://codereview.chromium.org/1356483002/diff/20001/base/memory/scoped_ptr.h#newcode227 base/memory/scoped_ptr.h:227: // references |this| after running the deleter. On 2015/09/23 ...
5 years, 3 months ago (2015-09-23 01:52:58 UTC) #20
Anand Mistry (off Chromium)
I've rebased onto https://codereview.chromium.org/1358373002/ and changed the destructor to just call reset(), like libc++. https://codereview.chromium.org/1356483002/diff/20001/base/memory/scoped_ptr.h ...
5 years, 3 months ago (2015-09-23 04:48:04 UTC) #21
danakj
LGTM
5 years, 3 months ago (2015-09-23 18:53:39 UTC) #22
Peter Kasting
LGTM https://codereview.chromium.org/1356483002/diff/40001/base/memory/scoped_ptr_unittest.cc File base/memory/scoped_ptr_unittest.cc (right): https://codereview.chromium.org/1356483002/diff/40001/base/memory/scoped_ptr_unittest.cc#newcode721 base/memory/scoped_ptr_unittest.cc:721: // into the destructors of |a| and |a.b|. ...
5 years, 3 months ago (2015-09-23 20:35:49 UTC) #23
danakj
https://codereview.chromium.org/1356483002/diff/40001/base/memory/scoped_ptr_unittest.cc File base/memory/scoped_ptr_unittest.cc (right): https://codereview.chromium.org/1356483002/diff/40001/base/memory/scoped_ptr_unittest.cc#newcode723 base/memory/scoped_ptr_unittest.cc:723: // destructor. On 2015/09/23 20:35:49, Peter Kasting wrote: > ...
5 years, 3 months ago (2015-09-23 20:38:10 UTC) #24
danakj
Can you point this at BUG=535321 ?
5 years, 3 months ago (2015-09-23 22:07:40 UTC) #25
Anand Mistry (off Chromium)
https://codereview.chromium.org/1356483002/diff/40001/base/memory/scoped_ptr_unittest.cc File base/memory/scoped_ptr_unittest.cc (right): https://codereview.chromium.org/1356483002/diff/40001/base/memory/scoped_ptr_unittest.cc#newcode721 base/memory/scoped_ptr_unittest.cc:721: // into the destructors of |a| and |a.b|. Note, ...
5 years, 3 months ago (2015-09-23 23:06:34 UTC) #26
Peter Kasting
On 2015/09/23 23:06:34, Anand Mistry wrote: > https://codereview.chromium.org/1356483002/diff/40001/base/memory/scoped_ptr_unittest.cc > File base/memory/scoped_ptr_unittest.cc (right): > > https://codereview.chromium.org/1356483002/diff/40001/base/memory/scoped_ptr_unittest.cc#newcode721 ...
5 years, 3 months ago (2015-09-23 23:08:49 UTC) #27
danakj
On Wed, Sep 23, 2015 at 4:08 PM, <pkasting@chromium.org> wrote: > On 2015/09/23 23:06:34, Anand ...
5 years, 3 months ago (2015-09-23 23:11:04 UTC) #28
Anand Mistry (off Chromium)
On 2015/09/23 23:11:04, danakj wrote: > On Wed, Sep 23, 2015 at 4:08 PM, <mailto:pkasting@chromium.org> ...
5 years, 3 months ago (2015-09-24 01:22:29 UTC) #29
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1356483002/80001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1356483002/80001
5 years, 3 months ago (2015-09-24 02:41:43 UTC) #32
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_chromeos_ozone_rel_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_chromeos_ozone_rel_ng/builds/66740)
5 years, 3 months ago (2015-09-24 03:44:19 UTC) #34
Anand Mistry (off Chromium)
On 2015/09/24 03:44:19, commit-bot: I haz the power wrote: > Try jobs failed on following ...
5 years, 3 months ago (2015-09-24 08:08:55 UTC) #35
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1356483002/120001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1356483002/120001
5 years, 1 month ago (2015-11-01 23:03:59 UTC) #38
commit-bot: I haz the power
Committed patchset #7 (id:120001)
5 years, 1 month ago (2015-11-02 02:13:15 UTC) #39
commit-bot: I haz the power
Patchset 7 (id:??) landed as https://crrev.com/cf9db6ef148d1493dbf6bdc6693f9c79e3ac2afc Cr-Commit-Position: refs/heads/master@{#357297}
5 years, 1 month ago (2015-11-02 02:13:53 UTC) #40
perkj_chrome
A revert of this CL (patchset #7 id:120001) has been created in https://codereview.chromium.org/1417063006/ by perkj@chromium.org. ...
5 years, 1 month ago (2015-11-02 11:50:04 UTC) #41
Anand Mistry (off Chromium)
FYI, as requested, re-opening and re-landing this CL.
5 years, 1 month ago (2015-11-04 00:10:49 UTC) #43
danakj
On 2015/11/04 00:10:49, Anand Mistry wrote: > FYI, as requested, re-opening and re-landing this CL. ...
5 years, 1 month ago (2015-11-04 00:22:25 UTC) #44
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1356483002/120001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1356483002/120001
5 years, 1 month ago (2015-11-04 02:29:31 UTC) #46
commit-bot: I haz the power
Committed patchset #7 (id:120001)
5 years, 1 month ago (2015-11-04 04:35:53 UTC) #47
commit-bot: I haz the power
5 years, 1 month ago (2015-11-04 04:36:42 UTC) #48
Message was sent while issue was closed.
Patchset 7 (id:??) landed as
https://crrev.com/7fa14e3f35b1be8476a2ac61cbad7f3e05a22a18
Cr-Commit-Position: refs/heads/master@{#357756}

Powered by Google App Engine
This is Rietveld 408576698