{"record":{"id":"3df2f9e012736da5","repo":"tursodatabase/turso","slug":"path-is-missing-dynsym-exports-join-missing","errorCode":null,"errorMessage":"{path} is missing dynsym exports: {', '.join(missing)}","messagePattern":"(.+?) is missing dynsym exports: (.+?)","errorType":"console","errorClass":"SystemExit","httpStatus":null,"severity":"error","filePath":"bindings/dotnet/scripts/check_elf_dynsym_exports.py","lineNumber":26,"sourceCode":"TYPE = 1\nOFFSET = 4\nSIZE = 5\nLINK = 6\nENTRY_SIZE = 9\n\n\ndef main() -> None:\n    if len(sys.argv) == 2 and sys.argv[1] == \"--self-test\":\n        run_self_test()\n        return\n    if len(sys.argv) < 3:\n        raise SystemExit(\"usage: check_elf_dynsym_exports.py <elf> <symbol>...\")\n\n    path = Path(sys.argv[1])\n    needed = sys.argv[2:]\n    missing = missing_exports(path, needed)\n    if missing:\n        raise SystemExit(f\"{path} is missing dynsym exports: {', '.join(missing)}\")\n\n\ndef run_self_test() -> None:\n    import tempfile\n\n    symbol = \"turso_sync_database_new\"\n    with tempfile.NamedTemporaryFile(delete=False, suffix=\".so\") as handle:\n        handle.write(elf64_with_dynsym(symbol))\n        path = Path(handle.name)\n    try:\n        if missing_exports(path, [symbol]):\n            raise SystemExit(\"self-test failed: expected export was not found\")\n        if not missing_exports(path, [\"turso_sync_database_missing\"]):\n            raise SystemExit(\"self-test failed: missing export was not reported\")\n    finally:\n        path.unlink()\n\n","sourceCodeStart":8,"sourceCodeEnd":44,"githubUrl":"https://github.com/tursodatabase/turso/blob/492c4a71cd7c2649e7df83da1471b74f4b1c7aa9/bindings/dotnet/scripts/check_elf_dynsym_exports.py#L8-L44","documentation":"This is the script's actual failure output: the ELF file was parsed successfully but one or more required symbols are absent from its .dynsym (dynamic symbol) table, meaning the shared library does not export them for dynamic linking. The script raises SystemExit listing all missing symbols. It exists to catch broken native builds early in CI.","triggerScenarios":"Running `check_elf_dynsym_exports.py <elf> <symbol>...` where one of the listed symbols is not found in the ELF's .dynsym section; missing_exports() returns a non-empty list.","commonSituations":"A native library build dropped visibility flags (-fvisibility=hidden without exports), a linker version script stopped exporting the symbol, an API was renamed or removed in a dependency, or a stripped/incorrect artifact was shipped.","solutions":["Rebuild the native library with the symbol exported (check visibility attributes, #[no_mangle]/exports, and linker version scripts)","Verify the symbol exists with `nm -D <elf> | grep <symbol>` to confirm before blaming the checker","If the symbol was intentionally removed, update the required symbol list in the calling build/CI configuration","Ensure the correct (unstripped, fully built) artifact path is passed, not a stub or cached intermediate"],"exampleFix":"// before (Cargo.toml / build.rs)\n// symbol not exported\ncrate-type = [\"cdylib\"]\n// missing #[no_mangle] pub extern \"C\"\n// after\n#[no_mangle]\npub extern \"C\" fn turso_sync_database_new() -> *mut Database { ... }","handlingStrategy":"validation","validationCode":"import subprocess\nout = subprocess.run([\"nm\", \"-D\", elf_path], capture_output=True, text=True)\nmissing = [s for s in required_symbols if s not in out.stdout]\nassert not missing, f\"missing exports: {missing}\"","typeGuard":null,"tryCatchPattern":"try:\n    subprocess.run([\"check_elf_dynsym_exports.py\", elf, *symbols], check=True)\nexcept subprocess.CalledProcessError:\n    # inspect nm -D output, rebuild or fix export list\n    ...","preventionTips":["Keep #[no_mangle]/extern \"C\" (or equivalent) on every symbol in the required list","Run this check in CI immediately after the native build","Re-verify the symbol list whenever the native API changes","Cross-check with `nm -D <elf>` when the checker reports failures"],"tags":["elf","shared-library","symbol-visibility","ci"],"backgroundTag":"missing-symbol-export","analyzedSha":"492c4a71cd7c2649e7df83da1471b74f4b1c7aa9","analyzedAt":"2026-09-13T18:13:59.796Z","contentChangedAt":"2026-09-13T18:13:59.796Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}