且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

C调用Python的崩溃

更新时间:2022-08-13 11:26:04

这个崩溃真奇怪:程序能运行;很快崩溃。

[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `./gh_manager thread false 1'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x00007f18981059de in PyEval_EvalCodeEx ()
   from /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0
[Current thread is 1 (Thread 0x7f18638b1700 (LWP 30220))]
(gdb) backtrace
#0  0x00007f18981059de in PyEval_EvalCodeEx ()
   from /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0
#1  0x00007f189805c3b0 in ?? ()
   from /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0
#2  0x00007f189802f2b3 in PyObject_Call ()
   from /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0
#3  0x00007f1898105547 in PyEval_CallObjectWithKeywords ()
   from /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0
#4  0x00007f189a36d24d in PythonClass::python_function (this=0x7f17e80008c0, 
    pInput=0x7f17eaf3c660, pOutput=0x7f18638af4f0, frame_id=120)
    at gh_python.cpp:252