{"record":{"id":"75118d1c94b9b931","repo":"AprilNEA/OpenLogi","slug":"failed-to-start-gnome-stop-helper-error","errorCode":null,"errorMessage":"failed to start GNOME stop helper: {error}","messagePattern":"failed to start GNOME stop helper: (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/openlogi-hook/src/linux/gnome_shell.rs","lineNumber":209,"sourceCode":"        publish: PublishAppId,\n    ) -> Box<dyn FrontmostSource> {\n        // zbus owns its socket reader internally. A helper closes the worker's\n        // current connection when teardown is requested, waking both streams\n        // so the owning worker can synchronously return and join.\n        let active_connection = Arc::new(Mutex::new(None::<Connection>));\n        let stop_state = stop.state();\n        let connection_to_close = Arc::clone(&active_connection);\n        let stopper = thread::Builder::new()\n            .name(\"openlogi-frontmost-gnome-stop\".into())\n            .spawn(move || {\n                stop_state.wait();\n                if let Some(conn) = lock_unpoisoned(&connection_to_close).take()\n                    && let Err(error) = conn.close()\n                {\n                    debug!(\"gnome-shell: failed to close observer connection: {error}\");\n                }\n            })\n            .unwrap_or_else(|error| panic!(\"failed to start GNOME stop helper: {error}\"));\n\n        loop {\n            if stop.is_requested() {\n                break;\n            }\n            if self.conn.is_none() {\n                self.conn = Self::connect_bus();\n            }\n            let Some(conn) = self.conn.as_ref() else {\n                publish(None);\n                if stop.wait_timeout(RECONNECT_DELAY) {\n                    break;\n                }\n                continue;\n            };\n            *lock_unpoisoned(&active_connection) = Some(conn.clone());\n            let outcome =\n                futures_lite::future::block_on(Self::observe_connection(conn, &stop, &publish));","sourceCodeStart":191,"sourceCodeEnd":227,"githubUrl":"https://github.com/AprilNEA/OpenLogi/blob/e846e6f4b4405e33bd6a9aaf949a482ce34cb6d8/crates/openlogi-hook/src/linux/gnome_shell.rs#L191-L227","documentation":"Panic at source-spawn time in GnomeShellSource::observe: the dedicated 'openlogi-frontmost-gnome-stop' helper thread — which watches the StopToken and closes the worker's zbus Connection so the blocking observe loop wakes and can be joined — could not be spawned by the OS (thread::Builder::spawn returned Err, typically resource exhaustion or a pthread_create failure). The panic fires before the observe loop starts, so teardown of this frontmost source can never work; it is surfaced by unwrapping spawn's Result.","triggerScenarios":"Thrown at crates/openlogi-hook/src/linux/gnome_shell.rs:209 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check process/thread limits (ulimit -u, cgroup pids.max) and free memory on the host — spawn failures are almost always resource exhaustion","Restart the openlogi-agent process to reclaim leaked threads or memory","If it recurs on an embedded/limited host, consider reusing a shared stopper thread instead of spawning one per source"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e846e6f4b4405e33bd6a9aaf949a482ce34cb6d8","analyzedAt":"2026-09-13T03:07:16.451Z","contentChangedAt":"2026-09-13T03:07:16.451Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}