Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

python 3.6 crash after install readline

I have python 3.6 installed from source code. And because up arrow key is not working, I installed readline module by 'pip install readline'

But after this, my python console crash.

*** glibc detected *** python: free(): invalid pointer: 0xb7506578 ***
======= Backtrace: =========
/lib/libc.so.6(+0x70e31)[0xce8e31]
python(PyMem_RawFree+0x1b)[0x805faab]
python(PyOS_Readline+0xe0)[0x81c87a0]
python[0x8083924]
python[0x8084007]
python(PyTokenizer_Get+0x17)[0x8084d17]
python[0x80817fc]
python(PyParser_ASTFromFileObject+0x91)[0x8067231]
python(PyRun_InteractiveOneObject+0x111)[0x8068231]
python(PyRun_InteractiveLoopFlags+0x60)[0x80685c0]
python(PyRun_AnyFileExFlags+0x4b)[0x806870b]
python(Py_Main+0xfae)[0x80782ce]
python(main+0x186)[0x805f716]
/lib/libc.so.6(__libc_start_main+0xe6)[0xc8ed26]
python[0x805f4f1]
======= Memory map: ========
0033e000-00366000 r-xp 00000000 fd:00 12964      /lib/libm-2.12.so
00366000-00367000 r--p 00027000 fd:00 12964      /lib/libm-2.12.so
00367000-00368000 rw-p 00028000 fd:00 12964      /lib/libm-2.12.so
00463000-00464000 r-xp 00000000 00:00 0          [vdso]
0048e000-004b0000 r-xp 00000000 fd:00 4544       /lib/libncurses.so.5.7
004b0000-004b1000 rw-p 00021000 fd:00 4544       /lib/libncurses.so.5.7
004e4000-004fb000 r-xp 00000000 fd:00 4246       /lib/libpthread-2.12.so
004fb000-004fc000 r--p 00016000 fd:00 4246       /lib/libpthread-2.12.so
004fc000-004fd000 rw-p 00017000 fd:00 4246       /lib/libpthread-2.12.so
004fd000-004ff000 rw-p 00000000 00:00 0 
005f5000-0060b000 r-xp 00000000 fd:00 4548       /lib/libtinfo.so.5.7
0060b000-0060e000 rw-p 00015000 fd:00 4548       /lib/libtinfo.so.5.7
0061b000-00622000 r-xp 00000000 fd:00 12976      /lib/librt-2.12.so
00622000-00623000 r--p 00006000 fd:00 12976      /lib/librt-2.12.so
00623000-00624000 rw-p 00007000 fd:00 12976      /lib/librt-2.12.so
00680000-00682000 r-xp 00000000 fd:00 9932       /lib/libutil-2.12.so
00682000-00683000 r--p 00001000 fd:00 9932       /lib/libutil-2.12.so
00683000-00684000 rw-p 00002000 fd:00 9932       /lib/libutil-2.12.so
00ace000-00afc000 r-xp 00000000 fd:00 387421     /home/i2b2demo/PMI-Project/PMI_id_map_script/pmi/lib/python3.6/site-packages/readline.cpython-36m-i386-linux-gnu.so
00afc000-00b01000 rw-p 0002e000 fd:00 387421     /home/i2b2demo/PMI-Project/PMI_id_map_script/pmi/lib/python3.6/site-packages/readline.cpython-36m-i386-linux-gnu.so
00b01000-00b02000 rw-p 00000000 00:00 0 
00c78000-00e09000 r-xp 00000000 fd:00 4203       /lib/libc-2.12.so
00e09000-00e0b000 r--p 00191000 fd:00 4203       /lib/libc-2.12.so
00e0b000-00e0c000 rw-p 00193000 fd:00 4203       /lib/libc-2.12.so
00e0c000-00e0f000 rw-p 00000000 00:00 0 
00e63000-00e81000 r-xp 00000000 fd:00 3473       /lib/ld-2.12.so
00e81000-00e82000 r--p 0001d000 fd:00 3473       /lib/ld-2.12.so
00e82000-00e83000 rw-p 0001e000 fd:00 3473       /lib/ld-2.12.so
00ea4000-00ea7000 r-xp 00000000 fd:00 12962      /lib/libdl-2.12.so
00ea7000-00ea8000 r--p 00002000 fd:00 12962      /lib/libdl-2.12.so
00ea8000-00ea9000 rw-p 00003000 fd:00 12962      /lib/libdl-2.12.so
00fc9000-00fe6000 r-xp 00000000 fd:00 15323      /lib/libgcc_s-4.4.7-20120601.so.1
00fe6000-00fe7000 rw-p 0001d000 fd:00 15323      /lib/libgcc_s-4.4.7-20120601.so.1
08048000-08222000 r-xp 00000000 fd:00 394807     /home/i2b2demo/PMI-Project/PMI_id_map_script/pmi/bin/python3.6
08222000-0826d000 rw-p 001d9000 fd:00 394807     /home/i2b2demo/PMI-Project/PMI_id_map_script/pmi/bin/python3.6
0826d000-0828e000 rw-p 00000000 00:00 0 
08c10000-08c87000 rw-p 00000000 00:00 0          [heap]
b747f000-b7581000 rw-p 00000000 00:00 0 
b7581000-b7781000 r--p 00000000 fd:00 4192       /usr/lib/locale/locale-archive
b7781000-b7783000 rw-p 00000000 00:00 0 
b778a000-b7791000 r--s 00000000 fd:00 5148       /usr/lib/gconv/gconv-modules.cache
b7791000-b7792000 rw-p 00000000 00:00 0 
bfb0d000-bfb2b000 rw-p 00000000 00:00 0          [stack]
[1]    32069 abort      python
like image 203
etlds Avatar asked Mar 29 '17 15:03

etlds


2 Answers

Install gnureadline instead of readline

pip uninstall readline
pip install gnureadline
like image 80
Beefster Avatar answered Oct 20 '22 18:10

Beefster


I am having this problem, as well. When I ran "make" in preparation to install python 3.6.1, I saw this output toward the end:

Python build finished successfully! The necessary bits to build these optional modules were not found: _bz2 _dbm _gdbm
_lzma _sqlite3 _tkinter
readline

I'm guessing that without the readline binaries present, trying to use the readline Python library will not work. The thing is, I know I've installed the readline binaries previously. From what I can gather, this is an issue with the python installation being able to find them.

UPDATE:

I followed the advice here: https://gist.github.com/Nesffer/5fb3d6d4cd3e0cb65624

Essentially, just run this command:

sudo apt-get install libbz2-dev libncurses5-dev libgdbm-dev liblzma-dev sqlite3 libsqlite3-dev openssl libssl-dev tcl8.6-dev tk8.6-dev libreadline-dev zlib1g-dev      

And then cleaned and reinstalled python 3.6.1. Ensure no traces of python3.6 on your system This fixes the problem for me. I'm sure I had readline installed before, so I'm not entirely sure what the mechanics of this problem are.

like image 37
krieghan Avatar answered Oct 20 '22 17:10

krieghan