This repository was archived by the owner on Sep 8, 2020. It is now read-only.
Repository navigation
This repository was archived by the owner on Sep 8, 2020. It is now read-only.
Segfault on start when built against ncurses-6.0 #241
Copy link
Copy link
Closed
Description
Observed at least on x86_64 & armv7, the linked output is from the x86_64 box.
(That's a build from the current master, and ncurses ABI 6, FWIW).
htop 1.0.3 aborting. Please report bug at http://hisham.hm/htop
Please include in your report the following backtrace:
htop(CRT_handleSIGSEGV+0x35)[0x41765a]
/lib64/libc.so.6(+0x33440)[0x72391429c440]
/lib64/libncursesw.so.6(+0x31597)[0x723914930597]
/lib64/libncursesw.so.6(+0x32bdd)[0x723914931bdd]
/lib64/libncursesw.so.6(doupdate_sp+0x155)[0x7239149326ce]
/lib64/libncursesw.so.6(wrefresh+0x55)[0x723914923faa]
/lib64/libncursesw.so.6(+0x1e680)[0x72391491d680]
/lib64/libncursesw.so.6(_nc_wgetch+0x2ce)[0x72391491dd91]
/lib64/libncursesw.so.6(wgetch+0x2c)[0x72391491e291]
htop(ScreenManager_run+0xc1)[0x40efa6]
htop(main+0x1d8)[0x40a49f]
/lib64/libc.so.6(__libc_start_main+0xf0)[0x7239142897b0]
htop(_start+0x29)[0x406739]
Additionally, in order to make the above backtrace useful,
please also run the following command to generate a disassembly of your binary:
objdump -d `which htop` > ~/htop.objdump
and then attach the file ~/htop.objdump to your bug report.
Thank you for helping to improve htop!
[1] 9276 abort htop
What gdb has to say:
Program received signal SIGSEGV, Segmentation fault.
TransformLine (sp=sp@entry=0x118b660, lineno=lineno@entry=8) at /var/tmp/paludis/sys-libs-ncurses-6.0/work/ncurses-6.0/ncurses/tty/tty_update.c:1261
1261 /var/tmp/paludis/sys-libs-ncurses-6.0/work/ncurses-6.0/ncurses/tty/tty_update.c: No such file or directory.
#0 TransformLine (sp=sp@entry=0x118b660, lineno=lineno@entry=8) at /var/tmp/paludis/sys-libs-ncurses-6.0/work/ncurses-6.0/ncurses/tty/tty_update.c:1261
oldPair = 0
newPair = -1708163072
firstChar = <optimized out>
oLastChar = <optimized out>
nLastChar = <optimized out>
newLine = 0x11a0460
oldLine = 0x11e8de0
n = 22
attrchanged = false
#1 0x00006f9f99eb9bdd in ClrUpdate (sp=sp@entry=0x118b660) at /var/tmp/paludis/sys-libs-ncurses-6.0/work/ncurses-6.0/ncurses/tty/tty_update.c:1073
i = 8
blank = {attr = 0, chars = L" \000\000\000", ext_color = 0}
nonempty = 39
#2 0x00006f9f99eba6ce in doupdate_sp (sp=sp@entry=0x118b660) at /var/tmp/paludis/sys-libs-ncurses-6.0/work/ncurses-6.0/ncurses/tty/tty_update.c:925
i = <optimized out>
nonempty = 0
#3 0x00006f9f99eabfaa in wrefresh (win=win@entry=0x1222640) at /var/tmp/paludis/sys-libs-ncurses-6.0/work/ncurses-6.0/ncurses/base/lib_refresh.c:65
code = <optimized out>
sp = <optimized out>
#4 0x00006f9f99ea5680 in recur_wrefresh (win=win@entry=0x1222640) at /var/tmp/paludis/sys-libs-ncurses-6.0/work/ncurses-6.0/ncurses/base/lib_getch.c:384
No locals.
#5 0x00006f9f99ea5d91 in _nc_wgetch (win=win@entry=0x1222640, result=result@entry=0x7cf235fb3734, use_meta=0) at /var/tmp/paludis/sys-libs-ncurses-6.0/work/ncurses-6.0/ncurses/base/lib_getch.c:491
sp = 0x118b660
ch = <optimized out>
rc = 0
#6 0x00006f9f99ea6291 in wgetch (win=0x1222640) at /var/tmp/paludis/sys-libs-ncurses-6.0/work/ncurses-6.0/ncurses/base/lib_getch.c:670
code = <optimized out>
value = 0
#7 0x000000000040efa6 in ScreenManager_run (this=this@entry=0x1272a40, lastFocus=lastFocus@entry=0x0, lastKey=lastKey@entry=0x0) at ScreenManager.c:191
prevCh = -1
result = <optimized out>
quit = false
focus = 0
panelFocus = 0x126ea30
oldTime = 14395879732.719379
ch = -1
closeTimeout = 0
timedOut = true
redraw = true
rescan = false
sortTimeout = 1
#8 0x000000000040a49f in main (argc=<optimized out>, argv=<optimized out>) at htop.c:234
lc_ctype = <optimized out>
flags = {pidWhiteList = 0x0, userId = 4294967295, sortKey = 0, delay = -1, useColors = true}
ut = 0x11894f0
pl = 0x11895e0
settings = 0x118a020
header = 0x118a6a0
panel = <optimized out>
state = {settings = 0x118a020, ut = 0x11894f0, pl = 0x11895e0, panel = 0x126ea30, header = 0x118a6a0}
scr = 0x1272a40
And here's the objdump of the binary.
Metadata
Metadata
Assignees
Labels
No labels
Activity
NiLuJe commentedon Aug 15, 2015
Building against ncurses 6.0 in ABI 5 mode appears to work, on the other hand ;).
hishamhm commentedon Aug 19, 2015
Ouch, I have no idea what could be causing this... header mismatch, perhaps? ncurses.h is known for having lots of macros... I'm running ncurses 5.9 here.
hishamhm commentedon Aug 19, 2015
I just tested ncurses 6.0 here (in ABI 6 mode, including implementing mouse wheel support, yay!) and had no crashes. Please double check that you're not building using ncurses 5 headers...
NiLuJe commentedon Aug 20, 2015
I'll double check tomorrow if there wasn't a pkg-config mishap, but that seems unlikely, the native x86_64 build was on Gentoo through portage, and the armv7 build is cross-compiled in a pristine sysroot ;?.
GCC 4.9.3 in both cases, FWIW.
hishamhm commentedon Aug 20, 2015
Thank you! Please test against the current master; I added support for
-lncursesw6inconfigure.ac.hishamhm commentedon Aug 20, 2015
I managed to reproduce the bug here! Turns out I was building with ABI 6 but accidentally running htop in non-Unicode mode. On to fix it!
NiLuJe commentedon Aug 20, 2015
Working fine on my end too, thanks! 👍
NiLuJe commentedon Aug 20, 2015
Err, mostly, that is ^^.
I'm seeing a weird graphical issue where sometimes, the coloring of a commandline will go a bit haywire. The weird colors shift around when resizing the window, and eventually settle down to something normal. So far, I've only seen this on very long shadowed (different user) commandlines.
x86

armv7



... after a resize
... and okay after a second resize.
I can create a separate issue for this if you prefer?
EDIT: The "Shadow other users' processes" option is irrelevant, the disruption is still the same, just with a different set of colors ;).
hishamhm commentedon Aug 20, 2015
Oh, thanks for the screenshots!
Please open a new issue, so that other users find it if they bump into it.