Giter VIP home page Giter VIP logo

Comments (6)

ahupp avatar ahupp commented on May 22, 2024

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.

spinus avatar spinus commented on May 22, 2024

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.

ahupp avatar ahupp commented on May 22, 2024

So I'm clear, you see a crash on libmagic 5.12 but not 5.14?

from python-magic.

spinus avatar spinus commented on May 22, 2024

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.

ahupp avatar ahupp commented on May 22, 2024

Were you able to figure this out?

from python-magic.

spinus avatar spinus commented on May 22, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.