Summary
macOS OpenDisplay 1.17.0 (141) still crashes with EXC_BAD_ACCESS / SIGSEGV in stream(_:didStopWithError:) when ScreenCaptureKit stops the capture stream. The same stack appeared on 1.16.1; upgrading to 1.17.0 did not fix it.
This looks distinct from #231: the process dies while formatting/logging error, before the new SCStreamError.userStopped / recovery logic can run. App logs never contain stream stopped with error: for these crashes.
Environment
- Mac app: 1.17.0 (141) (also reproduced on 1.16.1 / 137)
- macOS: 14.4.1 (23E224)
- Hardware: MacBook Pro (MacBookPro18,3), Apple M1 Pro, 16 GB
- Mode: WiFi extend to iPhone
- Screen Recording + Accessibility: granted
Steps
- Connect iPhone over WiFi and start extend.
- Leave the session running (capture FPS often collapses to ~0–2 with stalls on this network).
- After some time, ScreenCaptureKit stops the stream (
didStopWithError).
- OpenDisplay quits immediately (segmentation fault).
Crash signature
- Exception:
EXC_BAD_ACCESS / SIGSEGV — KERN_INVALID_ADDRESS at 0x0
- Triggered from:
-[SCStreamManager stream:didStopWithError:] → OpenDisplay → Swift _print_unlocked / swift_getDynamicType / SwiftError::isPureNSError
Faulting frames (1.17.0 build, OpenDisplay-2026-08-21-111218.ips):
libswiftCore.dylib +4216972
libswiftCore.dylib +3792708
libswiftCore.dylib +887964
OpenDisplay +94644
OpenDisplay +96052
ScreenCaptureKit +138400
ReplayKit +103884
ReplayKit +155640
CoreFoundation +386100
CoreFoundation +385716
ReplayKit +143500
Foundation +8901188
Suspected cause
In Mac/MacSender.swift (v1.17.0):
func stream(_ stream: SCStream, didStopWithError error: Error) {
guard stream === self.stream else { return }
Log.info("stream stopped with error: \(error)") // ← crashes here
...
}
Crash stack goes through Swift error printing (_print_unlocked), which suggests the bridged Error from ScreenCaptureKit/ReplayKit is sometimes invalid/null, and string interpolation forces a dynamic type/print that segfaults.
Suggested fix
Avoid interpolating the raw Error until it is known-safe, e.g.:
Notes
- Reproduced multiple times on 2026-08-21 after updating to 1.17.0 (
…-111136.ips, …-111218.ips), and earlier on 1.16.1 the same day.
- WiFi session shows very low
capFps/fps and rising stalls beforehand; that likely increases how often the stream stops and hits this path.
- Happy to attach full
.ips + ~/Library/Logs/OpenDisplay/opendisplay.log if useful.
Summary
macOS OpenDisplay 1.17.0 (141) still crashes with
EXC_BAD_ACCESS/SIGSEGVinstream(_:didStopWithError:)when ScreenCaptureKit stops the capture stream. The same stack appeared on 1.16.1; upgrading to 1.17.0 did not fix it.This looks distinct from #231: the process dies while formatting/logging
error, before the newSCStreamError.userStopped/ recovery logic can run. App logs never containstream stopped with error:for these crashes.Environment
Steps
didStopWithError).Crash signature
EXC_BAD_ACCESS/SIGSEGV—KERN_INVALID_ADDRESS at 0x0-[SCStreamManager stream:didStopWithError:]→ OpenDisplay → Swift_print_unlocked/swift_getDynamicType/SwiftError::isPureNSErrorFaulting frames (1.17.0 build,
OpenDisplay-2026-08-21-111218.ips):Suspected cause
In
Mac/MacSender.swift(v1.17.0):Crash stack goes through Swift error printing (
_print_unlocked), which suggests the bridgedErrorfrom ScreenCaptureKit/ReplayKit is sometimes invalid/null, and string interpolation forces a dynamic type/print that segfaults.Suggested fix
Avoid interpolating the raw
Erroruntil it is known-safe, e.g.:String(describing: error)inside a defensive path, or only logNSErrordomain/code/userInfo keysuserStoppedhandlingNotes
…-111136.ips,…-111218.ips), and earlier on 1.16.1 the same day.capFps/fpsand risingstallsbeforehand; that likely increases how often the stream stops and hits this path..ips+~/Library/Logs/OpenDisplay/opendisplay.logif useful.