gfx-rs/wgpu · error

error serializing `lock::observing::Action`

Error message

error serializing `lock::observing::Action`

What it means

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.

Source

Thrown at wgpu-core/src/lock/observing.rs:420

                column: location.column(),
            });
        }
    }

    fn write_rank(&mut self, rank: LockRankSet) {
        self.write_action(&Action::Rank {
            bit: rank.number(),
            member_name: rank.member_name(),
            const_name: rank.const_name(),
        });
    }

    fn write_action(&mut self, action: &Action) {
        use std::io::Write;

        self.buffer.clear();
        ron::ser::to_writer(&mut self.buffer, &action)
            .expect("error serializing `lock::observing::Action`");
        self.buffer.push('\n');
        self.log_file
            .write_all(self.buffer.as_bytes())
            .expect("error writing `lock::observing::Action`");
    }
}

/// An action logged by a thread that is observing lock acquisition order.
///
/// Each thread's log file is a sequence of these enums, serialized
/// using the [`ron`] crate, one action per line.
///
/// Lock observation cannot assume that there will be any convenient
/// finalization point before the program exits, so in practice,
/// actions must be written immediately when they occur. This means we
/// can't, say, accumulate tables and write them out when they're
/// complete. The `lock-analyzer` binary is then responsible for
/// consolidating the data into a single table of observed transitions.

View on GitHub (pinned to 3e11ff59bf)

Solutions

  1. Report a bug with the panic backtrace to wgpu maintainers
  2. Disable lock observation (unset WGPU_CORE_LOCK_OBSERVE_DIR) to keep running
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at wgpu-core/src/lock/observing.rs:420 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of gfx-rs/wgpu@3e11ff59bf (2026-09-03). Data as JSON: /api/errors/9ca055dd0ef5bb41. Report an issue: GitHub.