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

Issue 1381023007: mac: Don’t leak send rights from ExceptionPorts::GetExceptionPorts() (Closed)

Created:
5 years, 2 months ago by Mark Mentovai
Modified:
5 years, 2 months ago
Reviewers:
Robert Sesek
CC:
crashpad-dev_chromium.org
Base URL:
https://chromium.googlesource.com/crashpad/crashpad@master
Target Ref:
refs/heads/master
Project:
crashpad
Visibility:
Public.

Description

mac: Don’t leak send rights from ExceptionPorts::GetExceptionPorts() ExceptionPorts::GetExceptionPorts() returned a std::vector<ExceptionPorts::ExceptionHandler>, which contained send rights to Mach ports. The interface required callers to assume ownership of each send right contained within the vector. This was cumbersome and error-prone, and despite the care taken in Crashpad, port right leaks did occur: - SimulateCrash() didn’t make any attempt to release these resources at all. - Neither did crashpad_util_test ExceptionPorts.HostExceptionPorts, which also reused a vector. This replaces the vector with the interface-compatible (as far as necessary) ExceptionPorts::ExceptionHandlerVector, which deallocates collected port rights on destruction or clear(). R=rsesek@chromium.org Committed: https://chromium.googlesource.com/crashpad/crashpad/+/5f7eda87a6fa32b8881464950dacb006180a4edb

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+92 lines, -38 lines) Patch
M client/simulate_crash_mac.cc View 2 chunks +1 line, -3 lines 0 comments Download
M tools/mac/exception_port_tool.cc View 3 chunks +13 lines, -6 lines 0 comments Download
M util/mach/exception_ports.h View 2 chunks +39 lines, -8 lines 0 comments Download
M util/mach/exception_ports.cc View 2 chunks +25 lines, -3 lines 0 comments Download
M util/mach/exception_ports_test.cc View 3 chunks +14 lines, -18 lines 0 comments Download

Messages

Total messages: 4 (1 generated)
Mark Mentovai
5 years, 2 months ago (2015-10-05 22:21:17 UTC) #2
Robert Sesek
LGTM
5 years, 2 months ago (2015-10-06 18:54:24 UTC) #3
Mark Mentovai
5 years, 2 months ago (2015-10-06 20:14:37 UTC) #4
Message was sent while issue was closed.
Committed patchset #1 (id:1) manually as
5f7eda87a6fa32b8881464950dacb006180a4edb (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698