Bug 1801419 Comment 13 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

I've created a patch that makes Firefox (and Thunderbird) explicitly link against the `SidecarCore` private framework. I don't know that it will fix this bug's crashes. But I think there's a good chance it might, and in itself the patch is completely harmless. macOS 10.12 and 10.13 don't have this framework, so I've used `-weak_framework` to generate the link.

This bug's crashes all happen when code (in `SidecarCore` or elsewhere) tries to access data in the `SidecarCore` framework, and the accesses fail with the "reason" set to `EXC_BAD_ACCESS / KERN_MEMORY_ERROR`. The entire framework has already been mapped into virtual memory -- otherwise the "reason" would be `EXC_BAD_ACCESS / KERN_INVALID_ADDRESS`. And it should all be backed by usable physical memory, so the kernel *should* just map it in when a page fault happens. But sometimes this doesn't happen, and the page fault is passed back to user space as a fatal error. The SidecarCore framework is in the dyld shared cache, and there's some indication these crashes are more likely in that case, and possibly only happen in that case. And this framework is loaded dynamically (on the first `Cmd-key` combination), which may also make the crashes more likely. In any case this is pretty clearly an Apple kernel bug. So there's nothing we can do about it directly.

But we might be able to find a workaround. I've started with the simplest and least invasive. These crashes are somewhat rare, especially on mozilla-central. So it will take a while to find out whether or not my patch works. We may not know for sure until it's spent a few weeks on a beta branch.
I've created a patch that makes Firefox (and Thunderbird) explicitly link against the `SidecarCore` private framework. I don't know that it will fix this bug's crashes. But I think there's a good chance it might, and in itself the patch is completely harmless. macOS 10.12 and 10.13 don't have this framework, so I've used `-weak_framework` to generate the link.

This bug's crashes all happen when code (in `SidecarCore` or elsewhere) tries to access data in the `SidecarCore` framework, and the accesses fail with the "reason" set to `EXC_BAD_ACCESS / KERN_MEMORY_ERROR`. The entire framework has already been mapped into virtual memory -- otherwise the "reason" would be `EXC_BAD_ACCESS / KERN_INVALID_ADDRESS`. And it should all be backed by usable physical memory, so the kernel *should* just map it in when a page fault happens. But sometimes this doesn't happen, and the page fault is passed back to user space as a fatal error. The `SidecarCore` framework is in the dyld shared cache, and there's some indication these crashes are more likely in that case, and possibly only happen in that case. And this framework is loaded dynamically (on the first `Cmd-key` combination), which may also make the crashes more likely. In any case this is pretty clearly an Apple kernel bug. So there's nothing we can do about it directly.

But we might be able to find a workaround. I've started with the simplest and least invasive. These crashes are somewhat rare, especially on mozilla-central. So it will take a while to find out whether or not my patch works. We may not know for sure until it's spent a few weeks on a beta branch.

Back to Bug 1801419 Comment 13