Segmentation fault in gtop-1.0.11

     Subject: Bug in gtop-1.0.11 version on RH 7.1 with more than 1024

The NR_TASKS ( maximum number of task) value is defined in "dummy.h"  as
1024. The arrays used for saving the process data are allocated as below in
procview.c file :

 static struct save_hist save_history [NR_TASKS];
 struct save_hist new_save_hist [NR_TASKS];

However, while filling up these structures with task data for each task in
procview_update() routine in procview.c file, a check has not been make for
maximum number of tasks. Hence, gtop fails with a Segmentation fault due to
buffer over run when the number of tasks becomes greater than

     I fixed this problem by making a check for number of tasks
(proclist.number) in the procview_update() function in procview.c to see if
it is greater than NR_TASKS.
Please let me know your thoughts about this.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]