Package: spu-tools
Version: 2.3.0.136-1
Severity: normal
Tags: patch upstream


The spu-top program will segfault if the system doesn't have a /spu directory.
Also if the directory is removed while spu-top is running it will segfault. A
simple fix is attached that just checks if the call to read info from /spu fails
and exits the program if it does. A better fix would probably involve informing 
the user somehow but this patch at least shows the problem area.

--- src/spu-top.c        2008-06-05 09:22:49.000000000 -0500
+++ src/spu-top.c       2010-04-20 18:48:45.000000000 -0500
@@ -424,6 +424,9 @@
        /* Providing a valid time range for the first measure (0.055 sec) */
        spus = get_spus();
        ctxs = get_spu_contexts(refresh_delay);
+       if (ctxs == NULL) {
+               quit();
+       }
        procs = get_procs(ctxs);
        usleep(55000);
 
@@ -442,6 +445,9 @@
                if (min_time_has_passed) {
                        spus = get_spus();
                        ctxs = get_spu_contexts(period);
+                       if (ctxs == NULL) {
+                               quit();
+                       }
                        procs = get_procs(ctxs);
                        fill_spus_tids(spus, ctxs);
                        last_time = current_time;


-- System Information:
Debian Release: squeeze/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: powerpc (ppc64)

Kernel: Linux 2.6.34-rc4--20100417-02-00115-gdc57da3 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages spu-tools depends on:
ii  libc6                     2.10.2-6       Embedded GNU C Library: Shared lib
ii  libncurses5               5.7+20100313-2 shared libraries for terminal hand

spu-tools recommends no packages.

spu-tools suggests no packages.

-- no debconf information




-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to