You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Audio & Voice Commands: SystemAudioRecorder.teardown() data race on MixWriter.summary, unchecked Int(CFHash) overflow crash, and ignored pinned mic #340
Three verified bugs in SystemAudioRecorder and SystemVoiceCommandPerformer:
Data race / potential crash in SystemAudioRecorder.teardown()
Sources/BlurtEngine/Audio/SystemAudioRecorder.swift:110-120 reads writer.summary on the caller thread (MainActor) before calling AudioDeviceStop/AudioDeviceDestroyIOProcID and beforequeue.sync { writer?.close() }.
MixWriter (SystemAudioMix.swift:16-18,36-43,113) is @unchecked Sendable confined to queue, and summary reads callbacks, framesIn, framesOut, and ARC-managed lastError: String? while the CoreAudio IOProc is actively mutating them on queue.
Unchecked Int(CFHash($0)) traps with integer overflow in Release builds
Sources/BlurtEngine/Command/SystemVoiceCommandPerformer+Screen.swift:239 converts CFHashCode (UInt, 64-bit unsigned) via checked Int(CFHash($0)) into PressFingerprint.focusedElement: Int? (ScreenContext.swift:298).
Whenever bit 63 is set (>= 0x8000_0000_0000_0000), Swift traps in both Debug and Release builds. fingerprint runs on every press in Chromium/Electron and every select in any app.
SystemAudioRecorder ignores the user's pinned microphone in MicDeviceStore
Sources/BlurtEngine/Audio/SystemAudioRecorder.swift:146 always binds the CoreAudio aggregate sub-device to AudioInputDevices.systemDefaultDevice?.uniqueID, ignoring MicDeviceStore().selection.pinnedUID (which Settings › Microphone promises is "Used for voice recording"). Users whose macOS default input is a virtual loopback device silently lose their mic track on meeting recordings.
Suggested Fix
Read writer?.summary inside queue.sync after stopping/destroying the IOProc.
Use UInt? (or Int(bitPattern: CFHash($0))) for PressFingerprint.focusedElement.
Resolve MicDeviceStore().selection.pinnedUID.flatMap(AudioInputDevices.device(forUID:)) ?? AudioInputDevices.systemDefaultDevice in createAggregate().
Activity