Summary: | net-wireless/wavemon-0.9.3 SIGSEGV on startup with sys-libs/ncurses-6.2-r1, in initscr / _nc_setupscreen_sp | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Cyp <cyp561> |
Component: | Current packages | Assignee: | Alarig Le Lay <alarig> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | info, Lolo.Gentoo, mehw.is.me, mgorny, proxy-maint, sam, slyfox, spyros_ladon |
Priority: | Normal | Keywords: | PATCH, PullRequest |
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
See Also: |
https://github.com/gentoo/gentoo/pull/20749 https://bugs.gentoo.org/show_bug.cgi?id=890026 |
||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: | wavemon-0.9.3-avoid-raw-ncurses.patch |
Description
Cyp
2021-04-25 10:05:10 UTC
I wonder if it's another case of mixing ncurses and ncursesw libraries in the same binary (like bug #669096). Can you post `lddrtee` output on crashing binary? For example for me both `tinfo` and tinfow` are pulled in. That is likely a problem: ``` $ lddtree /usr/bin/wavemon /usr/bin/wavemon (interpreter => /lib64/ld-linux-x86-64.so.2) libcap.so.2 => /lib64/libcap.so.2 libncursesw.so.6 => /lib64/libncursesw.so.6 libdl.so.2 => /lib64/libdl.so.2 libtinfow.so.6 => /lib64/libtinfow.so.6 libm.so.6 => /lib64/libm.so.6 libtinfo.so.6 => /lib64/libtinfo.so.6 libnl-genl-3.so.200 => /usr/lib64/libnl-genl-3.so.200 libnl-3.so.200 => /usr/lib64/libnl-3.so.200 libpthread.so.0 => /lib64/libpthread.so.0 libc.so.6 => /lib64/libc.so.6 ``` I think mix comes from: ``` PKG_CHECK_MODULES(ncurses,ncurses,LIBS="$LIBS $ncurses_LIBS",) ... AC_CHECK_LIB([ncursesw], [waddstr],... ``` in configure.ac. $ lddtree $(which wavemon) wavemon => /usr/bin/wavemon (interpreter => /lib64/ld-linux-x86-64.so.2) libncursesw.so.6 => /lib64/libncursesw.so.6 libdl.so.2 => /lib64/libdl.so.2 ld-linux-x86-64.so.2 => /lib64/ld-linux-x86-64.so.2 libtinfow.so.6 => /lib64/libtinfow.so.6 libm.so.6 => /lib64/libm.so.6 libtinfo.so.6 => /lib64/libtinfo.so.6 libnl-genl-3.so.200 => /usr/lib64/libnl-genl-3.so.200 libnl-3.so.200 => /usr/lib64/libnl-3.so.200 libpthread.so.0 => /lib64/libpthread.so.0 libc.so.6 => /lib64/libc.so.6 ---- [below written before seeing above comment] Same crash (apart from line numbers) after updating to sys-libs/ncurses-6.2_p20210123. Program received signal SIGSEGV, Segmentation fault. 0x00007ffff7f5f790 in _nc_setupscreen_sp (spp=spp@entry=0x7fffffffd228, slines=<optimized out>, scolumns=<optimized out>, output=output@entry=0x7ffff7d766c0 <_IO_2_1_stdout_>, filtered=<optimized out>, slk_format=slk_format@entry=0) at /var/tmp/portage/sys-libs/ncurses-6.2_p20210123/work/ncurses-6.2/ncurses/base/lib_set_term.c:501 warning: Source file is more recent than executable. 501 if (sp->_default_fg >= MaxColors) { (gdb) bt full #0 0x00007ffff7f5f790 in _nc_setupscreen_sp (spp=spp@entry=0x7fffffffd228, slines=<optimized out>, scolumns=<optimized out>, output=output@entry=0x7ffff7d766c0 <_IO_2_1_stdout_>, filtered=<optimized out>, slk_format=slk_format@entry=0) at /var/tmp/portage/sys-libs/ncurses-6.2_p20210123/work/ncurses-6.2/ncurses/base/lib_set_term.c:501 p = <optimized out> null_TTY = {c_iflag = 0, c_oflag = 0, c_cflag = 0, c_lflag = 0, c_line = 0 '\000', c_cc = '\000' <repeats 31 times>, c_ispeed = 0, c_ospeed = 0} env = <optimized out> bottom_stolen = 0 sp = 0x555555576050 support_cookies = false #1 0x00007ffff7f5aefc in newterm_sp (sp=<optimized out>, name=name@entry=0x555555576030 "xterm-256color", ofp=ofp@entry=0x7ffff7d766c0 <_IO_2_1_stdout_>, ifp=ifp@entry=0x7ffff7d759a0 <_IO_2_1_stdin_>) at /var/tmp/portage/sys-libs/ncurses-6.2_p20210123/work/ncurses-6.2/ncurses/base/lib_newterm.c:234 slk_format = 0 filter_mode = <optimized out> errret = 1 result = 0x0 current = 0x0 its_term = 0x0 _ofp = 0x7ffff7d766c0 <_IO_2_1_stdout_> _ifp = 0x7ffff7d759a0 <_IO_2_1_stdin_> new_term = 0x0 #2 0x00007ffff7f5b379 in newterm (name=name@entry=0x555555576030 "xterm-256color", ofp=0x7ffff7d766c0 <_IO_2_1_stdout_>, ifp=0x7ffff7d759a0 <_IO_2_1_stdin_>) at /var/tmp/portage/sys-libs/ncurses-6.2_p20210123/work/ncurses-6.2/ncurses/base/lib_newterm.c:367 rc = <optimized out> #3 0x00007ffff7f56d40 in initscr () at /var/tmp/portage/sys-libs/ncurses-6.2_p20210123/work/ncurses-6.2/ncurses/base/lib_initscr.c:93 env = <optimized out> name = 0x555555576030 "xterm-256color" result = <optimized out> #4 0x000055555555898e in main (argc=<optimized out>, argv=<optimized out>) at wavemon.c:170 bg_color = 0 cur = <optimized out> next = <optimized out> blockmask = {__val = {2, 0 <repeats 15 times>}} oldmask = {__val = {0 <repeats 16 times>}} Isn’t it an issue with ncurses rather than wavemon? (In reply to Alarig Le Lay from comment #5) > Isn’t it an issue with ncurses rather than wavemon? No. #c1 says what the problem is, and #c3 points to the exact broken code. Same situation for me. Same bug on previous ebuild 0.9.2 and this 0.9.3. Works correctly with 0.8.0 and 0.9.1 (local version) for test (used 0.9.1 actually on Debian testing/unstable actually, probably due by the commented on #1 and #6). I think previous versions of wavemon like 0.8.0 and 0.9.1 (this not ported on portage) will be present on the tree, unmasked and masking the 0.9.3. Created attachment 705777 [details, diff]
wavemon-0.9.3-avoid-raw-ncurses.patch
To avoid library mix you can just drop ncursesw part of it: wavemon-0.9.3-avoid-raw-ncurses.patch
Hopefully https://github.com/gentoo/gentoo/pull/20749 solves the segmentation fault by either linking libncursesw along with libtinfow, or libncurses with libtinfo. It changes files/wavemon-0.9.3-build.patch into allowing configure.ac to set the ncurses(w) LIBS via PKG_CHECK_MODULES: AC_CHECK_LIB([ncursesw]... PKG_CHECK_MODULES([ncursesw]... [LIBS="$LIBS $ncursesw_LIBS"]... AC_CHECK_LIB([ncurses]... PKG_CHECK_MODULES([ncurses]... [LIBS="$LIBS $ncurses_LIBS"]...) The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cd2fe787cf93eaa7e82564b901993447273e8367 commit cd2fe787cf93eaa7e82564b901993447273e8367 Author: Matthew White <mehw.is.me@inventati.org> AuthorDate: 2021-05-10 00:05:49 +0000 Commit: Joonas Niilola <juippis@gentoo.org> CommitDate: 2021-06-03 07:01:11 +0000 net-wireless/wavemon-0.9.3: fix ncurses(w) libs Fixes a segmentation fault due to linking with libncursesw and libtinfo, rather than libtinfow. See also https://github.com/uoaerg/wavemon/issues/88 about the segmentation fault error. If libncursesw is available uses ncursesw_LIBS, otherwise uses ncurses_LIBS if libncurses remains the only option. Closes: https://bugs.gentoo.org/785562 Signed-off-by: Matteo Bianco <mehw.is.me@inventati.org> Closes: https://github.com/gentoo/gentoo/pull/20749 Signed-off-by: Joonas Niilola <juippis@gentoo.org> net-wireless/wavemon/files/wavemon-0.9.3-build.patch | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) |