Bug 505387 - htop crashes on pressing "a"
Summary: htop crashes on pressing "a"
Keywords:
Status: CLOSED DUPLICATE of bug 504795
Alias: None
Product: Fedora
Classification: Fedora
Component: htop
Version: 10
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Rafał Psota
QA Contact: Fedora Extras Quality Assurance
URL: http://sourceforge.net/tracker/index....
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-06-11 18:02 UTC by Tobias Mueller
Modified: 2009-06-12 09:18 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-06-12 09:18:21 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
Patch which checks for the end of an NULL terminated(!) array (1.48 KB, patch)
2009-06-11 18:26 UTC, Tobias Mueller
no flags Details | Diff
Patch which NULL terminates all arrays (3.24 KB, patch)
2009-06-11 18:33 UTC, Tobias Mueller
no flags Details | Diff

Description Tobias Mueller 2009-06-11 18:02:45 UTC
Description of problem:
htop crashes, when I press "a"

Version-Release number of selected component (if applicable):
0.8.2

How reproducible:
start htop, press a, crashes immediately

Steps to Reproduce:
1. ./htop
2. press "a"
3.
  
Actual results:
Program received signal SIGSEGV, Segmentation fault.
strlen () at ../sysdeps/x86_64/strlen.S:37
37 0: cmpb $0x0,(%rax) /* is byte NUL? */
Current language: auto; currently asm
(gdb) bt
#0 strlen () at ../sysdeps/x86_64/strlen.S:37
#1 0x0000003fb4480ba6 in __strdup (
s=0x4a314554 <Address 0x4a314554 out of bounds>) at strdup.c:42
#2 0x00000000004055f3 in FunctionBar_new (functions=0x7fffffffe060,
keys=0x7fffffffa5c0, events=0x7fffffffa5e0) at FunctionBar.c:57
#3 0x00000000004060a3 in pickFromVector (panel=0x82cd70, list=0x83d660,
x=15,
y=6, keyLabels=0x7fffffffe060, prevBar=0x82da10) at htop.c:198
#4 0x00000000004072f7 in main (argc=<value optimized out>,
argv=<value optimized out>) at htop.c:660
(gdb) t a a bt full
(gdb) quit
Expected results:
I expected htop not to crash at all.

Additional info:
Linux bigbox 2.6.27.24-170.2.68.fc10.x86_64 #1 SMP Wed May 20 22:47:23 EDT 2009 x86_64 x86_64 x86_64 GNU/Linux

Upstream bugreport: http://sourceforge.net/tracker/index.php?func=detail&atid=651633&aid=2803527&group_id=108839

Comment 1 Tobias Mueller 2009-06-11 18:25:13 UTC
seems to be the same issue as bug 504795. I cooked up a patch for my issue, I smell other bugs, because *every* functions array has to be NULL terminated (with the solution I propose).

Comment 2 Tobias Mueller 2009-06-11 18:26:35 UTC
Created attachment 347448 [details]
Patch which checks for the end of an NULL terminated(!) array

This fixes the issue for me. If you want to port this patch to fix other issues, look out for the creation of a char* array which is passed to FunctionBar_new. The array has to be NULL terminated.

Comment 3 Tobias Mueller 2009-06-11 18:33:51 UTC
Created attachment 347449 [details]
Patch which NULL terminates all arrays

This patch NULL terminates all arrays, I've found.

Comment 4 Michal Nowak 2009-06-12 09:18:21 UTC

*** This bug has been marked as a duplicate of bug 504795 ***


Note You need to log in before you can comment on or make changes to this bug.