9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: erik quanstrom <quanstro@labs.coraid.com>
To: 9fans@9fans.net
Subject: [9fans] how big?
Date: Thu, 28 Apr 2011 11:17:14 -0400	[thread overview]
Message-ID: <8719cb00899434f0a526dc47d36cc550@coraid.com> (raw)

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	other threads:[~2011-04-28 15:17 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8719cb00899434f0a526dc47d36cc550@coraid.com \
    --to=quanstro@labs.coraid.com \
    --cc=9fans@9fans.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).