简体   繁体   中英

Python - Program received signal SIGSEGV, Segmentation fault

I'm traying to lunch a python code for my degree thesis. I know it can work...but not on my pc!

I'm using Ubuntu 14.04 and first I receive this error:

segmentation fault (core dumped)

I tried to launch

gbd python (gbd) run 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:

`   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. How can I fix this segmentation fault?

Try updating to the latest gcc version. It should be fixed starting from somewhere in 4.8.2 or 4.8.3.
You could also try updating to 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 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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