[Pythonmac-SIG] OSX10.6/readline-6.1/python-2.6.5

Chris Kees cekees at gmail.com
Tue May 25 16:25:11 CEST 2010


Hi,

I'm compiling python and readline from source and getting a segmentation
fault in readline after two lines of input. Anybody seen this before or know
the fix? Summary of the problem follows.

% python
Python 2.6.5 (r265:3362, May 25 2010, 09:06:56)
[GCC 4.2.1 (Apple Inc. build 5659)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> a = 1
>>> b = 2
Segmentation fault

The built python works fine if I compile without readline support. My
readline and python configuration steps look like this:

readline:
configure --prefix=${MY_PREFIX} CC=/usr/bin/gcc
python:
./configure --prefix=${MY_PREFIX} --enable-framework=${MY_PREFIX}
 CFLAGS="-I${MY_PREFIX}/include" LDFLAGS="-L${MY_PREFIX}/lib"
--with-readline-dir=${MY_PREFIX}

Also, I've tried MACOSX_DEPLOYMENT_TARGET=10.3 and 10.6.

Running python in gdb shows the
% gdb python
GNU gdb 6.3.50-20050815 (Apple version gdb-1461.2) (Fri Mar  5 04:43:10 UTC
2010)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "x86_64-apple-darwin"...Reading symbols for
shared libraries ..... done

(gdb) run
Starting program: /Users/cekees/src/proteus/darwin/bin/python
Reading symbols for shared libraries ++++. done

Program received signal SIGTRAP, Trace/breakpoint trap.
0x00007fff5fc01028 in __dyld__dyld_start ()
(gdb) c
Continuing.
Reading symbols for shared libraries .......... done
Python 2.6.5 (r265:3362, May 25 2010, 09:06:56)
[GCC 4.2.1 (Apple Inc. build 5659)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
Reading symbols for shared libraries ... done
>>> a = 1
>>> b = 2

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x0000000000000000
0x00000001003ee0a7 in call_readline (sys_stdin=<value temporarily
unavailable, due to optimizations>, sys_stdout=<value temporarily
unavailable, due to optimizations>, prompt=<value temporarily unavailable,
due to optimizations>) at
/Users/cekees/src/proteus/externalPackages/Python-2.6.5/Modules/readline.c:1037
1037 line = history_get(state->length)->line;
(gdb) back
#0  0x00000001003ee0a7 in call_readline (sys_stdin=<value temporarily
unavailable, due to optimizations>, sys_stdout=<value temporarily
unavailable, due to optimizations>, prompt=<value temporarily unavailable,
due to optimizations>) at
/Users/cekees/src/proteus/externalPackages/Python-2.6.5/Modules/readline.c:1037
#1  0x00000001000086e2 in PyOS_Readline (sys_stdin=0x7fff702be0c0,
sys_stdout=0x7fff702be158, prompt=0x10059cf24 ">>> ") at
Parser/myreadline.c:208
#2  0x000000010000a088 in tok_nextc (tok=0x100458310) at
Parser/tokenizer.c:784
#3  0x000000010000a81a in tok_get [inlined] () at
/Users/cekees/src/proteus/externalPackages/Python-2.6.5/Parser/tokenizer.c:1131
#4  0x000000010000a81a in PyTokenizer_Get (tok=0x100458310,
p_start=0x7fff5fbfe658, p_end=0x7fff5fbfe650) at Parser/tokenizer.c:1571
#5  0x00000001000054da in parsetok (tok=0x100458310, g=<value temporarily
unavailable, due to optimizations>, start=<value temporarily unavailable,
due to optimizations>, err_ret=0x7fff5fbfe6b0, flags=0x7fff5fbfe6dc) at
Parser/parsetok.c:159
#6  0x00000001000dd592 in orte_iof_base_setup_prefork () at
Python/pythonrun.c:1463
#7  0x00000001000de7a3 in orte_ns_base_get_proc_name_string () at
Python/pythonrun.c:824
#8  0x00000001000dea8e in PyRun_InteractiveLoopFlags (fp=0x7fff702be0c0,
filename=0x10011a988 "<stdin>", flags=0x7fff5fbfe8e0) at
Python/pythonrun.c:764
#9  0x00000001000df301 in PyRun_AnyFileExFlags (fp=0x7fff702be0c0,
filename=0x10011a988 "<stdin>", closeit=0, flags=0x7fff5fbfe8e0) at
Python/pythonrun.c:733
#10 0x00000001000ee697 in orte_rmaps_base_get_job_map () at
Modules/main.c:572
#11 0x0000000100000f14 in ?? ()
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/pythonmac-sig/attachments/20100525/8d65ed54/attachment.html>


More information about the Pythonmac-SIG mailing list