Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 669214 - sys-libs/readline should link against libtinfow/libncursesw when available
Summary: sys-libs/readline should link against libtinfow/libncursesw when available
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo's Team for Core System packages
Depends on:
Reported: 2018-10-21 16:37 UTC by Sergei Trofimovich
Modified: 2019-10-13 11:39 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---

0001-sys-libs-readline-allow-linking-to-ncursesw-tinfow-w.patch (0001-sys-libs-readline-allow-linking-to-ncursesw-tinfow-w.patch,1.83 KB, patch)
2019-10-13 10:40 UTC, Sergei Trofimovich
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sergei Trofimovich gentoo-dev 2018-10-21 16:37:50 UTC
In I noticed readline links against non-wide variants of libraries:

  $ lddtree /lib64/
  /lib64/ (interpreter => None) => /lib64/ => /lib64/
   => /lib64/ => /lib64/

This causes some libraries and binaries to link to both libncurses/libncursesw or libtinfo/libtinfow. Both libraries expose the same symbols and that can cause SIGSEGVs, double initialization and other problems.

Please consider adding support for libncursesw / libtinfow for sys-libs/readline. has some hints where configuration happens.
Comment 1 Patrick McLean gentoo-dev 2018-10-23 00:18:40 UTC
This certainly should not be done automagically. Perhaps adding a "unicode" USE flag on readline to reflect the ncurses one might be a reasonable approach, that way we can require the USE flag to be present on ncurses.

I am unsure if this linking will break rdeps of readline that use 8-bit ASCII and aren't unicode aware...
Comment 2 Sergei Trofimovich gentoo-dev 2019-10-13 10:23:56 UTC
Another report of gdb --tui crash today on #gentoo-toolchain. Same symptom: libtinfo/libtinfow mix via ncursesw and readline:

gdb => /usr/bin/gdb (interpreter => /lib64/ => /lib64/ => /lib64/ => /lib64/ => /lib64/ => /lib64/ => /lib64/ => /usr/lib64/ => /lib64/ => /lib64/ => /lib64/ => /usr/lib64/ => /usr/lib64/ => /usr/lib64/ => /lib64/ => /lib64/
Comment 3 Sergei Trofimovich gentoo-dev 2019-10-13 10:40:27 UTC
Created attachment 592640 [details, diff]