问题描述
我刚刚从Ubuntu 12.04更新到13.04,而且我在迁移一些以前工作的代码时遇到问题。谷歌搜索并没有显示任何显然相关的东西,除了一些晦涩的R引用,尽管我的项目使用R,我不会指望它在迁移中出现。我以前从来没有处理过调试段错误,更不用说第三方代码。如何继续?
I just updated from Ubuntu 12.04 to 13.04, and I am having issues migrating some code that used to work. Googling does not reveal anything that obviously looks related except some obscure R references, and though my project does use R I would not expect it to crop up in migrations. I have never dealt with debugging seg faults before, much less in 3rd party code. How should I proceed?
(project)ben@Watt:~/Projects/project/project$ python project/manage.py migrate
Error: 'rho' must be an environment not NULL: detected in C-level eval
Segmentation fault (core dumped)
编辑:看起来像是rpy2的问题,发现使用下面的答案ltrace。仍然想知道迁移过程中出现的情况。
It looks like a problem with rpy2, found using the ltrace from the answer below. Still wondering how that came up in migrate.
EDIT2:我的R版本已经更新了Rpy2喜欢的内容。恢复固定的东西。这是怎么来的./manage.py migrate对我来说是神秘的。
My R version had been updated beyond what Rpy2 likes. Reverting fixed things. How this came up in ./manage.py migrate is mysterious to me.
推荐答案
我将首先使用 strace
,因为它已经安装在许多系统上。这可能使您能够根据系统调用缩小当前正在执行的模块。例如
I would start by using strace
since that's already installed on many systems. That might enable you to narrow down which module is currently executing based on the system calls made. eg
$ strace -o ~/tmp/strace.log -f python project/manage.py migrate
或安装 ltrace
并查看呼叫顺序。 p>
or, install ltrace
and view the sequence of calls.
$ sudo apt-get install ltrace
$ ltrace python project/manage.py migrate
由于核心已被转储,您可以使用核心上的gdb来确切查明问题发生的位置。
Failing that, since the core has been dumped, you can use gdb on the core to see exactly where the problem occurred
$ gdb core
使用诸如 bt
的命令显示堆栈跟踪。为了使这更容易,您可能需要找到具有调试符号的可执行文件/库。
The use commands such as bt
to show a stack trace. To make this easier, you may need to find executables/libraries that have debugging symbols available.
这篇关于Django南部断层的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!