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
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-10-21 16:37 UTC by Sergei Trofimovich (RETIRED)
Modified: 2019-10-14 07:51 UTC (History)
3 users (show)

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


Attachments
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 (RETIRED)
Details | Diff

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

  $ lddtree /lib64/libreadline.so.7
  /lib64/libreadline.so.7 (interpreter => None)
    libncurses.so.6 => /lib64/libncurses.so.6
        libdl.so.2 => /lib64/libdl.so.2
            ld-linux-x86-64.so.2 => /lib64/ld-linux-x86-64.so.2
    libc.so.6 => /lib64/libc.so.6

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.

https://bugs.gentoo.org/669096#c3 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 (RETIRED) 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/ld-linux-x86-64.so.2)
    libreadline.so.7 => /lib64/libreadline.so.7
        libtinfo.so.6 => /lib64/libtinfo.so.6
    libz.so.1 => /lib64/libz.so.1
    libncursesw.so.6 => /lib64/libncursesw.so.6
        libtinfow.so.6 => /lib64/libtinfow.so.6
    libdl.so.2 => /lib64/libdl.so.2
    libpython3.6m.so.1.0 => /usr/lib64/libpython3.6m.so.1.0
        libutil.so.1 => /lib64/libutil.so.1
    libpthread.so.0 => /lib64/libpthread.so.0
    libm.so.6 => /lib64/libm.so.6
    libexpat.so.1 => /usr/lib64/libexpat.so.1
    libmpfr.so.4 => /usr/lib64/libmpfr.so.4
        libgmp.so.10 => /usr/lib64/libgmp.so.10
    libc.so.6 => /lib64/libc.so.6
    ld-linux-x86-64.so.2 => /lib64/ld-linux-x86-64.so.2
Comment 3 Sergei Trofimovich (RETIRED) gentoo-dev 2019-10-13 10:40:27 UTC
Created attachment 592640 [details, diff]
0001-sys-libs-readline-allow-linking-to-ncursesw-tinfow-w.patch
Comment 4 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2019-10-14 07:33:51 UTC
Alright, that patch is similar to what I was testing in my private overlay so I am going to push that as readline-8.0_p1-r1
Comment 5 Larry the Git Cow gentoo-dev 2019-10-14 07:36:15 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=db10e3436ac9082a9e29d09cdf408651a17544bb

commit db10e3436ac9082a9e29d09cdf408651a17544bb
Author:     Lars Wendler <polynomial-c@gentoo.org>
AuthorDate: 2019-10-14 07:35:53 +0000
Commit:     Lars Wendler <polynomial-c@gentoo.org>
CommitDate: 2019-10-14 07:35:53 +0000

    sys-libs/readline: Introduced "unicode" USE flag
    
    in order to avoid linking against libtinfo _and_ libtinfow in some
    applications.
    
    Thanks-to: Sergei Trofimovich <slyfox@gentoo.org>
    Closes: https://bugs.gentoo.org/669214
    Package-Manager: Portage-2.3.76, Repoman-2.3.17
    Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>

 sys-libs/readline/readline-8.0_p1-r1.ebuild | 175 ++++++++++++++++++++++++++++
 1 file changed, 175 insertions(+)
Comment 6 Larry the Git Cow gentoo-dev 2019-10-14 07:51:13 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3e3fa64d749106dca66d1c4b486833f1d3df28c8

commit 3e3fa64d749106dca66d1c4b486833f1d3df28c8
Author:     Lars Wendler <polynomial-c@gentoo.org>
AuthorDate: 2019-10-14 07:50:57 +0000
Commit:     Lars Wendler <polynomial-c@gentoo.org>
CommitDate: 2019-10-14 07:50:57 +0000

    sys-libs/readline: Introduced "unicode" USE flag in stable as well
    
    Bug: https://bugs.gentoo.org/669214
    Package-Manager: Portage-2.3.76, Repoman-2.3.17
    Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>

 .../readline/{readline-7.0_p5.ebuild => readline-7.0_p5-r1.ebuild}  | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)