wasmerio/wasmer · error

write_offset_at not yet implemented

Error message

write_offset_at not yet implemented

What it means

Stub implementation of gimli::Writer::write_offset_at for the cranelift DWARF writer: patching a section-relative offset at a given position is unimplemented and panics if any DWARF-emission path calls it.

Source

Thrown at lib/compiler-cranelift/src/dwarf.rs:168

                Address::Symbol { .. } => {
                    unimplemented!("eh pointer encoding {eh_pe:?} not supported for symbol targets")
                }
            }
        }
    }

    fn write_offset(&mut self, _val: usize, _section: SectionId, _size: u8) -> Result<()> {
        unimplemented!("write_offset not yet implemented");
    }

    fn write_offset_at(
        &mut self,
        _offset: usize,
        _val: usize,
        _section: SectionId,
        _size: u8,
    ) -> Result<()> {
        unimplemented!("write_offset_at not yet implemented");
    }
}

View on GitHub (pinned to 8c4b9ee9d3)

Solutions

  1. Avoid enabling DWARF debug-section generation with cranelift
  2. Use the LLVM compiler backend for debug info
  3. Update Wasmer for newer DWARF support
  4. Implement write_offset_at in dwarf.rs if you maintain a fork

Example fix

// before
fn write_offset_at(&mut self, _offset: usize, _val: usize, _section: SectionId, _size: u8) -> Result<()> {
    unimplemented!("write_offset_at not yet implemented");
}
// after
fn write_offset_at(&mut self, offset: usize, val: usize, _section: SectionId, size: u8) -> Result<()> {
    self.write_udata_at(offset, val, size); // or return a proper unsupported error
    Ok(())
}
Defensive patterns

Strategy: fallback

Validate before calling

// Same gate: full DWARF emission requires a backend that implements write_offset_at
let backend = if requires_dwarf_backpatch { Backend::LLVM } else { Backend::Cranelift };

Try / catch

// unimplemented!() panics are not catchable; avoid by selecting the LLVM backend for DWARF workloads

Prevention

When it happens

Trigger: DWARF emission that back-patches a size/offset field at a fixed offset (e.g. writing unit lengths or updating ranges after the fact) while generating debug sections with cranelift.

Common situations: Full .debug_* section generation with the cranelift backend; debug-info tooling triggering back-patch paths.

Related errors


AI-assisted analysis of wasmerio/wasmer@8c4b9ee9d3 (2026-09-01). Data as JSON: /api/errors/3d4a504fba9773c4. Report an issue: GitHub.