[M3devel] AMD64_LINUX gc/stubgen

Jay jay.krell at cornell.edu
Mon Nov 10 20:35:19 CET 2008


It /seems/ like any switch or switch combination makes it stop happening.
Admittedly I haven't run a loop just a few runs by hand for each combo.
 
Maybe have it record the allocation quantities and "play them back"?
 
 - Jay


From: hosking at cs.purdue.edu
To: jay.krell at cornell.edu
Date: Mon, 10 Nov 2008 11:13:05 +0000
CC: m3devel at elegosoft.com
Subject: Re: [M3devel] AMD64_LINUX gc/stubgen




Hmm.  Can you try @M3paranoidgc @M3noincremental @M3nogenerational?


On 10 Nov 2008, at 08:28, Jay wrote:


@M3paranoidgc always succeeds. I see, reading the code, it only does reads. Nevertheless.
 
Simply programs that just allocate memory forever also succeed.
Such as this:
 
jay at amd64a:/dev2/cm3/t$ cat src/t.m3
MODULE t EXPORTS Main;
TYPE T1 = RECORD c : ARRAY [0..10000000] OF INTEGER; END;
TYPE T2 = RECORD c : ARRAY [0..4095] OF INTEGER; END;
 
VAR a: REFANY;
 
PROCEDURE F1()=
VAR b: REFANY;
BEGIN
  WHILE TRUE DO
    b := NEW(REF T2);
    a := NEW(REF T1);
  END;
END F1;
 
BEGIN
  F1();
END t.
 
Darn.
 
 - Jay






From: hosking at cs.purdue.edu
To: jay.krell at cornell.edu
Date: Sun, 9 Nov 2008 18:02:41 +0000
CC: m3devel at elegosoft.com
Subject: Re: [M3devel] AMD64_LINUX gc/stubgen



Clearly a problem with GC.  I'm guessing you have something wrong (pointer alignment?) in the configuration.  I suspect if you run with @M3paranoidgc you'll trip over the problem.





On 9 Nov 2008, at 14:09, Jay wrote:


Tony, any tips on this one? :)
 
jay at amd64a:~/dev2/cm3/m3-ui/zeus/AMD64_LINUX$ /cm3/bin/stubgen -v1 -sno RemoteView.T -T.M3IMPTAB @M3nogc
 
always succeeds.
 
jay at amd64a:~/dev2/cm3/m3-ui/zeus/AMD64_LINUX$ /cm3/bin/stubgen -v1 -sno RemoteView.T   -T.M3IMPTAB
 
usually fails:

***
*** runtime error:
***    NEW() was unable to allocate more memory.
***    file "../src/runtime/common/RTAllocator.m3", line 285
***

Formatter.m3:
 
CONST ChunkSize = 128; (* Must be a power of 2 *)

PROCEDURE New(wr: Wr.T;  width: CARDINAL:= 75): T RAISES {} =
  BEGIN
    WITH t = NEW(T) DO
      t.wr := wr;
      t.width := width;
      t.indent := 0;
  
      t.numChars := 0;
  
      (* t.stream := RefStream{NIL, ..}; *)
  
      t.buffer := NEW (ExprBuf, 4 * ChunkSize);  << this is the line that fails
 
Lowering chunk size to 64 seemed to make it succeed more often, but not always.
I think I'll go back to MIPS64_OPENBSD..probably easier to track that problem down.
 
 - Jay


More information about the M3devel mailing list