Comments (6)
This works fine for me. Can you try this:
$ gdb python
(gdb) set args yourscript.py
(gdb) run
Then when it crashes, type "bt" and report back. Could you also include the version of libmagic your using? What platform are you on?
from python-magic.
I test it on debian wheey+sid,
libmagic1==5.12-2
python-magic==0.4.3 (from pypi)
on another system (also the same repo setup but upgraded recently) the problem does not exist:
libmagic1==5.14-2 (from current sid)
python-magic==0.4.3(from pypi)
cat go.py
import magic
m1 = magic.Magic(magic_file='my.magic')
m2 = magic.Magic(magic_file='my.magic')
(gdb) set args go.py
(gdb) run
Starting program: /home/spinus/.virtualenvs/wc/bin/python go.py
warning: no loadable sections found in added symbol-file system-supplied DSO at 0x7ffff7ffa000
warning: Could not load shared library symbols for linux-vdso.so.1.
Do you need "set solib-search-path" or "set sysroot"?
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff5ecc804 in ?? () from /usr/lib/x86_64-linux-gnu/libmagic.so.1
(gdb) bt
#0 0x00007ffff5ecc804 in ?? () from /usr/lib/x86_64-linux-gnu/libmagic.so.1
#1 0x00007ffff5ecd541 in ?? () from /usr/lib/x86_64-linux-gnu/libmagic.so.1
#2 0x00007ffff5ecec2e in ?? () from /usr/lib/x86_64-linux-gnu/libmagic.so.1
#3 0x00007ffff5ecf635 in ?? () from /usr/lib/x86_64-linux-gnu/libmagic.so.1
#4 0x00007ffff694b834 in ffi_call_unix64 () from /home/spinus/.virtualenvs/wc/lib/python2.7/lib-dynload/_ctypes.so
#5 0x00007ffff694b2af in ffi_call () from /home/spinus/.virtualenvs/wc/lib/python2.7/lib-dynload/_ctypes.so
#6 0x00007ffff6938fd1 in _ctypes_callproc () from /home/spinus/.virtualenvs/wc/lib/python2.7/lib-dynload/_ctypes.so
#7 0x00007ffff6939742 in ?? () from /home/spinus/.virtualenvs/wc/lib/python2.7/lib-dynload/_ctypes.so
#8 0x00000000004acc66 in PyEval_EvalFrameEx ()
#9 0x00000000004b3fd8 in PyEval_EvalCodeEx ()
#10 0x00000000004b4c77 in ?? ()
#11 0x0000000000481cc4 in ?? ()
#12 0x0000000000460d0e in PyEval_CallObjectWithKeywords ()
#13 0x0000000000486707 in PyInstance_New ()
#14 0x00000000004acc66 in PyEval_EvalFrameEx ()
#15 0x00000000004b3fd8 in PyEval_EvalCodeEx ()
#16 0x0000000000536723 in ?? ()
#17 0x0000000000446bf2 in PyRun_FileExFlags ()
#18 0x00000000004470ec in PyRun_SimpleFileExFlags ()
#19 0x0000000000447cdc in Py_Main ()
#20 0x00007ffff6f17a55 in __libc_start_main () from /lib/x86_64-linux-gnu/libc.so.6
#21 0x00000000004c7f39 in _start ()
from python-magic.
So I'm clear, you see a crash on libmagic 5.12 but not 5.14?
from python-magic.
Yes. But I am not sure it is libmagic fault or just another component. I will try upgrade libmagic and report back here whether it helped.
from python-magic.
Were you able to figure this out?
from python-magic.
@ahupp I'm sorry but don't remember what was the resolution. I guess I can close this as it's pretty old and probably versions of all related packages are different nowadays.
from python-magic.
Related Issues (20)
- Magic can't differentiate between c++ header and source files HOT 1
- application/octet-stream with text files on windows HOT 1
- MagicException: regex error HOT 1
- Error: The specified module could not be found HOT 1
- ImportError: failed to find libmagic. Check your installation HOT 9
- Package missing from the AUR HOT 2
- Upcoming test suite breakage to to changes in file HOT 3
- 0.4.27: pytest is failing HOT 1
- Error iterating files in directories HOT 13
- UnicodeDecodeError when filename includes non ASCII characters HOT 1
- Segmentation fault when attempting to load `msys-magic-1.dll` from Git SCM HOT 2
- magic.from_file() fails for files with German umlauts in their name although Windows 10 permits such filenames HOT 1
- Binary distribution for libmagic on Windows HOT 2
- Adding libmagic to python-magic wheel on PyPI HOT 4
- Please make `from_file` work on directories HOT 5
- Add a way to specify a default for `magic_file`. HOT 1
- Magic can't get a proper mime type from a MP3 file HOT 2
- On AlmaLinux 8, corrupt .gz files no longer raise an exception HOT 2
- Please make a new release HOT 2
- Please update compat bindings from "file"
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from python-magic.