/**
* This sets the C var "index".
*/
static void api_set(PyObject* /*self*/, PyObject *arg)
{
if (!PyInt_Check(arg)) {
PyErr_SetString(PyExc_TypeError,
"int argument expected in param.api_set()");
}
int32 index = (int32)PyInt_AsLong(arg);
//std::cout << "set param: " << index << std::endl; //#for release build, comment out this line then program will crash
C_interfaceClass.INDEX = index;
}
我的情况是:
下面是堆栈:
Thread 1 (Thread 0x7ffff7f8a7c0 (LWP 13723)):
#0 0x00007fffe635286d in waitpid () from /lib64/libc.so.6
#1 0x00007fffe62e4479 in do_system () from /lib64/libc.so.6
#2 0x00007fffe62e47b0 in system () from /lib64/libc.so.6
#3 0x00007fffec284d3f in sst_generate_stack_trace ()
#4 0x00007fffec2656c9 in sst_signal_handler(int) ()
#5 <signal handler called>
#6 PyEval_EvalFrameEx () at Python/ceval.c:1247
#7 0x00007fffe93bb33a in PyEval_EvalCodeEx () at Python/ceval.c:3607
#8 0x00007fffe93bb549 in PyEval_EvalCode () at Python/ceval.c:675