wasmerio/wasmer · error
write_offset_at not yet implemented
Error message
write_offset_at not yet implemented
What it means
Stub gimli::Writer::write_offset_at in the singlepass DWARF writer: back-patching a section-relative offset at a fixed position is unimplemented and panics if the DWARF machinery calls it.
Source
Thrown at lib/compiler-singlepass/src/dwarf.rs:104
} else {
unreachable!("Symbol {} in DWARF not recognized", symbol);
}
}
}
}
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
- Avoid DWARF debug-section generation with singlepass
- Use the LLVM backend for debug info
- Update Wasmer for potential newer support
- Implement write_offset_at in lib/compiler-singlepass/src/dwarf.rs in 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
// DWARF back-patching requires a complete writer impl: use LLVM
let backend = if requires_dwarf_backpatch { Backend::LLVM } else { Backend::Singlepass }; Try / catch
// unimplemented!() panics are not catchable; avoid by configuration (backend selection)
Prevention
- Route any debug-info compilation to the LLVM backend
- Keep singlepass usage to minimal unwind-info scenarios
- Check upstream dwarf.rs for stub methods before enabling new debug features
- Add an early config validation that rejects debug-info + singlepass combinations
When it happens
Trigger: DWARF emission that patches an offset field in place (lengths, range tables) while generating debug sections with the singlepass backend.
Common situations: Full .debug_* generation with singlepass; debug tooling triggering back-patch paths.
Related errors
- dwarf relocation size not yet supported: {}
- write_offset not yet implemented
- dwarf relocation size for personality not supported: {}
- dwarf relocation size for LSDA not supported: {}
- eh pointer encoding {eh_pe:?} not supported for symbol targe
AI-assisted analysis of wasmerio/wasmer@8c4b9ee9d3 (2026-09-01).
Data as JSON: /api/errors/b10b5f78f8cfe265.
Report an issue: GitHub.