Skip to content

fix: swap ida/idalib link order to fix macOS SIGSEGV#22

Merged
0xeb merged 1 commit into
mainfrom
fix/macos-idalib-link-order
Mar 5, 2026
Merged

fix: swap ida/idalib link order to fix macOS SIGSEGV#22
0xeb merged 1 commit into
mainfrom
fix/macos-idalib-link-order

Conversation

@0xeb

@0xeb 0xeb commented Mar 5, 2026

Copy link
Copy Markdown
Member

Summary

  • Swap IDA_LIB_PATH before IDALIB_PATH in the idasdk::idalib target link order to fix a SIGSEGV crash on macOS

Problem

Both stub dylibs (libida.dylib and libidalib.dylib in lib/arm64_mac_clang_64/) export 184 overlapping symbols including qvector_reserve, qalloc_or_throw, qfree, and qsnprintf. With libidalib listed first, the macOS linker binds these symbols to it via two-level namespaces.

At runtime, the real libidalib.dylib (1.4MB) does not export these symbols — only libida.dylib does. The dyld lazy resolver fails silently, resolving all four IDA memory functions to a garbage fallback address (0x19bb0a6f8), causing SIGSEGV on any qstring construction.

Verified with DYLD_PRINT_BINDINGS=1:

# BEFORE (broken): all resolve to same <none> address
<idasql/bind#459> -> 0x19bb0a6f8 <<none>/_qvector_reserve>

# AFTER (fixed): correctly resolve from libida
<idasql/bind#459> -> 0x106fdd3f0 <libida.dylib/_qvector_reserve>

Test plan

  • qstring construction no longer crashes
  • All idasql virtual tables work (welcome, funcs, segments, etc.)
  • HTTP server mode works end-to-end
  • Harmless on Linux/Windows (flat namespace / explicit import libs)

🤖 Generated with Claude Code

Both stub dylibs export overlapping symbols (qvector_reserve,
qalloc_or_throw, qfree, qsnprintf — 184 total), but at runtime
only libida.dylib actually provides them. With idalib listed first,
the macOS two-level namespace linker binds these symbols to
libidalib, which doesn't export them at runtime. This causes all
IDA memory functions to resolve to a dyld fallback address,
resulting in SIGSEGV on any qstring construction.

Fix: link libida before libidalib so overlapping symbols bind
to the library that actually exports them.
@0xeb 0xeb force-pushed the fix/macos-idalib-link-order branch from 325ebfd to 6bc371c Compare March 5, 2026 16:58
@0xeb 0xeb merged commit 0f69f60 into main Mar 5, 2026
0xeb added a commit to HexRaysSA/ida-sdk that referenced this pull request Mar 5, 2026
Updates ida-cmake to allthingsida/ida-cmake#22 which swaps the
ida/idalib link order in idasdk::idalib to fix SIGSEGV on macOS.
adybov-hexrays pushed a commit to HexRaysSA/ida-sdk that referenced this pull request Mar 13, 2026
Updates ida-cmake to allthingsida/ida-cmake#22 which swaps the
ida/idalib link order in idasdk::idalib to fix SIGSEGV on macOS.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant