{"record":{"id":"9ca055dd0ef5bb41","repo":"gfx-rs/wgpu","slug":"error-serializing-lock-observing-action","errorCode":null,"errorMessage":"error serializing `lock::observing::Action`","messagePattern":"error serializing `lock::observing::Action`","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"wgpu-core/src/lock/observing.rs","lineNumber":420,"sourceCode":"                column: location.column(),\n            });\n        }\n    }\n\n    fn write_rank(&mut self, rank: LockRankSet) {\n        self.write_action(&Action::Rank {\n            bit: rank.number(),\n            member_name: rank.member_name(),\n            const_name: rank.const_name(),\n        });\n    }\n\n    fn write_action(&mut self, action: &Action) {\n        use std::io::Write;\n\n        self.buffer.clear();\n        ron::ser::to_writer(&mut self.buffer, &action)\n            .expect(\"error serializing `lock::observing::Action`\");\n        self.buffer.push('\\n');\n        self.log_file\n            .write_all(self.buffer.as_bytes())\n            .expect(\"error writing `lock::observing::Action`\");\n    }\n}\n\n/// An action logged by a thread that is observing lock acquisition order.\n///\n/// Each thread's log file is a sequence of these enums, serialized\n/// using the [`ron`] crate, one action per line.\n///\n/// Lock observation cannot assume that there will be any convenient\n/// finalization point before the program exits, so in practice,\n/// actions must be written immediately when they occur. This means we\n/// can't, say, accumulate tables and write them out when they're\n/// complete. The `lock-analyzer` binary is then responsible for\n/// consolidating the data into a single table of observed transitions.","sourceCodeStart":402,"sourceCodeEnd":438,"githubUrl":"https://github.com/gfx-rs/wgpu/blob/3e11ff59bf3f9795d285ecc045014089640d7248/wgpu-core/src/lock/observing.rs#L402-L438","documentation":"Panic in lock observation logging: RON serialization of a lock::observing::Action failed while writing to the in-memory buffer. This is an internal invariant failure of the observer, not user input; effectively unreachable unless an Action cannot be serialized.","triggerScenarios":"Thrown at wgpu-core/src/lock/observing.rs:420 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Report a bug with the panic backtrace to wgpu maintainers","Disable lock observation (unset WGPU_CORE_LOCK_OBSERVE_DIR) to keep running"],"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"}