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

Issue 1788473002: Used non-sized delete for dynamically sized memory. (Closed)

Created:
4 years, 9 months ago by ivanpe
Modified:
4 years, 9 months ago
Reviewers:
Mark Mentovai, mmandlis
CC:
google-breakpad-dev_googlegroups.com
Base URL:
https://chromium.googlesource.com/breakpad/breakpad.git@master
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Explicitly call non-sized delete on dynamically sized memory for correct behavior under sized-delete. The code as it stands allocates a chunk of memory of arbitrary size and places an object into it. It stores a pointer to that object and memory into a list telling the compiler that it is a pointer to a char. When the compiler deletes the objects in the list it thinks that the list contains pointers to chars - not pointers to arbitrarily sized regions of memory. This is fixing an issue that will reproduces when the following optimization (C++ sized dealocation) is enabled: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3536.html The fix is to explicitly call the non-sized delete operator, and the library code that supports malloc/free/new/delete will figure out the size of the block of memory from the pointer being passed in. Patch provided by Darryl Gove. R=mark@chromium.org Committed: https://chromium.googlesource.com/breakpad/breakpad/+/ebba1800e4bb5ffad3533e6bf01978b578eea91a

Patch Set 1 #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+1 line, -1 line) Patch
M src/processor/static_map_unittest.cc View 1 chunk +1 line, -1 line 2 comments Download

Messages

Total messages: 13 (6 generated)
ivanpe
4 years, 9 months ago (2016-03-11 01:39:53 UTC) #3
ivanpe
4 years, 9 months ago (2016-03-11 02:41:00 UTC) #5
Mark Mentovai
LGTM otherwise https://codereview.chromium.org/1788473002/diff/1/src/processor/static_map_unittest.cc File src/processor/static_map_unittest.cc (right): https://codereview.chromium.org/1788473002/diff/1/src/processor/static_map_unittest.cc#newcode183 src/processor/static_map_unittest.cc:183: ::operator delete(map_data[i]); The use of operator new ...
4 years, 9 months ago (2016-03-11 04:34:23 UTC) #6
Mark Mentovai
Please revise the CL description. The original wasn’t sized either.
4 years, 9 months ago (2016-03-11 04:36:24 UTC) #7
ivanpe
On 2016/03/11 04:36:24, Mark Mentovai wrote: > Please revise the CL description. The original wasn’t ...
4 years, 9 months ago (2016-03-11 23:49:25 UTC) #9
ivanpe
https://codereview.chromium.org/1788473002/diff/1/src/processor/static_map_unittest.cc File src/processor/static_map_unittest.cc (right): https://codereview.chromium.org/1788473002/diff/1/src/processor/static_map_unittest.cc#newcode183 src/processor/static_map_unittest.cc:183: ::operator delete(map_data[i]); On 2016/03/11 04:34:23, Mark Mentovai wrote: > ...
4 years, 9 months ago (2016-03-12 00:30:04 UTC) #11
ivanpe
4 years, 9 months ago (2016-03-12 00:37:51 UTC) #13
Message was sent while issue was closed.
Committed patchset #1 (id:1) manually as
ebba1800e4bb5ffad3533e6bf01978b578eea91a (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698