开发者

Debugging Python Crash

I am building Python 2.6 4 from source on a Linux server and am experiencing a Segmentation Fault when running the tests (make test) (test_hashlib.py and test_hmac.py). When I opened the core dump file in gdb, I am told that the error is at 0x00002b73379ac446 in ??. I then recompiled python with both my CFLAGS and CPPFLAGS set to 开发者_Python百科-g to enable debug symbols and reran the failing test. When I opened the core dump file in gdb, I got the same useless stuff as I got before enabling debug symbols. I then tried to run python within gdb, but go the same result.

Here is the script (install-python.sh) that I used to build and install Python:

#!/bin/sh

VER=2.6.4

wget http://www.python.org/ftp/python/${VER}/Python-${VER}.tar.bz2
tar -xjf Python-${VER}.tar.bz2
cd Python-${VER}
export CFLAGS="-g"
export CPPFLAGS="${CFLAGS}"
./configure --prefix=${HOME}/packages/python --exec-prefix=${HOME}/packages/python
make && make test
make install
cd ..
#rm -rf Python-${VER}*

Does anyone know how to get a usable backtrace out of my hand-rolled Python?


Typically you need to set CFLAGS before calling ./configure - it is usually written to bake a CFLAGS value into the Makefile.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜