{"record":{"id":"072370db87f4f7b7","repo":"gfx-rs/wgpu","slug":"couldn-t-acquire-program-cache-lock","errorCode":null,"errorMessage":"Couldn't acquire program_cache lock","messagePattern":"Couldn't acquire program_cache lock","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"wgpu-hal/src/gles/device.rs","lineNumber":495,"sourceCode":"        let group_to_binding_to_slot = layout\n            .group_infos\n            .iter()\n            .map(|group| group.as_ref().map(|group| group.binding_to_slot.clone()))\n            .collect::<Vec<_>>();\n        for &(naga_stage, stage) in &shaders {\n            program_stages.push(super::ProgramStage {\n                naga_stage: naga_stage.to_owned(),\n                shader_id: stage.module.id,\n                entry_point: stage.entry_point.to_owned(),\n                zero_initialize_workgroup_memory: stage.zero_initialize_workgroup_memory,\n                constant_hash: Self::create_constant_hash(stage),\n            });\n        }\n        let mut guard = self\n            .shared\n            .program_cache\n            .try_lock()\n            .expect(\"Couldn't acquire program_cache lock\");\n        // This guard ensures that we can't accidentally destroy a program whilst we're about to reuse it\n        // The only place that destroys a pipeline is also locking on `program_cache`\n        let program = guard\n            .entry(super::ProgramCacheKey {\n                stages: program_stages,\n                group_to_binding_to_slot: group_to_binding_to_slot.into_boxed_slice(),\n            })\n            .or_insert_with(|| unsafe {\n                Self::create_program(\n                    gl,\n                    shaders,\n                    layout,\n                    label,\n                    multiview_mask,\n                    self.shared.shading_language_version,\n                    self.shared.private_caps,\n                )\n            })","sourceCodeStart":477,"sourceCodeEnd":513,"githubUrl":"https://github.com/gfx-rs/wgpu/blob/3e11ff59bf3f9795d285ecc045014089640d7248/wgpu-hal/src/gles/device.rs#L477-L513","documentation":"Panic in the GLES device during pipeline creation: the shared program_cache mutex could not be locked, which for this mutex signals a poisoned/deadlocked state (another thread panicked while holding it). The faulty input is the lock state of the shared cache.","triggerScenarios":"Thrown at wgpu-hal/src/gles/device.rs:495 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Avoid concurrent pipeline creation races that poison the lock","Restart the process; investigate the earlier panic that poisoned the mutex"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"3e11ff59bf3f9795d285ecc045014089640d7248","analyzedAt":"2026-09-03T01:43:21.459Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-10T07:17:11.731Z"}