Post not yet marked as solved
Click to stop watching this thread.
You have stopped watching this post. Click to start watching again.
contentPostList.repliesup-voted.tooltip
Thanks Eskimo for your comment. I am using CFMessagePort as IPC mechanism to share an IOSurface between broadcast extension and the main iOS app. I create CFMessagePort communication channel and get the underlying mach port with CFMachPortGetPort. And then transport ioSurface mach port created using IOSurfaceCreateMachPort from broadcast extension to the main app with mach_msg_send. In the main app I get IOSurface back with IOSurfaceLookupFromMachPort. Now that ioSurface is shared between the main app and broadcast extension our main app can get the frames from IOSurface and encode and upload the frames to the server. We are doing this because we have to use vp8 software encoding and we can't do it in extension's 50mb memory limit. There are other reasons as well for why we can't just upload from the extension itself. This works fine till iOS 15. But crashes on iOS 16 at the point where we get the mach port from CFMessagePort with mach_port_t machPort = CFMachPortGetPort(ms->_port);
I have attached the crash report below.
iOS16Bug 21-09-2022, 1-09 PM.crash
I am also attaching a minimal sample app files to reproduce the crash:
PortCommunication.h.crash
PortCommunication.m.crash
Crash is reproducible just by calling:
let portCommunication = PortCommunication(groupName: "group.ios.mach.port.bug", sdkId: "adsf")
where group.ios.mach.port.bug is the app group
Hoping you could help us out. I have also filed a feedback FB11366868 for the same.
If the above is not possible going forward from iOS 16, is there a way to share an IOSurface across main app and the extension? (I know it's possible on Mac with XPC, but not sure if XPC can work iOS yet)