{"record":{"id":"ad965e41c80c1364","repo":"wasmerio/wasmer","slug":"dwarf-relocation-size-for-personality-not-supporte","errorCode":null,"errorMessage":"dwarf relocation size for personality not supported: {}","messagePattern":"dwarf relocation size for personality not supported: (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"lib/compiler-cranelift/src/dwarf.rs","lineNumber":103,"sourceCode":"                    let offset = self.len() as u32;\n                    let kind = match size {\n                        8 => RelocationKind::Abs8,\n                        _ => unimplemented!(\"dwarf relocation size not yet supported: {}\", size),\n                    };\n                    let addend = 0;\n                    self.relocs.push(Relocation {\n                        kind,\n                        reloc_target,\n                        offset,\n                        addend,\n                    });\n                    self.write_udata(addend as _, size)\n                } else if symbol == Self::PERSONALITY_SYMBOL {\n                    let offset = self.len() as u32;\n                    let kind = match size {\n                        4 => RelocationKind::Abs4,\n                        8 => RelocationKind::Abs8,\n                        other => unimplemented!(\n                            \"dwarf relocation size for personality not supported: {}\",\n                            other\n                        ),\n                    };\n                    self.relocs.push(Relocation {\n                        kind,\n                        reloc_target: RelocationTarget::LibCall(LibCall::EHPersonality),\n                        offset,\n                        addend,\n                    });\n                    self.write_udata(0, size)\n                } else if let Some((target, base)) = self.lsda_symbols.get(&symbol) {\n                    let offset = self.len() as u32;\n                    let kind = match size {\n                        4 => RelocationKind::Abs4,\n                        8 => RelocationKind::Abs8,\n                        other => unimplemented!(\n                            \"dwarf relocation size for LSDA not supported: {}\",","sourceCodeStart":85,"sourceCodeEnd":121,"githubUrl":"https://github.com/wasmerio/wasmer/blob/8c4b9ee9d33fb2068863fbb3d328683e7e6ff7f5/lib/compiler-cranelift/src/dwarf.rs#L85-L121","documentation":"Wasmer's cranelift compiler DWARF writer (an unwinding/WASM_EXCEPTION/EH-frame writer) only supports 4- and 8-byte absolute relocations when emitting a pointer to the personality routine (__gxx_personality_v0). Any other pointer size requested by the gimli/write dwarf writer hits this unimplemented!() panic. It signals an unsupported DWARF relocation size, not a user bug in normal use.","triggerScenarios":"Writing .eh_frame sections where the personality symbol pointer is requested with a size other than 4 or 8 bytes (e.g. a DW_EH_PE encoding with an unusual byte width) during module compilation with the cranelift compiler and exception/unwind info generation enabled.","commonSituations":"Compiling Wasm that uses exception handling (wasm EH / legacy EH) on a target with unusual pointer widths; enabling debug/unwind-info generation on experimental targets; hitting a genuinely unimplemented code path in a non-x86_64/aarch64 host target.","solutions":["Update Wasmer to the latest version, as DWARF/EH support is actively extended","Compile for a mainstream target (x86_64 or aarch64) where 4/8-byte pointer sizes are used","Disable exception-handling features in the Wasm module (strip wasm EH sections) or disable unwind-info generation in the compiler config","Switch compilers (e.g. use singlepass or llvm) if EH support is required"],"exampleFix":"// before\nlet kind = match size {\n    4 => RelocationKind::Abs4,\n    8 => RelocationKind::Abs8,\n    other => unimplemented!(\"dwarf relocation size for personality not supported: {}\", other),\n};\n// after\nlet kind = match size {\n    4 => RelocationKind::Abs4,\n    8 => RelocationKind::Abs8,\n    2 => RelocationKind::Abs2, // implement the missing size instead of panicking\n    other => return Err(CompileError::Codegen(format!(\"unsupported personality reloc size: {}\", other))),\n};","handlingStrategy":"validation","validationCode":"// Before compiling with cranelift + EH, restrict to mainstream 64-bit targets\nfn supports_cranelift_eh(triple: &wasmer::Target) -> bool {\n    matches!(triple.triple().architecture(),\n        wasmer_types::Architecture::X86_64 | wasmer_types::Architecture::Aarch64(_))\n}\nif !supports_cranelift_eh(&target) { /* switch backend or disable EH */ }","typeGuard":"fn is_supported_ptr_size(size: u8) -> bool { size == 4 || size == 8 }","tryCatchPattern":null,"preventionTips":["Pin to mainstream x86_64/aarch64 targets when using cranelift with exception handling","Keep Wasmer updated; DWARF/EH support grows over time","Disable unwind-info/EH generation unless needed","Test compilation of EH-enabled wasm modules in CI for each target you ship"],"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"}