servo / servo/ipc-channel

macos: Make sure to decrement the ref count of the mach port on ChannelClosed

Open
#116 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
1.1k
Forks
161
Avg merge
1d 5h
Merged PRs (30d)
1

Description

Similar to what is seen in #96 we should ensure that we do not have mach port leaks on ChannelClosed.

We should also use an auto-incrementing number as an id instead of the local_port cast to a u64(here and here) to avoid a race condition if the mach port number is reused. I do not know mach ports well enough to know if this is necessary yet.

Related to: #96 #105

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in src/platform/macos/mod.rs at the linked locations around lines 608 and 642, and compare the ChannelClosed handling with issue #96. Determine how mach-port reference counts should be decremented and whether the local_port-derived ID can race when ports are reused; done means both concerns are addressed without leaks or ID collisions, with related issues #96 and #105 considered.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.