Description of problem: htop aborts after hitting F6 key (and when pressing 'a' also). Version-Release number of selected component (if applicable): htop-0.8.2-1.fc11.x86_64 How reproducible: always Steps to Reproduce: 1. run htop 2. press "F6" (SortBy function) Actual results: htop 0.8.2 aborted. Please report bug at http://htop.sf.net Expected results: Column sorted. Additional info: Problem started with 0.8.2, I think. Also here, without answer, yet. http://sourceforge.net/mailarchive/forum.php?thread_name=20090607170847.0e4f7885%40pluto.lan&forum_name=htop-general http://sourceforge.net/mailarchive/forum.php?thread_name=d8fa22ff26511f856b70d51fed039233.squirrel%40jesgue.homelinux.org&forum_name=htop-general
I hit the same problem on pressing '>' key which also opens sort menu. Strace shows that htop ends with SIGSEGV (Segmentation fault) just after pressing the key.
Program received signal SIGSEGV, Segmentation fault. strlen () at ../sysdeps/i386/i486/strlen.S:40 40 cmpb %ch, (%eax) /* is byte NUL? */ Current language: auto; currently asm (gdb) bt all No symbol "all" in current context. (gdb) bt #0 strlen () at ../sysdeps/i386/i486/strlen.S:40 #1 0x00a5f0e5 in __strdup (s=0x4a2ed0aa <Address 0x4a2ed0aa out of bounds>) at strdup.c:42 #2 0x0804cc51 in FunctionBar_new (functions=0xbfa8f780, keys=0xbfa8d9fc, events=0xbfa8d9f4) at FunctionBar.c:57 #3 0x0804d7cb in pickFromVector (panel=0x8513880, list=0x851f180, x=15, y=5, keyLabels=0xbfa8f780, prevBar=0x8513ef8) at htop.c:198 #4 0x0804ff33 in main (argc=1, argv=Cannot access memory at address 0x6 ) at htop.c:707
yeah, I hit this in bug 505387. The problem is, that we don't know the size of the functions array. http://htop.svn.sourceforge.net/viewvc/htop/trunk/FunctionBar.c?revision=155&view=markup has a dumb logic in line 55 iterating blindly over 15 elements, even if the array has two elements only. I cooked up patch 347448 which might fix your issue as well.
patch #347448 doesn't fix this issue, but patch #347449 does :) Happy Patching!
Created attachment 347524 [details] Patch from bug 505387
*** Bug 505387 has been marked as a duplicate of this bug. ***
I tested the patch by Tobias and it fixes both "a" and "F6" bugs. Can you please post it upstream?
I've also noticed small typos here: #remove empty direcories rm -rf $RPM_BUILD_ROOT%{prefix}/lib rm -rf $RPM_BUILD_ROOT%{prefix}/include should be something like this: #remove empty directories rmdir $RPM_BUILD_ROOT%{_libdir} rmdir $RPM_BUILD_ROOT%{_includedir}
Wow. A few days of absence, and I have another bug fixed. Thanks!
htop-0.8.2-2.fc10 has been submitted as an update for Fedora 10. http://admin.fedoraproject.org/updates/htop-0.8.2-2.fc10
htop-0.8.2-2.fc9 has been submitted as an update for Fedora 9. http://admin.fedoraproject.org/updates/htop-0.8.2-2.fc9
htop-0.8.2-2.fc11 has been submitted as an update for Fedora 11. http://admin.fedoraproject.org/updates/htop-0.8.2-2.fc11
htop-0.8.2-2.fc10 has been pushed to the Fedora 10 stable repository. If problems still persist, please make note of it in this bug report.
htop-0.8.2-2.fc9 has been pushed to the Fedora 9 stable repository. If problems still persist, please make note of it in this bug report.
htop-0.8.2-2.fc11 has been pushed to the Fedora 11 stable repository. If problems still persist, please make note of it in this bug report.