{"record":{"id":"64e1c89d1c2ecf96","repo":"wasmerio/wasmer","slug":"symbol-in-dwarf-not-recognized","errorCode":null,"errorMessage":"Symbol {} in DWARF not recognized","messagePattern":"Symbol (.+?) in DWARF not recognized","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"lib/compiler-singlepass/src/dwarf.rs","lineNumber":87,"sourceCode":"                if symbol == Self::FUNCTION_SYMBOL {\n                    // We use the addend to detect the function index\n                    let function_index = LocalFunctionIndex::new(addend as _);\n                    let reloc_target = RelocationTarget::LocalFunc(function_index);\n                    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 u64, size)\n                } else {\n                    unreachable!(\"Symbol {} in DWARF not recognized\", symbol);\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    }","sourceCodeStart":69,"sourceCodeEnd":105,"githubUrl":"https://github.com/wasmerio/wasmer/blob/8c4b9ee9d33fb2068863fbb3d328683e7e6ff7f5/lib/compiler-singlepass/src/dwarf.rs#L69-L105","documentation":"This panic is `unreachable!(\"Symbol {} in DWARF not recognized\", symbol)` in wasmtime's singlepass backend DWARF relocation writer (`write_address`). When emitting debug info, the writer must map each relocation symbol to a known section; an unrecognized symbol means the symbol kind/section the DWARF emitter produced is not covered by the match. It indicates a mismatch between the object writer's symbol table and what singlepass's DWARF support expects.","triggerScenarios":"Generating DWARF debug info from the singlepass backend (`Config::strategy(Strategy::Singlepass)` combined with `debug_info(true)`/`generate_address_map` paths) where a relocation references a symbol (e.g. a custom/external or unrecognized section symbol) that `write_address` has no arm for.","commonSituations":"Enabling debug info with singlepass on older wasmtime versions; toolchain updates where the `object` crate emits new symbol kinds the pinned wasmtime doesn't recognize; cross-compilation setups with unusual section layouts.","solutions":["Upgrade wasmtime and the `object` crate together so symbol handling matches","Disable DWARF generation: set `debug_info(false)` on the `Config` while using singlepass","Use the Cranelift backend if you need debug info — singlepass's DWARF support is more limited","Check for mismatched versions in your lockfile between wasmtime and object-writing dependencies","Report upstream with the module and config that produced the unknown symbol"],"exampleFix":"// before\nlet mut config = Config::default();\nconfig.strategy(Strategy::Singlepass);\nconfig.debug_info(true);\n// after\nlet mut config = Config::default();\nconfig.strategy(Strategy::Singlepass);\nconfig.debug_info(false); // singlepass DWARF cannot classify this symbol","handlingStrategy":"validation","validationCode":"let mut config = wasmtime::Config::default();\nconfig.strategy(wasmtime::Strategy::Singlepass);\nconfig.debug_info(false); // avoid the singlepass DWARF writer entirely\nlet engine = Engine::new(&config)?;","typeGuard":null,"tryCatchPattern":"match build_engine() {\n    Ok(e) => e,\n    Err(e) if format!(\"{e}\").contains(\"DWARF not recognized\") => {\n        // retry without debug info\n        let mut cfg = Config::default();\n        cfg.debug_info(false);\n        Engine::new(&cfg)?\n    }\n    Err(e) => return Err(e.into()),\n}","preventionTips":["Never combine Strategy::Singlepass with debug_info(true) on older wasmtime","Use Cranelift when DWARF/address maps are required","Keep wasmtime and the `object` crate versions in lockstep in Cargo.lock","Only enable debug info in dev builds, not production singlepass deployments"],"tags":["wasmtime","singlepass","dwarf","debug-info","panic"],"backgroundTag":"unrecognized-dwarf-symbol","analyzedSha":"8c4b9ee9d33fb2068863fbb3d328683e7e6ff7f5","analyzedAt":"2026-09-01T23:06:31.009Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T06:17:21.866Z"}