Closed Bug 863559 Opened 8 years ago Closed 8 years ago

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

Categories

(Core :: IPC, defect)

x86_64
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla23

People

(Reporter: luke, Assigned: ehsan)

Details

Attachments

(1 file)

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!
Attached patch Patch (v1)Splinter Review
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
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla23
You need to log in before you can comment on or make changes to this bug.