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.
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...
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
Created attachment 592640 [details, diff] 0001-sys-libs-readline-allow-linking-to-ncursesw-tinfow-w.patch
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
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(+)
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(-)