Python分割错误是由魔杖引起的吗?

时间:2019-02-05 14:20:02

标签: python-3.x segmentation-fault wand

我有一个导致细分错误的python代码

我需要带一组pdf文档,获取首页并将其另存为图像。

这是导致细分错误的代码的相关部分

if not isfile(join(images_path,d+'.jpg')):
    try:
        with Image(filename=join(docs_path,d+'.pdf[0]')) as img:
             img.save(filename=join(images_path,d+'.jpg'))
    except:
        pass

这是调试器的输出

0x00007fffd6f613a6 in ?? ()
   from /home/.../anaconda3/lib/python3.6/site-packages/numpy/core/../../../../libmkl_intel_lp64.so
(gdb) backtrace
#0  0x00007fffd6f613a6 in ?? ()
   from /home/.../anaconda3/lib/python3.6/site-packages/numpy/core/../../../../libmkl_intel_lp64.so
#1  0x00007fffdcfffcf1 in ?? () from /usr/lib/libgs.so.9
#2  0x00007fffdd000df4 in gs_interpret () from /usr/lib/libgs.so.9
#3  0x00007fffdcff3c11 in ?? () from /usr/lib/libgs.so.9
#4  0x00007fffdcff4105 in gs_main_init2aux () from /usr/lib/libgs.so.9
#5  0x00007fffdcff46c4 in gs_main_init2 () from /usr/lib/libgs.so.9
#6  0x00007fffdcff5d09 in ?? () from /usr/lib/libgs.so.9
#7  0x00007fffdcff6512 in ?? () from /usr/lib/libgs.so.9
#8  0x00007fffdcff752b in gs_main_init_with_args () from /usr/lib/libgs.so.9
#9  0x00007ffff7504eca in ?? () from /usr/lib/ImageMagick-7.0.8/modules-Q16HDRI/coders/pdf.so
#10 0x00007fffe2c1a335 in ReadImage () from /usr/lib/libMagickCore-7.Q16HDRI.so.6
#11 0x00007fffe2f175dd in MagickReadImage () from /usr/lib/libMagickWand-7.Q16HDRI.so.6
#12 0x00007ffff24b89fc in ffi_call_unix64 ()
   from /home/.../anaconda3/lib/python3.6/lib-dynload/../../libffi.so.6
#13 0x00007ffff24b81a2 in ffi_call () from /home/.../anaconda3/lib/python3.6/lib-dynload/../../libffi.so.6
#14 0x00007ffff26ccdae in _ctypes_callproc ()
   from /home/.../anaconda3/lib/python3.6/lib-dynload/_ctypes.cpython-36m-x86_64-linux-gnu.so
#15 0x00007ffff26cd7e5 in PyCFuncPtr_call ()
   from /home/.../anaconda3/lib/python3.6/lib-dynload/_ctypes.cpython-36m-x86_64-linux-gnu.so
#16 0x0000555555663bcb in _PyObject_FastCallDict ()
#17 0x00005555556f0f4e in call_function ()
#18 0x000055555571594a in _PyEval_EvalFrameDefault ()
#19 0x00005555556ea206 in _PyEval_EvalCodeWithName ()
#20 0x00005555556eb1cf in fast_function ()
#21 0x00005555556f0ed5 in call_function ()
#22 0x0000555555716715 in _PyEval_EvalFrameDefault ()
#23 0x00005555556ea4c6 in _PyEval_EvalCodeWithName ()
#24 0x00005555556eb897 in _PyFunction_FastCallDict ()
#25 0x0000555555663daf in _PyObject_FastCallDict ()
#26 0x0000555555668a73 in _PyObject_Call_Prepend ()
#27 0x00005555556637ee in PyObject_Call ()
#28 0x00005555556beefb in slot_tp_init ()
#29 0x00005555556f1137 in type_call ()
#30 0x0000555555663bcb in _PyObject_FastCallDict ()
#31 0x00005555556eb48a in _PyObject_FastCallKeywords ()
#32 0x00005555556f0f4e in call_function ()
#33 0x0000555555716715 in _PyEval_EvalFrameDefault ()
#34 0x00005555556ebcb9 in PyEval_EvalCodeEx ()
#35 0x00005555556eca4c in PyEval_EvalCode ()
#36 0x0000555555768c44 in run_mod ()
#37 0x0000555555769041 in PyRun_FileExFlags ()
#38 0x0000555555769244 in PyRun_SimpleFileExFlags ()
#39 0x000055555576cd24 in Py_Main ()
#40 0x000055555563475e in main ()

知道为什么会这样。

我的python版本:Python 3.6.6 :: Anaconda自定义(64位)

0 个答案:

没有答案