It is possible for mach_port_allocate to return an error, but we rarely check its return value. The value of the argument passed to mach_port_allocate is not guaranteed to be valid when it returns an error, so there is a potential for us to try to use invalid ports. We should always check return values, and ensure that the mach port variables we seek to initialize are kept in a valid state. While we're at it, we should add some additional assertions to confirm we aren't dealing with invalid ports.
<rdar://problem/37261129>
Created attachment 336666 [details] Patch
Comment on attachment 336666 [details] Patch r=me if the bots are happy.
Committed r230035: <https://trac.webkit.org/changeset/230035>