Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

binwalk/git segfault #30

Closed
ghost opened this issue Feb 26, 2014 · 3 comments
Closed

binwalk/git segfault #30

ghost opened this issue Feb 26, 2014 · 3 comments

Comments

@ghost
Copy link

ghost commented Feb 26, 2014

[I] sys-apps/file (5.17@26.02.2014)
[I] dev-lang/python (2.7.6(2.7)@04.12.2013)

gdb --args python2.7 /usr/bin/binwalk /bin/ls
GNU gdb (Gentoo 7.7 vanilla) 7.7
Copyright (C) 2014 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-pc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
http://bugs.gentoo.org/.
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 python2.7...(no debugging symbols found)...done.
(gdb) r
Starting program: /usr/bin/python2.7 /usr/bin/binwalk /bin/ls
warning: Could not load shared library symbols for linux-vdso.so.1.
Do you need "set solib-search-path" or "set sysroot"?
warning: File "/usr/lib64/libpython2.7.so.1.0-gdb.py" auto-loading has been declined by your `auto-load safe-path' set to "/home/avatar/Devel/NP1UD/debug-sysroot:/home/avatar:$debugdir:$datadir/auto-load".
To enable execution of this file add
add-auto-load-safe-path /usr/lib64/libpython2.7.so.1.0-gdb.py
line to your configuration file "/home/avatar/.gdbinit".
To completely disable this security protection add
set auto-load safe-path /
line to your configuration file "/home/avatar/.gdbinit".
For more information about this security protection see the
"Auto-loading safe path" section in the GDB manual. E.g., run from the shell:
info "(gdb)Auto-loading safe path"
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
[New Thread 0x7ffff6339700 (LWP 15228)]
WARNING: Failed to load plugin module 'compressd': Failed to locate library 'compress42'
WARNING: Failed to load plugin module 'zlibvalid': Failed to locate library 'tinfl'
WARNING: Failed to load plugin module 'compressd': Failed to locate library 'compress42'
WARNING: Failed to load plugin module 'zlibvalid': Failed to locate library 'tinfl'

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff5867057 in ?? () from /usr/lib64/libmagic.so.1
(gdb) bt
#0 0x00007ffff5867057 in ?? () from /usr/lib64/libmagic.so.1
#1 0x00007ffff5861143 in ?? () from /usr/lib64/libmagic.so.1
#2 0x00007ffff7e1b6e4 in ffi_call_unix64 () from /usr/lib64/libffi.so.6
#3 0x000000000000000a in ?? ()
#4 0x00007fffffff9c60 in ?? ()
#5 0x00007fffffff9bf0 in ?? ()
#6 0x00007ffff7e1b275 in ffi_call () from /usr/lib64/libffi.so.6

Backtrace stopped: previous frame inner to this frame (corrupt stack?)

@devttys0
Copy link
Collaborator

Interesting; based on the output it looks like libmagic is segfaulting during its initialization. What version of libmagic do you have installed on your system?

Also, how did you install binwalk, as it seems that not all components were installed properly (namely libcompress42 and libtinfl seem to be missing)?

@devttys0
Copy link
Collaborator

devttys0 commented Apr 9, 2014

Any word on this? I have not been able to reproduce this on either 32 or 64 bit systems.

@devttys0
Copy link
Collaborator

Was able to reproduce the issue on a Mac; this was caused by improper handling of the magic_open return value in binwalk's ctypes wrapper (though it seems to work on some systems). The code in the master branch has been patched appropriately.

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

No branches or pull requests

1 participant