{"record":{"id":"da599f884d967fee","repo":"linebender/druid","slug":"unable-to-acquire-underlying-compositor-to-create-da599f","errorCode":null,"errorMessage":"unable to acquire underlying compositor to create a region","messagePattern":"unable to acquire underlying compositor to create a region","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"druid-shell/src/backend/wayland/surfaces/mod.rs","lineNumber":144,"sourceCode":"\nimpl Compositor for CompositorHandle {\n    fn output(&self, id: u32) -> Option<outputs::Meta> {\n        match self.inner.upgrade() {\n            None => None,\n            Some(c) => c.output(id),\n        }\n    }\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","sourceCodeStart":126,"sourceCodeEnd":162,"githubUrl":"https://github.com/linebender/druid/blob/0f8b1195e4e073f9597f2865299c3d18f8e4005f/druid-shell/src/backend/wayland/surfaces/mod.rs#L126-L162","documentation":"Guard panic in Compositor for CompositorHandle::create_region: the Weak reference to the underlying compositor can no longer be upgraded because it was dropped. It fires when an opaque/input region must be created for a surface after the compositor backend has been torn down — a use-after-drop of wayland resources.","triggerScenarios":"Thrown at druid-shell/src/backend/wayland/surfaces/mod.rs:144 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Keep the underlying compositor alive for the lifetime of any handle that can create regions","Upgrade the Weak reference first and skip region creation gracefully if the compositor is gone","Drop CompositorHandle when its compositor is dropped to prevent stale use"],"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"}