-
Notifications
You must be signed in to change notification settings - Fork 14
Description
Hi,
A rhabdomancer user has reported the following problem on their Arch Linux x86_64 system:
export IDASDKDIR=/opt/ida-pro-9.0/idasdk90
cargo install rhabdomancer
rhabdomancer --help
rhabdomancer: error while loading shared libraries: [libida.so](http://libida.so/): cannot open shared object file: No such file or directory
...
fd [libida.so](http://libida.so/) /opt/ida-pro-9.0
/opt/ida-pro-9.0/idasdk90/lib/x64_linux_gcc_64/libida.so
/opt/ida-pro-9.0/libida.so
I could quickly reproduce it on a Kali Linux x86_64 VM. This was caused by the fact that the /opt/ida-pro-9.0/idasdk90/lib/x64_linux_gcc_64/
path wasn't present in ld.so.conf
. It's easily fixed by adding such entry and running ldconfig -v
again. Perhaps we should add this gotcha to the documentation? Or should we force rustc to build a static binary? What do you think?
After I worked around this problem, I unfortunately spotted a more serious issue with the latest idalib:
kali@kali:~/idalib$ export IDASDKDIR=/home/kali/Desktop/idasdk90/
kali@kali:~/idalib$ cargo run --example=comments_ls
Compiling autocxx-build v0.27.0
Compiling idalib-build v0.3.0+9.0.240925 (/home/kali/idalib/idalib-build)
Compiling autocxx v0.27.0
Compiling idalib-sys v0.3.0+9.0.240925 (/home/kali/idalib/idalib-sys)
Compiling idalib v0.3.0+9.0.240925 (/home/kali/idalib/idalib)
Finished `dev` profile [unoptimized + debuginfo] target(s) in 48.95s
Running `target/debug/examples/comments_ls`
Trying to open IDA database...
zsh: segmentation fault (core dumped) cargo run --example=comments_ls
...
kali@kali:~/idalib$ gdb ./target/debug/examples/comments_ls core.1630393
GNU gdb (Debian 15.2-1) 15.2
Copyright (C) 2024 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./target/debug/examples/comments_ls...
[New LWP 1630393]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `target/debug/examples/comments_ls'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0 idalib_check_license () at src/kernwin_extras.h:90
90 auto res = manager->_vtbl->check(manager, 0, 0);
warning: Missing auto-load script at offset 0 in section .debug_gdb_scripts
of file /home/kali/idalib/target/debug/examples/comments_ls.
Use `info auto-load python-scripts [REGEXP]' to list them.
(gdb) bt
#0 idalib_check_license () at src/kernwin_extras.h:90
#1 0x0000559f3027eb94 in cxxbridge1$idalib_check_license () at /home/kali/idalib/target/debug/build/idalib-sys-c1c136a50975a2a4/out/autocxx-build-dir/cxx/gen2.cxx:867
#2 0x0000559f3027c6d7 in idalib_sys::ffix::idalib_check_license () at idalib-sys/src/lib.rs:738
#3 0x0000559f3027d6d0 in idalib_sys::ida::is_license_valid () at idalib-sys/src/lib.rs:1192
#4 0x0000559f30277489 in idalib_sys::ida::open_database_quiet<&std::path::Path> (path=..., auto_analysis=true) at idalib-sys/src/lib.rs:1293
#5 0x0000559f30276ca1 in idalib::idb::IDB::open_with<&str> (path=..., auto_analyse=true, save=false) at idalib/src/idb.rs:57
#6 0x0000559f30276842 in idalib::idb::IDB::open<&str> (path=...) at idalib/src/idb.rs:46
#7 0x0000559f3027291e in comments_ls::main () at idalib/examples/comments_ls.rs:7
(gdb)
Not sure if this is caused by the floating license or if this happens also with other (more common) configurations. Also not sure if this is specific to the latest idalib version or if it was present also in (some) earlier releases. The segmentation fault happens regardless of the presence of a valid license or not.
I don't have a Linux x86_64 VM handy for testing at the moment, but I can provide you with the coredump file for debugging and I'm available in case you need additional details.