本文介绍了Python服务器“已中止(核心已转储)"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用web.py创建一个Python Web服务器.调用该服务器来解决线性编程问题,它使用CBC库来完成该任务.

I use web.py to create a Python web server. This server is called to solve linear programming problems, and it uses the library CBC to do that.

每隔一段时间,服务器就会崩溃,并显示如下日志:

Every once in a while, the server crashes with a log that looks like that:

78.243.184.3:56271 - - [03/Jun/2016 04:35:54] "HTTP/1.1 GET /optimization" - 200 OK
Aborted (core dumped)

我相信堕胎(核心已转储)"是C错误,因此它来自web.py或CBC.

I belive "Aborted (core dumped)" is a C error, so it comes from either web.py or CBC.

有什么办法可以追溯到错误的根源?

Is there any way to trace back the source of the error?

推荐答案

核心转储是由Web服务器中本机代码中的错误引起的.如今,Python非常可靠,因此,根据我的经验,此类错误几乎总是由C扩展中的错误引起的.

A core dump is caused by a fault in the native code in your web server. Python is pretty darn solid these days, so such faults are almost always caused by bugs in C extensions in my experience.

因此,您有3个问题.

  1. 您需要找到核心转储文件.这通常在转储的进程的当前工作目录中.但是,有可以更改此设置的配置选项.

您需要调试失败堆栈的调用堆栈. StackOverflow对此进行了介绍-请参见如何分析程序的带有gdb的核心转储文件?

You need to debug the call stack of what has failed. That is covered in StackOverflow - see How to analyze a program's core dump file with gdb?

您可能需要将Python解释程序堆栈与您正在运行的Python代码相关联.为此,您将需要为gdb安装Python调试符号和Python扩展.在此处. >

You might need to relate the Python interpreter stack back to the Python code that you were running. To do this you will need to install the Python debug symbols and Python extensions for gdb. The Python wiki has good advice on how to do that here.

这篇关于Python服务器“已中止(核心已转储)"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-05 08:53
查看更多