{"record":{"id":"8dedd656db2e95ac","repo":"wasmerio/wasmer","slug":"dwarf-relocation-size-for-lsda-not-supported","errorCode":null,"errorMessage":"dwarf relocation size for LSDA not supported: {}","messagePattern":"dwarf relocation size for LSDA not supported: (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"lib/compiler-cranelift/src/dwarf.rs","lineNumber":120,"sourceCode":"                        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: {}\",\n                            other\n                        ),\n                    };\n                    self.relocs.push(Relocation {\n                        kind,\n                        reloc_target: *target,\n                        offset,\n                        addend: *base as i64 + addend,\n                    });\n                    self.write_udata(0, size)\n                } else {\n                    unreachable!(\"Symbol {} in DWARF not recognized\", symbol);\n                }\n            }\n        }\n    }\n","sourceCodeStart":102,"sourceCodeEnd":138,"githubUrl":"https://github.com/wasmerio/wasmer/blob/8c4b9ee9d33fb2068863fbb3d328683e7e6ff7f5/lib/compiler-cranelift/src/dwarf.rs#L102-L138","documentation":"Same DWARF writer as error 190, but for the LSDA (Language Specific Data Area) symbol: when writing an .eh_frame pointer to an LSDA target, only Abs4/Abs8 relocations are implemented; any other size panics with unimplemented!().","triggerScenarios":"Writing .eh_frame LSDA pointers during cranelift compilation of modules with exception handling, when the requested relocation size is not 4 or 8 bytes.","commonSituations":"Compiling wasm-EH modules on unusual targets; experimental DWARF encodings with non-standard pointer sizes; building custom targets where the eh-frame writer requests smaller/larger widths.","solutions":["Update Wasmer to a newer release","Use a mainstream target (x86_64/aarch64) where 4/8-byte LSDA pointers are standard","Disable wasm exception handling or unwind-info generation in the compile pipeline","Switch to the LLVM compiler backend which has fuller DWARF support"],"exampleFix":"// before\nlet kind = match size {\n    4 => RelocationKind::Abs4,\n    8 => RelocationKind::Abs8,\n    other => unimplemented!(\"dwarf relocation size for LSDA not supported: {}\", other),\n};\n// after\nlet kind = match size {\n    4 => RelocationKind::Abs4,\n    8 => RelocationKind::Abs8,\n    other => return Err(CompileError::Codegen(format!(\"unsupported LSDA reloc size: {}\", other))),\n};","handlingStrategy":"validation","validationCode":"// Guard: only attempt LSDA-emitting EH compilation on 64-bit mainstream targets\nlet arch = target.triple().architecture;\nassert!(matches!(arch, Architecture::X86_64 | Architecture::Aarch64(_)), \"cranelift LSDA reloc only supports 4/8-byte sizes\");","typeGuard":"fn is_supported_lsda_size(size: u8) -> bool { size == 4 || size == 8 }","tryCatchPattern":null,"preventionTips":["Avoid wasm-EH modules with cranelift on non-mainstream targets","Prefer the LLVM backend when DWARF/EH fidelity matters","Keep the compiler updated","Validate target triples before engine creation"],"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"}