早上碰到这个一个错误:
[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 __strstr_sse2_unaligned () at ../sysdeps/x86_64/multiarch/strstr-sse2-unaligned.S:40 40 ../sysdeps/x86_64/multiarch/strstr-sse2-unaligned.S: 没有那个文件或目录. [Current thread is 1 (Thread 0x7f30677fe700 (LWP 26052))] (gdb) backtrace #0 __strstr_sse2_unaligned () at ../sysdeps/x86_64/multiarch/strstr-sse2-unaligned.S:40 #1 0x00007f30c61d0622 in PythonClass::process_stranger(VideoElement*, DataBuffer*) () from libgh2python.so
这个错误是由C++调用Python产生的。吾看了亦莫名其妙。怎么产生的?开始当然抱怨接口有问题.有问题也得解决啊.于是仔细查了一下:
返回值有问题(一般是Python执行错误).
之后取值又没有仔细检查,缓冲区实际上没有正确处理.访问自然出错.
供大家参考。