{"record":{"id":"9d49444f259c6c03","repo":"zed-industries/zed","slug":"unable-to-find-ourselves","errorCode":null,"errorMessage":"unable to find ourselves","messagePattern":"unable to find ourselves","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/crashes/src/crashes.rs","lineNumber":77,"sourceCode":"    connect_and_keepalive(crash_init, socket_path, wait_timer, spawn)\n}\n\n/// Spawn the crash-handler subprocess, connect the IPC client, and run the\n/// keepalive ping loop. This is the future returned by [`init`], so it runs on\n/// whichever executor the caller polls it with.\nasync fn connect_and_keepalive<F, C, S, P>(\n    crash_init: InitCrashHandler,\n    socket_path: P,\n    wait_timer: C,\n    spawn: S,\n) -> Arc<Client>\nwhere\n    F: Future<Output = ()> + Send + Sync + 'static,\n    C: (Fn(Duration) -> F) + Send + Sync + 'static,\n    S: FnOnce(Pin<Box<dyn Future<Output = ()> + Send + 'static>>),\n    P: FnOnce(u32) -> PathBuf,\n{\n    let exe = env::current_exe().expect(\"unable to find ourselves\");\n    let socket_path = socket_path(process::id());\n    let mut _crash_handler = spawn_crash_handler(&exe, &socket_path);\n    info!(\"spawning crash handler process\");\n    let mut elapsed = Duration::ZERO;\n    let retry_frequency = Duration::from_millis(100);\n    let client = loop {\n        if let Ok(client) = Client::with_name(SocketName::Path(&socket_path)) {\n            info!(\"connected to crash handler process after {elapsed:?}\");\n            break client;\n        }\n        elapsed += retry_frequency;\n        wait_timer(retry_frequency).await;\n    };\n    let client = Arc::new(client);\n\n    panic::set_hook({\n        let client = client.clone();\n        Box::new(move |payload| {","sourceCodeStart":59,"sourceCodeEnd":95,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/crashes/src/crashes.rs#L59-L95","documentation":"Error in the crashes crate's connect_and_keepalive when the current executable's own path cannot be determined (current_exe failed or returned nothing), so the crash-handler subprocess cannot be spawned from the same binary. Without it, crash reporting cannot be initialized.","triggerScenarios":"Thrown at crates/crashes/src/crashes.rs:77 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Avoid running the binary in ways that hide /proc/self/exe (deleted binaries, unusual namespaces)","Ensure the executable is not deleted or moved while running","Check container/sandbox restrictions on /proc access"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f4178619acd0d47ea1f76a2025c42962c6d6638c","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}