9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] leak(1)
@ 2015-03-06  9:30 Steve Simon
  2015-03-06  9:44 ` cinap_lenrek
  2015-03-06 16:37 ` erik quanstrom
  0 siblings, 2 replies; 4+ messages in thread
From: Steve Simon @ 2015-03-06  9:30 UTC (permalink / raw)
  To: 9fans

I am getting an error from leak(1):

	<stdin>:2: (error) mainmem used but not set

Anyone seen such, understand, or even know where its coming from?

-Steve



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [9fans] leak(1)
  2015-03-06  9:30 [9fans] leak(1) Steve Simon
@ 2015-03-06  9:44 ` cinap_lenrek
  2015-03-06 10:52   ` Quintile
  2015-03-06 16:37 ` erik quanstrom
  1 sibling, 1 reply; 4+ messages in thread
From: cinap_lenrek @ 2015-03-06  9:44 UTC (permalink / raw)
  To: 9fans

are you trying to debug a ape program? ape programs do not
use the plan9 pool allocator.

--
cinap



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [9fans] leak(1)
  2015-03-06  9:44 ` cinap_lenrek
@ 2015-03-06 10:52   ` Quintile
  0 siblings, 0 replies; 4+ messages in thread
From: Quintile @ 2015-03-06 10:52 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

I think that's it. thanks.

obvious when you know of course😄

Steve





> On 6 Mar 2015, at 09:44, cinap_lenrek@felloff.net wrote:
> 
> are you trying to debug a ape program? ape programs do not
> use the plan9 pool allocator.
> 
> --
> cinap



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [9fans] leak(1)
  2015-03-06  9:30 [9fans] leak(1) Steve Simon
  2015-03-06  9:44 ` cinap_lenrek
@ 2015-03-06 16:37 ` erik quanstrom
  1 sibling, 0 replies; 4+ messages in thread
From: erik quanstrom @ 2015-03-06 16:37 UTC (permalink / raw)
  To: 9fans

On Fri Mar  6 01:33:22 PST 2015, steve@quintile.net wrote:
> I am getting an error from leak(1):
>
> 	<stdin>:2: (error) mainmem used but not set
>
> Anyone seen such, understand, or even know where its coming from?

i had to use some patches to acidleak to keep it from running out of
memory on medium-sized heaps due to a pathological case in the pool
allocator.  (plus, linear allocation usually ends in tears):

; 9diff acidleak.c
/n/sources/plan9/sys/src/cmd/aux/acidleak.c:202,213 - acidleak.c:202,211
  		p[Blinelen(&bio)-1] = '\0';
  		nf = tokenize(p, f, nelem(f));
  		if(nf >= 4 && strcmp(f[0], "data") == 0) {
- 			if(ndata >= adata){
+ 			if(ndata == adata){
  				if(adata == 0)
  					adata = 4096;
- 				else
- 					adata += adata / 4;  /* increase 25% */
- 				data = erealloc(data, adata * sizeof(Data));
+ 				data = erealloc(data, (adata <<= 1)*sizeof(Data));
  			}
  			data[ndata].addr = strtoul(f[1], nil, 0);
  			data[ndata].val = strtoul(f[2], nil, 0);
/n/sources/plan9/sys/src/cmd/aux/acidleak.c:215,228 - acidleak.c:213,223
  			data[ndata].b = 0;
  			ndata++;
  		}
- 		if(nf >= 5 &&
- 		    (strcmp(f[0], "block") == 0 || strcmp(f[0], "free") == 0)) {
- 			if(nblock >= ablock){
+ 		if(nf >= 5 && (strcmp(f[0], "block") == 0 || strcmp(f[0], "free") == 0)) {
+ 			if(nblock == ablock){
  				if(ablock == 0)
  					ablock = 4096;
- 				else
- 					ablock += ablock / 4; /* increase 25% */
- 				block = erealloc(block, ablock * sizeof(Block));
+ 				block = erealloc(block, (ablock <<= 1)*sizeof(Block));
  			}
  			block[nblock].addr = strtoul(f[1], nil, 0);
  			block[nblock].size = strtoul(f[2], nil, 0);

- erik



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-03-06 16:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-06  9:30 [9fans] leak(1) Steve Simon
2015-03-06  9:44 ` cinap_lenrek
2015-03-06 10:52   ` Quintile
2015-03-06 16:37 ` erik quanstrom

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).