so i was looking at what's going on with gs.  it appears to be having
ape issues.  but along the way this cropped up:

; ps -a | grep gs
quanstro      79590    0:04   0:03  4292893752K Broken   gs -dNOPAUSE 
-dDELAYSAFER -sDEVICE=plan9 -sOutputFile=/fd/3 -dQUIET -r100 -dTextAlphaBits=4 
-dGraphicsAlphaBits=4 -

that's interesting.  4TB of memory.  i don't recall having that much
memory.  /proc/79590/segment looks a little more reasonable, and
hints at the problem, with the bucky bit being set

; cat /proc/79590/segment
Stack     defff000 dffff000    1
Text   R  00001000 00232000    1
Data      00232000 002b8000    1
Bss       002b8000 8170f000    1

it turns out to be a sign extension problem in devproc.
since we need to face up to 64 bits at some point, i just
used a uvlong


/n/dump/2011/0428/sys/src/9/port/devproc.c:677,682 - devproc.c:677,683
        char *a, flag[10], *sps, *srv, statbuf[NSEG*64];
        int i, j, m, navail, ne, pid, rsize;
        long l;
+       uvlong u;
        uchar *rptr;
        ulong offset;
        Confmem *cm;
/n/dump/2011/0428/sys/src/9/port/devproc.c:857,869 - devproc.c:858,870
                        readnum(0, statbuf+j+NUMSIZE*i, NUMSIZE, l, NUMSIZE);
                }
                /* ignore stack, which is mostly non-existent */
-               l = 0;
+               u = 0;
                for(i=1; i<NSEG; i++){
                        s = p->seg[i];
                        if(s)
-                               l += s->top - s->base;
+                               u += s->top - s->base;
                }
-               readnum(0, statbuf+j+NUMSIZE*6, NUMSIZE, l>>10, NUMSIZE);
+               readnum(0, statbuf+j+NUMSIZE*6, NUMSIZE, u>>10u, NUMSIZE);
                readnum(0, statbuf+j+NUMSIZE*7, NUMSIZE, p->basepri, NUMSIZE);
                readnum(0, statbuf+j+NUMSIZE*8, NUMSIZE, p->priority, NUMSIZE);
                memmove(a, statbuf+offset, n);

a test machine gives more reasonable numbers

; ps -a | grep gs
quanstro        265    0:02   0:01  2120760K Broken   gs -dNOPAUSE -dDELAYSAFER 
-sDEVICE=plan9 -sOutputFile=/fd/3 -dQUIET -r100 -dTextAlphaBits=4 
-dGraphicsAlphaBits=4 -

- erik

Reply via email to