{"record":{"id":"8d445231c0cbdcbc","repo":"wasmerio/wasmer","slug":"write-offset-not-yet-implemented","errorCode":null,"errorMessage":"write_offset not yet implemented","messagePattern":"write_offset not yet implemented","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"lib/compiler-cranelift/src/dwarf.rs","lineNumber":158,"sourceCode":"        &mut self,\n        address: Address,\n        eh_pe: constants::DwEhPe,\n        size: u8,\n    ) -> Result<()> {\n        if eh_pe == constants::DW_EH_PE_absptr {\n            self.write_address(address, size)\n        } else {\n            match address {\n                Address::Constant(_) => self.writer.write_eh_pointer(address, eh_pe, size),\n                Address::Symbol { .. } => {\n                    unimplemented!(\"eh pointer encoding {eh_pe:?} not supported for symbol targets\")\n                }\n            }\n        }\n    }\n\n    fn write_offset(&mut self, _val: usize, _section: SectionId, _size: u8) -> Result<()> {\n        unimplemented!(\"write_offset not yet implemented\");\n    }\n\n    fn write_offset_at(\n        &mut self,\n        _offset: usize,\n        _val: usize,\n        _section: SectionId,\n        _size: u8,\n    ) -> Result<()> {\n        unimplemented!(\"write_offset_at not yet implemented\");\n    }\n}\n","sourceCodeStart":140,"sourceCodeEnd":171,"githubUrl":"https://github.com/wasmerio/wasmer/blob/8c4b9ee9d33fb2068863fbb3d328683e7e6ff7f5/lib/compiler-cranelift/src/dwarf.rs#L140-L171","documentation":"The trait impl of gimli::Writer::write_offset for the cranelift DWARF writer is a stub; any attempt by the dwarf-writing machinery to emit a section-relative offset panics. This means full DWARF debug-section emission is not implemented for the cranelift backend.","triggerScenarios":"Emitting debug sections (e.g. .debug_info, .debug_ranges) that require write_offset — i.e. any DWARF generation path that needs a section-relative offset rather than an absolute address, during cranelift compilation.","commonSituations":"Requesting DWARF/debug info generation with the cranelift engine; tooling that asks for full debug sections rather than just eh_frame.","solutions":["Do not request full DWARF debug info with the cranelift backend","Use the LLVM backend when DWARF debug sections are needed","Update Wasmer and check whether write_offset has since been implemented","Implement write_offset in dwarf.rs if you maintain a fork"],"exampleFix":"// before\nfn write_offset(&mut self, _val: usize, _section: SectionId, _size: u8) -> Result<()> {\n    unimplemented!(\"write_offset not yet implemented\");\n}\n// after\nfn write_offset(&mut self, val: usize, _section: SectionId, size: u8) -> Result<()> {\n    self.write_udata(val, size); // or return a proper unsupported error\n    Ok(())\n}","handlingStrategy":"fallback","validationCode":"// Choose backend based on debug-info needs\nlet backend = if needs_full_dwarf { Backend::LLVM } else { Backend::Cranelift };","typeGuard":null,"tryCatchPattern":"// Cranelift panics (unimplemented!) — cannot be caught in Rust; prevent by config\nif needs_debug_info {\n    panic mitigation: build engine with LLVM instead of Cranelift before compilation\n}","preventionTips":["Never request full DWARF debug sections from the cranelift backend","Use LLVM for debug-info builds","Keep cranelift use limited to eh_frame/unwind info it supports","Add CI checks asserting no debug-info flags are set with cranelift"],"tags":["rust","cranelift","dwarf","unimplemented"],"backgroundTag":"unimplemented-dwarf-relocation","analyzedSha":"8c4b9ee9d33fb2068863fbb3d328683e7e6ff7f5","analyzedAt":"2026-09-01T23:06:31.009Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T06:17:21.866Z"}