bugMIT/GNU Scheme - Bugs: bug #18764, compiler error in deeply nested...

 
 

bug #18764: compiler error in deeply nested loop

Submitted by:  Taylor R. Campbell <riastradh>
Submitted on:  Fri 12 Jan 2007 10:38:36 AM UTC  
 
Category: compilerSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Incorrect behavior
Status: FixedPrivacy: Public
Assigned to: Taylor R. Campbell <riastradh>Originator Name: 
Open/Closed: Closed
Keywords: 

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Wed 07 Oct 2009 06:43:53 PM UTC, comment #3:

Fixed in Git commit b70592cd55646c24592cfc0e4a3d788a97934076.

Taylor R. Campbell <riastradh>
Project MemberIn charge of this item.
Tue 19 Feb 2008 09:40:36 PM UTC, comment #2:

I have managed to isolate something -- I have not reduced the program down to a simpler case, but I have found a tiny change that toggles the error. I've attached two fully expanded files, one of which wins and the other of which loses. The only difference lies in the internal ANY procedure: whether it calls CDR directly, or whether it calls a local variable named SUCCESSOR whose value will be the CDR procedure.

I have a vague, and totally unsubstantiated, suspicion that the compiler is allocating a block for ANY whose parent is somewhere in PYTHAGOREAN-TRIPLES when it needs to refer to the CAR primitive (for the winning case), but is allocating some sort of detached block when ANY has no free variables like that, which makes stack allocation of the closure passed to it lose. But this is only a totally wild guess; I don't actually understand any of what's going on.

(file #15076, file #15077)

Taylor R. Campbell <riastradh>
Project MemberIn charge of this item.
Fri 12 Jan 2007 10:40:39 AM UTC, comment #1:

Sorry, fg.txt was too large to attach to the report. I have uploaded it here: <http://mumble.net/~campbell/tmp/triples-fg.txt>.

Taylor R. Campbell <riastradh>
Project MemberIn charge of this item.
Fri 12 Jan 2007 10:38:36 AM UTC, original submission:

Compiling the loop at <http://paste.lisp.org/display/34944#1> with certain declarations after loading these files:

<http://mumble.net/~campbell/scheme/syn-param.scm>
<http://mumble.net/~campbell/scheme/let-values.scm>
<http://mumble.net/~campbell/tmp/foof-loop.scm>
<http://mumble.net/~campbell/tmp/nested-foof-loop.scm>

yields the following error:

Block is not an ancestor #[reference-context 16] #[liar:block 17 stack pythagorean-triples-57]

triples.scm contains the original source code, including the declarations (omitting which makes the error go away); triples.pp.scm contains the expanded code; and fg.txt contains the output of (SHOW-FG) after the error.

I tried to isolate the problem to simpler code, but to no avail. Perhaps when I'm less tired I'll try again. The problem goes away if I strike out the last three declarations, and also if I move the definition of ANY outside PYTHAGOREAN-TRIPLES.

Taylor R. Campbell <riastradh>
Project MemberIn charge of this item.

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #15076:  triples-win.scm added by riastradh (7KiB - application/octet-stream)
file #15077:  triples-lose.scm added by riastradh (7KiB - application/octet-stream)
file #11729:  triples.scm added by riastradh (923B - application/octet-stream)
file #11730:  triples.pp.scm added by riastradh (5KiB - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by riastradh (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 7 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 07 Oct 2009 06:43:53 PM UTCriastradhStatusNone=>Fixed
      Assigned toNone=>riastradh
      Open/ClosedOpen=>Closed
    Tue 19 Feb 2008 09:40:36 PM UTCriastradhAttached File-=>Added triples-win.scm, #15076
      Attached File-=>Added triples-lose.scm, #15077
    Fri 12 Jan 2007 10:38:37 AM UTCriastradhAttached File-=>Added triples.scm, #11729
      Attached File-=>Added triples.pp.scm, #11730

    Back to the top


    Powered by Savane 3.1-cleanup1