screenpipe icon indicating copy to clipboard operation
screenpipe copied to clipboard

Segmentation Fault When Running Screenpipe on macOS

Open aybanda opened this issue 2 years ago • 10 comments

Description: I'm encountering a persistent segmentation fault when trying to run Screenpipe on my macOS system. I've tried multiple build configurations, but the issue persists.

System Information:

  • OS: macOS [14.6.1 ]
  • Processor: [Apple M1]
  • Rust version: [rustc 1.81.0]
  • Cargo version: [cargo 1.81.0

Steps to Reproduce:

  1. Cloned the Screenpipe repository
  2. Ran cargo build --release
  3. Attempted to run with cargo run --release --bin screenpipe

I've also tried the following variations, all resulting in a segmentation fault:

  • cargo run --bin screenpipe (debug build)
  • cargo run --release --features metal --bin screenpipe
  • RUST_BACKTRACE=1 cargo run --release --features metal --bin screenpipe

Error Output: zsh: segmentation fault cargo run --release --features metal --bin screenpipe

Additional Information:

  • The project builds successfully in all configurations.
  • I've performed a clean build (cargo clean) before attempting each configuration.
  • I've ensured my system is up to date, including Xcode and command-line tools.
  • No additional error messages or logs are generated before the segmentation fault.

Questions: 2. Are there any additional debugging steps or information I can provide to help diagnose this issue? 3. Are there any specific system requirements or configurations needed for macOS that I might have missed?

I appreciate any help or guidance in resolving this issue. Thank you for your time and assistance.

aybanda avatar Sep 27 '24 08:09 aybanda

Description: I'm encountering a persistent segmentation fault when trying to run Screenpipe on my macOS system. I've tried multiple build configurations, but the issue persists.

System Information:

  • OS: macOS [14.6.1 ]
  • Processor: [Apple M1]
  • Rust version: [rustc 1.81.0]
  • Cargo version: [cargo 1.81.0

Steps to Reproduce:

  1. Cloned the Screenpipe repository
  2. Ran cargo build --release
  3. Attempted to run with cargo run --release --bin screenpipe

I've also tried the following variations, all resulting in a segmentation fault:

  • cargo run --bin screenpipe (debug build)
  • cargo run --release --features metal --bin screenpipe
  • RUST_BACKTRACE=1 cargo run --release --features metal --bin screenpipe

Error Output: zsh: segmentation fault cargo run --release --features metal --bin screenpipe

Additional Information:

  • The project builds successfully in all configurations.
  • I've performed a clean build (cargo clean) before attempting each configuration.
  • I've ensured my system is up to date, including Xcode and command-line tools.
  • No additional error messages or logs are generated before the segmentation fault.

Questions: 2. Are there any additional debugging steps or information I can provide to help diagnose this issue? 3. Are there any specific system requirements or configurations needed for macOS that I might have missed?

I appreciate any help or guidance in resolving this issue. Thank you for your time and assistance.

hmm

can you try

screenpipe --list-audio-devices

then

screenpipe --audio-device <your device> don't pick Display audio, i suspect this is the reason #297

if this is the case i might prioritize issue 297 again

i know some people having seg fault but only on specific versions of macos weirdly

louis030195 avatar Sep 27 '24 15:09 louis030195

Got past this issue by finding relevant errors in console.

Request message contains a target_token to accessing_process (TCCDProcess: identifier=screenpipe-555549441aea18d2f12e32a0812f8fab07d28dbe, pid=18185, auid=501, euid=501, binary_path=/opt/homebrew/Cellar/screenpipe/0.1.90/bin/screenpipe) but TCCDProcess: identifier=com.apple.audio.coreaudiod, pid=473, auid=202, euid=202, binary_path=/usr/sbin/coreaudiod is not a TCC manager for service: kTCCServiceScreenCapture.

Then following step 1 and 2 of the ChatGPT response below. Note that this reset all your screencapture permissions so you'll have some permission dialog filled days ahead of you.

This message looks like a macOS system log or error related to TCC (Transparency, Consent, and Control) services, which manage privacy permissions for apps. In this case, it seems like there’s a conflict where the process screenpipe (related to screen capture) is attempting to access screen recording or screen capture, but TCC permissions are not properly configured, or coreaudiod (which handles audio) is not the right process for managing screen capture permissions.

Here’s what might be happening:

  1. Screenpipe is trying to access screen recording functionality.
  2. The system is blocking this access because coreaudiod, an audio process, isn't responsible for screen capture permissions.
  3. Permissions for screenpipe may need to be manually configured or fixed.

Steps to resolve:

  1. Check privacy settings:

    • Go to System Preferences > Security & Privacy > Privacy > Screen Recording.
    • Make sure screenpipe (or any app using it) is allowed to capture your screen.
  2. Grant permissions using terminal (if required):

    • Sometimes macOS requires Terminal commands to manage TCC permissions. You can try granting screenpipe permission using a tool like tccutil:
      tccutil reset ScreenCapture
      
      Then, relaunch the app and allow the permission prompt.
  3. Reinstall/Update screenpipe:

    • Ensure you’re using the latest version of the software by running:
      brew update && brew upgrade screenpipe
      

If the issue persists, check whether other processes or configurations are preventing the correct allocation of permissions for screen recording.

doublej avatar Sep 27 '24 23:09 doublej

Having this exact issue on Mac 15.1.

mgunnin avatar Oct 04 '24 14:10 mgunnin

Having this exact issue on Mac 15.1.

is that macos beta?

usually macos beta means 20% of your apps will be broken

louis030195 avatar Oct 04 '24 17:10 louis030195

It's the first app that is broken of all the ones I use.

mgunnin avatar Oct 05 '24 17:10 mgunnin

Have you tried step 2 in my reply?

doublej avatar Oct 06 '24 11:10 doublej

I had this exact issue on Mac OS 15.0. Resetting Screen Recording permissions via System Preferences > Security & Privacy had no effect, but running tccutil reset ScreenCapture (step 2 in @doublej's reply, above) fixed it for me.

(However, beware: as noted, that command resets Screen Recording permissions for all of your apps, not just ScreenPipe.)

zacwasielewski avatar Oct 09 '24 16:10 zacwasielewski

I had this exact issue on Mac OS 15.0. Resetting Screen Recording permissions via System Preferences > Security & Privacy had no effect, but running tccutil reset ScreenCapture (step 2 in @doublej's reply, above) fixed it for me.

Got a segmentation fault ./target/release/screenpipe too and this tccutil reset ScreenCapture resolved it. Thank you guys!

maxjendrall avatar Nov 10 '24 12:11 maxjendrall

I was having this issue while running screenpipe from iTerm2 on the latest MacOS Developer Beta. The issue was that I needed to grant 'Screen & System Audio Recording' permissions to iTerm, which resolved the issue for me.

image

TheSethRose avatar Nov 18 '24 14:11 TheSethRose