-1

When I write the following statement in my python code, I receive a segmentation fault.

>>> import moviepy.editor
Segmentation fault (core dumped)

What's wrong with this?

os: ubuntu 16.04
python: 3.6
moviepy: 0.2.3.2
ffmpeg: 3.3.4

Update

I now try to debug it with gdb:

$ gdb
(gdb) file python
Reading symbols from python...done.
(gdb) run test.py 

Starting program: /home/ubuntu/anaconda3/bin/python test.py
[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.
PyType_IsSubtype (a=0x626f6174656d5f74, b=0x7fffd9df0640 <sipVoidPtr_Type>) at Objects/typeobject.c:1357
1357    Objects/typeobject.c: No such file or directory.

(gdb) bt
#0  PyType_IsSubtype (a=0x626f6174656d5f74, b=0x7fffd9df0640 <sipVoidPtr_Type>) at Objects/typeobject.c:1357
#1  0x00007fffd9be7221 in vp_convertor () from /home/ubuntu/anaconda3/lib/python3.6/site-packages/sip.so
#2  0x00007fffd9be7ab5 in sip_api_convert_to_void_ptr ()
   from /home/ubuntu/anaconda3/lib/python3.6/site-packages/sip.so
#3  0x00007fffd98df29d in qpycore_init() ()
   from /home/ubuntu/anaconda3/lib/python3.6/site-packages/PyQt5/QtCore.so
#4  0x00007fffd98c8b44 in PyInit_QtCore ()
   from /home/ubuntu/anaconda3/lib/python3.6/site-packages/PyQt5/QtCore.so
#5  0x00007ffff7a3e55b in _PyImport_LoadDynamicModuleWithSpec (spec=0x7fffda0807f0,
    fp=0x7fffd98c8a60 <PyInit_QtCore>) at ./Python/importdl.c:154
#6  0x00007ffff7a3b33f in _imp_create_dynamic_impl (file=<optimized out>, spec=0x7fffda0807f0,
    module=<optimized out>) at Python/import.c:2004
#7  _imp_create_dynamic (module=<optimized out>, args=<optimized out>) at Python/clinic/import.c.h:289
#8  0x00007ffff7994ca9 in PyCFunction_Call (func=0x7ffff69c8f78, args=0x7fffda080438, kwds=<optimized out>)
    at Objects/methodobject.c:114
#9  0x00007ffff7a20b3c in do_call_core (kwdict=0x7fffda085ee8, callargs=<optimized out>, func=0x7ffff69c8f78)
    at Python/ceval.c:5053
#10 _PyEval_EvalFrameDefault (f=<optimized out>, throwflag=<optimized out>) at Python/ceval.c:3357
#11 0x00007ffff7a184c0 in _PyEval_EvalCodeWithName (_co=0x7ffff7e2de40, globals=<optimized out>,
    locals=<optimized out>, args=<optimized out>, argcount=2, kwnames=0x0, kwargs=0x7fffe2c05590, kwcount=0,
    kwstep=1, defs=0x0, defcount=0, kwdefs=0x0, closure=0x0, name=0x7ffff69ab8f0, qualname=0x7ffff69ab8f0)
    at Python/ceval.c:4119
#12 0x00007ffff7a19eea in fast_function (kwnames=<optimized out>, nargs=2, stack=<optimized out>,
    func=0x7ffff7e18ea0) at Python/ceval.c:4929
#13 call_function (pp_stack=0x7fffffff4588, oparg=<optimized out>, kwnames=<optimized out>)
    at Python/ceval.c:4809
#14 0x00007ffff7a1cbbd in _PyEval_EvalFrameDefault (f=<optimized out>, throwflag=<optimized out>)
    at Python/ceval.c:3275
---Type <return> to continue, or q <return> to quit---

test.py(only 1 line):

import moviepy.editor
gaudi08
  • 21
  • 1
  • 6
  • 1
    Welcome to Stack Overflow! Please take some time to read the help page, especially the sections [Stack Overflow question checklist](http://meta.stackexchange.com/q/156810/204922). You might also want to learn about [Minimal, Complete, and Verifiable Examples](http://meta.stackexchange.com/q/156810/204922) – Guenther Sep 29 '17 at 16:22
  • Add some stacktrace to your opening post, but if you don’t have any try just importing moviepy does it gives segmentation fault if not try to `from moviepy import editor` if it errors our locate the editor module and add breakpoint using `pdb` Debugger. i.e. `pdb.set_trace()` then try importing again and you will land at where you added breakpoint. Check the value of variable to debug it. – Ciasto piekarz Oct 01 '17 at 18:13
  • I tried to debug it with pdb, but I received the same error message(`segmentation fault (core dumped) python -m pdb test.py`). So I used gdb for debug. – gaudi08 Oct 02 '17 at 09:52

1 Answers1

0

Solution: It looked like there was a problem with the SIP package in the gdb debug log. So, I updated the SIP package and the problem was solved.

gaudi08
  • 21
  • 1
  • 6