Modify

Opened 7 years ago

Closed 2 years ago

#8102 closed defect (obsolete)

Python is missing readline support - segfault r23451, is explicitly disabled in Makefile

Reported by: sartan Owned by: developers
Priority: low Milestone:
Component: packages Version: Trunk
Keywords: python readline Cc:

Description

The root cause is that readline is explicitly disabled on the build, but "/usr/lib/python2.6/lib-dynload/readline.so" does exist.

Since the module is compiled without readline headers, I suspect there's a compilation error but the file is built anyway.

strace below:

root@OpenWrt:~# python
Python 2.6.4 (r264:75706, Oct 17 2010, 02:23:41)
[GCC 4.3.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import readline
Segmentation fault

Checked https://dev.openwrt.org/browser/packages/lang/python/Makefile?rev=23515

PY_DISABLED_MODULES:= \
108 readline _curses _curses_panel _tkinter nis

5734  stat64(0x7fe2a8e8, 0x7fe286f8)    = -1 ENOENT (No such file or directory)
5734  open("/storage/www/mistrust/lib/mistrust/readline.so", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
5734  open("/storage/www/mistrust/lib/mistrust/readlinemodule.so", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
5734  open("/storage/www/mistrust/lib/mistrust/readline.py", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
5734  open("/storage/www/mistrust/lib/mistrust/readline.pyc", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
5734  stat64(0x7fe2a8e8, 0x7fe286f8)    = -1 ENOENT (No such file or directory)
5734  open("/usr/lib/python2.6/readline.so", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
5734  open("/usr/lib/python2.6/readlinemodule.so", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
5734  open("/usr/lib/python2.6/readline.py", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
5734  open("/usr/lib/python2.6/readline.pyc", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
5734  stat64(0x7fe2a8e8, 0x7fe286f8)    = -1 ENOENT (No such file or directory)
5734  open("/usr/lib/python2.6/plat-linux2/readline.so", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
5734  open("/usr/lib/python2.6/plat-linux2/readlinemodule.so", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
5734  open("/usr/lib/python2.6/plat-linux2/readline.py", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
5734  open("/usr/lib/python2.6/plat-linux2/readline.pyc", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
5734  stat64(0x7fe2a8e8, 0x7fe286f8)    = -1 ENOENT (No such file or directory)
5734  open("/usr/lib/python2.6/lib-dynload/readline.so", O_RDONLY|O_LARGEFILE) = 3
5734  ioctl(3, TIOCNXCL, 0x7fe28690)    = -1 ENOTTY (Inappropriate ioctl for device)
5734  fstat64(3, {st_dev=makedev(0, 13), st_ino=17740, st_mode=S_IFREG|0755, st_nlink=1, st_uid=0, st_gid=0, st_blksize=4096, st_blocks=48, st_size=24236, st_atime=2010/10/19-11:50:07, st_mtime=2010/10/16-18:24:50, st_ctime=2010/10/18-11:17:14}) = 0
5734  open("/usr/lib/python2.6/lib-dynload/readline.so", O_RDONLY) = 4
5734  fstat(4, {st_dev=makedev(0, 13), st_ino=17740, st_mode=S_IFREG|0755, st_nlink=1, st_uid=0, st_gid=0, st_blksize=4096, st_blocks=48, st_size=24236, st_atime=2010/10/19-11:50:07, st_mtime=2010/10/16-18:24:50, st_ctime=2010/10/18-11:17:14}) = 0
5734  close(4)                          = 0
5734  --- SIGSEGV (Segmentation fault) @ 0 (0) ---
5734  +++ killed by SIGSEGV +++

Attachments (2)

readline-ncurses.diff (1.2 KB) - added by Cybjit <cybjit@…> 6 years ago.
Force linking of ncurses to readline
python-readline.diff (398 bytes) - added by Cybjit <cybjit@…> 6 years ago.
Unbreak python-readline

Download all attachments as: .zip

Change History (6)

comment:1 Changed 7 years ago by sartan

Patch

{{
Index: Makefile
===================================================================
--- trunk/feeds/packages/lang/python/Makefile (revision 23569)
+++ trunk/feeds/packages/lang/python/Makefile (working copy)
@@ -105,7 +105,7 @@

endef

PY_DISABLED_MODULES:= \

  • readline _curses _curses_panel _tkinter nis

+ _curses _curses_panel _tkinter nis

MAKE_OPTS:=\

$(TARGET_CONFIGURE_OPTS) \

}}

comment:2 Changed 7 years ago by anonymous

Patch causes segfault. Don't do this.

comment:3 Changed 6 years ago by Cybjit <cybjit@…>

BusyBox buildroot has a patch that forces linking of ncurses to readline, and it fixes this for me.
Explicit linking is apparently needed with uClibc, see the following thread http://lists.uclibc.org/pipermail/uclibc/2011-March/045051.html

Changed 6 years ago by Cybjit <cybjit@…>

Force linking of ncurses to readline

Changed 6 years ago by Cybjit <cybjit@…>

Unbreak python-readline

comment:4 Changed 2 years ago by nbd

  • Resolution set to obsolete
  • Status changed from new to closed

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.