Multiple Screens not working
** Updated with requested info. Macos htop v 3.4.1 (installed via HomeBrew) Ubuntu v 3.4.0 (lastest available using apt)
Tried on macOS (direct) and Ubuntu (VMware running on macOS) with same results
-
When adding a new screen, you can add new columns immediately, but if you try to go back and edit that screen definition, only the columns for the main screen show. **Added: When you go back to the screen definition in setup and select the new screen, the list of active columns doesn't change. If you add or remove a column, it modifies the main screen rather than the new screen. this happens even if you have 3 screens defined; regardless of which screen is selected, the list of active columns doesn't change and only the main screen gets modified
-
If you try to add EXE as a column it crashes on save Error information:
A signal 6 (Aborted) was received 3966 abort (core dumped) htop
Backtrace from macOS Backtrace information:
0 htop 0x0000000102af3b2c CRT_handleSIGSEGV + 288 1 libsystem_platform.dylib 0x000000018bf396a4 _sigtramp + 56 2 libsystem_pthread.dylib 0x000000018beff88c pthread_kill + 296 3 libsystem_c.dylib 0x000000018be08a3c abort + 124 4 libsystem_malloc.dylib 0x000000018bd0c174 malloc_vreport + 892 5 libsystem_malloc.dylib 0x000000018bd0fc90 malloc_report + 64 6 libsystem_malloc.dylib 0x000000018bd1421c ___BUG_IN_CLIENT_OF_LIBMALLOC_POINTER_BEING_FREED_WAS_NOT_ALLOCATED + 32 7 htop 0x0000000102af76e0 ListItem_delete + 24 8 htop 0x0000000102b069d8 Vector_delete + 64 9 htop 0x0000000102afb464 Panel_done + 32 10 htop 0x0000000102afb144 Panel_delete + 20 11 htop 0x0000000102b069d8 Vector_delete + 64 12 htop 0x0000000102b00b98 ScreenManager_delete + 24 13 htop 0x0000000102aef270 actionSetup + 92 14 htop 0x0000000102af80b8 MainPanel_eventHandler + 276 15 htop 0x0000000102b0138c ScreenManager_run + 1204 16 htop 0x0000000102af1f0c CommandLine_run + 1872 17 dyld 0x000000018bb5eb98 start + 6076
Backtrace from Ubuntu Backtrace information:
htop(CRT_handleSIGSEGV+0x124) [0xc7984c26e884] linux-vdso.so.1(__kernel_rt_sigreturn+0x0) [0xf129db3609a0] /lib/aarch64-linux-gnu/libc.so.6(+0x8a460) [0xf129db05a460] /lib/aarch64-linux-gnu/libc.so.6(gsignal+0x20) [0xf129db0076c0] /lib/aarch64-linux-gnu/libc.so.6(abort+0x2c) [0xf129daff1ac8] /lib/aarch64-linux-gnu/libc.so.6(+0x7d2c8) [0xf129db04d2c8] /lib/aarch64-linux-gnu/libc.so.6(+0x959fc) [0xf129db0659fc] /lib/aarch64-linux-gnu/libc.so.6(+0x97de4) [0xf129db067de4] /lib/aarch64-linux-gnu/libc.so.6(__libc_free+0x198) [0xf129db06ae20] htop(+0x2c60c) [0xc7984c27c60c] htop(Vector_delete+0x70) [0xc7984c27d598] htop(+0x2de4c) [0xc7984c27de4c] htop(Vector_delete+0x70) [0xc7984c27d598] htop(+0x1a510) [0xc7984c26a510] htop(+0x2af34) [0xc7984c27af34] htop(ScreenManager_run+0x2b0) [0xc7984c2840c0] htop(CommandLine_run+0x91c) [0xc7984c26d5fc] /lib/aarch64-linux-gnu/libc.so.6(+0x222dc) [0xf129daff22dc] /lib/aarch64-linux-gnu/libc.so.6(__libc_start_main+0x9c) [0xf129daff23bc] htop(_start+0x30) [0xc7984c262d30]
Please add the version of htop you tried this with. Also for the crash you are missing the backtrace provided by htop (which helps with tracking down the issue).
For editing the columns: Note that in the view for editing columns you have to select the screen for which you'd like to edit the columns first (First column: Screens, econd column: The screen you wish to edit, Third column: The fields you wish that screen to have).
original comment has been updated with info request - thanks very much. The issue with the screen editing is that no matter which screen name you click on (in setup screens) the list of active columns doesn't change. If you do make a change to those columns, then regardless of which screen name is highlighted, the changes are made to the main screen. The second issue relating to adding EXE occurs even if you add it to the main screen
Confirmed both for current head as well as the Trixie release version. Thank you very much for reporting this @ki-aura
For further info: Just tried this on Debian (using the kali linux distro as a VM on a Mac) using htop V3.4.1 and it still has the screen editing issue, but does not crash when adding EXE column
There seems to be a bug with handling the initial click when selecting the screen to edit (marks the item for moving that screen instead of selecting the panel). When using cursor keys to navigate the screens get selected as expected.
Edit: Got a simple repro for the crash while under ASAN using the following steps:
- Setup (F2)
- Move to Screens (3x DOWN)
- Goto
Screenscolumn (RIGHT) - Add a new screen (F5)
- Click on
Metersin theCategoriescolumn
Gives the following crash under ASAN:
=================================================================
==30561==ERROR: AddressSanitizer: attempting free on address which was not malloc()-ed: 0x79505047e800 in thread T0
#0 0x7af0517212ab in free ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:51
#1 0x59bd444b4745 in ListItem_delete htop/ListItem.c:23
#2 0x59bd444d796a in ScreenListItem_delete htop/ScreensPanel.c:32
#3 0x59bd444e7290 in Vector_delete htop/Vector.c:45
#4 0x59bd444c0158 in Panel_done htop/Panel.c:75
#5 0x59bd444c019c in Panel_delete htop/Panel.c:45
#6 0x59bd444d7e09 in ScreensPanel_delete htop/ScreensPanel.c:62
#7 0x59bd444e7786 in Vector_remove htop/Vector.c:249
#8 0x59bd444d61da in ScreenManager_remove htop/ScreenManager.c:96
#9 0x59bd444a161c in CategoriesPanel_eventHandler htop/CategoriesPanel.c:155
#10 0x59bd444c0a8d in Panel_setSelected htop/Panel.c:209
#11 0x59bd444d6ffe in ScreenManager_run htop/ScreenManager.c:305
#12 0x59bd44499487 in Action_runSetup htop/Action.c:97
#13 0x59bd4449953f in actionSetup htop/Action.c:567
#14 0x59bd444b6973 in MainPanel_eventHandler htop/MainPanel.c:116
#15 0x59bd444d71f7 in ScreenManager_run htop/ScreenManager.c:351
#16 0x59bd444a48da in CommandLine_run htop/CommandLine.c:399
#17 0x59bd44497db5 in main htop/htop.c:17
#18 0x7af05122a577 in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58
#19 0x7af05122a63a in __libc_start_main_impl ../csu/libc-start.c:360
#20 0x59bd44497ce4 in _start (htop/htop+0x40ce4) (BuildId: 92c7df620fb9280ac8549265b637a7360e368dc1)
0x79505047e800 is located 9984 bytes inside of 10032-byte region [0x79505047c100,0x79505047e830)
allocated by thread T0 here:
#0 0x7af05172277b in malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:67
#1 0x59bd444e80eb in xMalloc htop/XUtils.c:35
SUMMARY: AddressSanitizer: bad-free htop/ListItem.c:23 in ListItem_delete
==30561==ABORTING
Stack backtrace of the crash as requested by @BenBE
Okay, the crash when exiting the rename operation of the newly added tab should be fixed by the following patch:
$ git diff
diff --git a/ScreensPanel.c b/ScreensPanel.c
index 2ba7b940..11092197 100644
--- a/ScreensPanel.c
+++ b/ScreensPanel.c
@@ -51,6 +51,20 @@ static const char* const DynamicFunctions[] = {" ", "Rename", " ", "
static void ScreensPanel_delete(Object* object) {
Panel* super = (Panel*) object;
+ ScreensPanel* const this = (ScreensPanel*) super;
+
+ /* cancel any pending edit action */
+ if (this->renamingItem) {
+ ListItem* item = (ListItem*) Panel_getSelected(super);
+ assert(item);
+ assert(item == this->renamingItem);
+
+ item->value = this->saved;
+ this->renamingItem = NULL;
+ super->cursorOn = false;
+
+ Panel_setSelectionColor(super, PANEL_SELECTION_FOCUS);
+ }
/* do not delete screen settings still in use */
int n = Panel_size(super);
Absolutely not pretty, but didn't crash in a first quick test.