wasmerio/wasmer · error

write_offset not yet implemented

Error message

write_offset not yet implemented

What it means

Stub gimli::Writer::write_offset in the singlepass DWARF writer: emitting a section-relative offset is not implemented and panics, meaning full DWARF debug sections are not supported by the singlepass backend.

Source

Thrown at lib/compiler-singlepass/src/dwarf.rs:94

                        _ => unimplemented!("dwarf relocation size not yet supported: {}", size),
                    };
                    let addend = 0;
                    self.relocs.push(Relocation {
                        kind,
                        reloc_target,
                        offset,
                        addend,
                    });
                    self.write_udata(addend as u64, size)
                } 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 to check for newer DWARF support
  4. Implement write_offset in lib/compiler-singlepass/src/dwarf.rs in a fork

Example fix

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

Strategy: fallback

Validate before calling

// Full DWARF sections are not supported by singlepass — pick LLVM
let backend = if needs_debug_info { Backend::LLVM } else { Backend::Singlepass };

Try / catch

// unimplemented!() panics are not catchable; select the LLVM backend for DWARF workloads instead

Prevention

When it happens

Trigger: Any DWARF-emission path (e.g. .debug_info construction) that calls write_offset while compiling with the singlepass backend.

Common situations: Requesting full debug-info generation with singlepass; tooling that writes debug sections rather than just eh_frame.

Related errors


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