ulalaca icon indicating copy to clipboard operation
ulalaca copied to clipboard

sessionprojector.app crashes when disk running out of space

Open unstabler opened this issue 9 months ago • 1 comments

ENVIRONMENT

  • Mac Mini (M1, 2020, 16GB)
  • macOS 14 Sonoma (14.0; 23A344)

SUMMARY

// Thread 34 Queue : com.apple.NSXPCConnection.m-user.com.apple.replayd (serial)
// #2	0x0000000100e01e7c in SCScreenRecorder.stream(_:didStopWithError:) at /Users/cheesekun/works/ulalaca/sessionprojector/sessionprojector/recorder/SCScreenRecorder.swift:217

extension SCScreenRecorder: SCStreamDelegate {
    public func stream(_ stream: SCStream, didStopWithError error: Error) {
        logger.error("didStopWithError: \(error.localizedDescription)")
        //                                ^^^^^ Thread 34: EXC_BAD_ACCESS (code=1, address=0x0)

        delegateQueue.async {
            self.delegate?.screenRecorder(didStopWithError: error)
        }
    }
}
; Thread 34 Queue : com.apple.NSXPCConnection.m-user.com.apple.replayd (serial)
; #4	0x00000001f28f71f0 in -[SCStreamManager stream:didStopWithError:] ()

    0x1f28f71d4 <+428>: bl     0x1f291cb80               ; objc_msgSend$delegate
    0x1f28f71d8 <+432>: mov    x29, x29
    0x1f28f71dc <+436>: bl     0x1f290a5f8               ; symbol stub for: objc_retainAutoreleasedReturnValue
    0x1f28f71e0 <+440>: mov    x21, x0
    0x1f28f71e4 <+444>: mov    x2, x22
    0x1f28f71e8 <+448>: mov    x3, x20
    0x1f28f71ec <+452>: bl     0x1f291fa80               ; objc_msgSend$stream:didStopWithError:
->  0x1f28f71f0 <+456>: mov    x0, x21
    0x1f28f71f4 <+460>: bl     0x1f290a5b8               ; symbol stub for: objc_release
    0x1f28f71f8 <+464>: b      0x1f28f7218               ; <+496>
    0x1f28f71fc <+468>: cmp    w8, #0x2
    0x1f28f7200 <+472>: b.hi   0x1f28f7218               ; <+496>


(lldb) register read --all
General Purpose Registers:
       x19 = 0x00006000007039c0
       x20 = 0x0000000000000000 ; <-- ???????????????????????????
       x21 = 0x00006000020c78d0
       x22 = 0x0000600002ec0700
       x23 = 0x0000000000000001
       x24 = 0x0000000000000001
       x25 = 0x0000000000000000
       x26 = 0x0000600002dc0000
       x27 = 0x0000000000000001
       x28 = 0x000060000076eb40
        fp = 0x000000016f0c1f60
        sp = 0x000000016f0c1ef0
        pc = 0x00000001f28f71f0  ScreenCaptureKit`-[SCStreamManager stream:didStopWithError:] + 456
       w19 = 0x007039c0
       w20 = 0x00000000
48 registers were unavailable.

  • ScreenCaptureKit calls SCStreamDelegate::stream: (SCStream!) stream didStopWithError: (Error!) error when something is going wrong
    • error parameter is marked as nonnull, but ScreenCaptureKit(or ReplayKit) actually passes nil

어떻게 해야 하지

  • Apple에 버그 리포트?

  • guard let error = (error as? Any) as? Error 같은 임시 조치를 해야 하는데, 이게 먹을까?

  • nonnull이라면서 왜 null인데.. 얼탱이 X

unstabler avatar Oct 26 '23 18:10 unstabler