{"record":{"id":"3df7dbb2e3c90bd1","repo":"linebender/druid","slug":"unable-to-acquire-underlying-compositor-to-acquire","errorCode":null,"errorMessage":"unable to acquire underlying compositor to acquire shared memory","messagePattern":"unable to acquire underlying compositor to acquire shared memory","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"druid-shell/src/backend/wayland/surfaces/mod.rs","lineNumber":151,"sourceCode":"    }\n\n    fn create_surface(&self) -> wlc::Main<WlSurface> {\n        match self.inner.upgrade() {\n            None => panic!(\"unable to acquire underlying compositor to create a surface\"),\n            Some(c) => c.create_surface(),\n        }\n    }\n\n    fn create_region(&self) -> wlc::Main<WlRegion> {\n        match self.inner.upgrade() {\n            None => panic!(\"unable to acquire underlying compositor to create a region\"),\n            Some(c) => c.create_region(),\n        }\n    }\n\n    fn shared_mem(&self) -> wlc::Main<WlShm> {\n        match self.inner.upgrade() {\n            None => panic!(\"unable to acquire underlying compositor to acquire shared memory\"),\n            Some(c) => c.shared_mem(),\n        }\n    }\n\n    fn get_xdg_positioner(&self) -> wlc::Main<xdg_positioner::XdgPositioner> {\n        match self.inner.upgrade() {\n            None => panic!(\"unable to acquire underlying compositor to create an xdg positioner\"),\n            Some(c) => c.get_xdg_positioner(),\n        }\n    }\n\n    fn get_xdg_surface(&self, s: &wlc::Main<WlSurface>) -> wlc::Main<xdg_surface::XdgSurface> {\n        match self.inner.upgrade() {\n            None => panic!(\"unable to acquire underlying compositor to create an xdg surface\"),\n            Some(c) => c.get_xdg_surface(s),\n        }\n    }\n","sourceCodeStart":133,"sourceCodeEnd":169,"githubUrl":"https://github.com/linebender/druid/blob/0f8b1195e4e073f9597f2865299c3d18f8e4005f/druid-shell/src/backend/wayland/surfaces/mod.rs#L133-L169","documentation":"Generic guard panic in Compositor for CompositorHandle::shared_mem: the Weak<dyn Compositor> held by the handle has been dropped, so the wl_shm global cannot be reached to allocate shared memory for buffers. It fires when buffer allocation (e.g. during paint) happens after the compositor backend has been dropped, and is called from Data-driven buffer creation paths.","triggerScenarios":"Thrown at druid-shell/src/backend/wayland/surfaces/mod.rs:151 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure the compositor object outlives all shared-memory allocations by keeping a strong reference where buffers are created","Check Weak::upgrade before allocating and abort the paint path gracefully if the compositor is gone","Tie CompositorHandle's lifetime to the window so it is never used post-teardown"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"0f8b1195e4e073f9597f2865299c3d18f8e4005f","analyzedAt":"2026-09-10T14:27:34.582Z","contentChangedAt":"2026-09-10T14:27:34.582Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}