简体   繁体   English

Python-程序收到信号SIGSEGV,分段错误

[英]Python - Program received signal SIGSEGV, Segmentation fault

I'm traying to lunch a python code for my degree thesis. 我正在为学位论文准备一个python代码午餐。 I know it can work...but not on my pc! 我知道它可以工作...但是不能在我的电脑上!

I'm using Ubuntu 14.04 and first I receive this error: 我正在使用Ubuntu 14.04,首先收到此错误:

segmentation fault (core dumped) 分段错误(核心已转储)

I tried to launch 我试图发射

gbd python (gbd) run MainLogic.py gbd python(gbd)运行MainLogic.py

Here the result: 结果如下:

Starting program: /usr/bin/python MainLogic.py
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Traceback (most recent call last):
  File "/usr/share/gdb/auto-load/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.19-gdb.py", line 63, in <module>
    from libstdcxx.v6.printers import register_libstdcxx_printers
ImportError: No module named 'libstdcxx'
[New Thread 0x7fffe13a9700 (LWP 10347)]
[New Thread 0x7fffda0a4700 (LWP 10349)]
[New Thread 0x7fffcfc29700 (LWP 10350)]
[New Thread 0x7fffcf428700 (LWP 10351)]
[New Thread 0x7fffcec27700 (LWP 10352)]
[New Thread 0x7fffce426700 (LWP 10353)]
[New Thread 0x7fffcdc25700 (LWP 10354)]
[New Thread 0x7fffcd424700 (LWP 10355)]
[New Thread 0x7fffccc23700 (LWP 10356)]
[New Thread 0x7fffb7fff700 (LWP 10357)]

Program received signal SIGSEGV, Segmentation fault.
0x00007fffd1f0f379 in convert_to_IplImage (dst=<synthetic pointer>, 
    o=<numpy.ndarray at remote 0x2169870>, o@entry=< at remote 0x21672d0>)
    at main.cpp:255
255     if (PyString_Check(ipl->data)) {

After I launched the command ""bt" for the backtraking: 在启动用于回溯的命令““ bt”之后:

`   0x00007fffd1f0f379 in convert_to_IplImage (dst=<synthetic pointer>, 
o=<numpy.ndarray at remote 0x2169870>, o@entry=< at remote 0x21672d0>)
at main.cpp:255

SetCvImage (o=o@entry=<numpy.ndarray at remote 0x2169870>,api=0x21672d0)
at main.cpp:285

0x00007fffd1ec11c0 in _wrap_SetCvImage (args=<optimized out>)
at tesseract_wrap.cpp:158558

0x000000000049968d in call_function (oparg=<optimized out>, 
pp_stack=0x7fffffffd210) at ../Python/ceval.c:4020

PyEval_EvalFrameEx (
f=f@entry=Frame 0xa04db0, for file /home/mypc/Model/image.py, line 404, in Methods_Text_Recognition_Based_Analysis_cc (self=<Image(max_tink_wall=0, numberDoors=0, image_run_pixel=None, file_name='13.png', list_door=[], labels=<numpy.ndarray at remote 0x14f9e90>, height=717, image_rect=None, graph_wall=<Graph(_nodes=[], _indices={}) at remote 0x7fffd23cef10>, color_image=<numpy.ndarray at remote 0x14db170>, dic_scale={}, list_cc=[<CC(numPixel=29, list_obl=[], list_rect=[], y_min=1, list_print_obl=[], image=<numpy.ndarray at remote 0xebaab0>, y_max=17, height=17, width=6, x_max=183, x_min=178, image_dist_tran=<numpy.ndarray at remote 0x1abb480>, id=1) at remote 0x7fffd0204cf8>, <CC(numPixel=78, list_obl=[], list_rect=[], y_min=1, list_print_obl=[], image=<numpy.ndarray at remote 0x1ab0940>, y_max=17, height=17, width=14, x_max=252, x_min=239, image_dist_tran=<numpy.ndarray at remote 0x1abb580>, id=2) at remote 0x7fffd0204dd0>, <CC(numPixel=95, list_obl=[], list_rect=[], y_min=1, list_print_..`

Perhaps there is something wrong in my packages and my Ubuntu setup, because in other pc the code works fine. 也许我的软件包和Ubuntu安装程序有问题,因为在其他PC上,代码可以正常工作。 How can I fix this segmentation fault? 如何解决此细分错误?

Try updating to the latest gcc version. 尝试更新到最新的gcc版本。 It should be fixed starting from somewhere in 4.8.2 or 4.8.3. 它应该从4.8.2或4.8.3中的某个位置开始固定。
You could also try updating to gcc 5.*. 您也可以尝试更新到gcc 5. *。

If neither of those don't work, you could try the hackish way of patching /libstdc++-v3/python/hook.in, as described here . 如果没有那些不工作,你可以尝试修补/libstdc++-v3/python/hook.in,如所描述的hackish的方式在这里

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM