fix mach port leak in PlatformThread::CurrentId in imported Chromium code

RESOLVED FIXED in mozilla23

Status

()

Core
IPC
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: luke, Assigned: Ehsan)

Tracking

unspecified
mozilla23
x86_64
Mac OS X
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

861 bytes, patch
Justin Lebar (not reading bugmail)
: review+
Details | Diff | Splinter Review
This blog post explains a Mach port leak that was causing a Chrome crash:
  http://robert.sesek.com/thoughts/2012/1/debugging_mach_ports.html
It looks like we imported their code, pre-fix:
  http://mxr.mozilla.org/mozilla-central/source/ipc/chromium/src/base/platform_thread_posix.cc#48
Here's the fix:
  http://src.chromium.org/viewvc/chrome/trunk/src/base/threading/platform_thread_posix.cc?r1=117127&r2=117126&pathrev=117127

General takeaway: mach_thread_self() increments a ref-count on the returned handle.  One most mach_port_deallocate it!
(Assignee)

Comment 1

5 years ago
Created attachment 739688 [details] [diff] [review]
Patch (v1)
Assignee: nobody → ehsan
Status: NEW → ASSIGNED
Attachment #739688 - Flags: review?(justin.lebar+bug)
Attachment #739688 - Flags: review?(justin.lebar+bug) → review+
https://hg.mozilla.org/mozilla-central/rev/bb982207e926
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla23
You need to log in before you can comment on or make changes to this bug.