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

  1. Avoid DWARF debug-section generation with singlepass
  2. Use the LLVM backend for debug info
  3. Update Wasmer for potential newer support
  4. 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

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


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