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

 
 

bug #18764: compiler error in deeply nested loop

Submitter:  Taylor R. Campbell <riastradh>
Submitted:  Fri 12 Jan 2007 10:38:36 AM UTC
   
 
Category:  compiler Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect behavior
Status:  Fixed Privacy:  Public
Assigned to:  riastradh Originator Name: 
Open/Closed:  Closed
Keywords: 
* Mandatory Fields

Add a New Comment Rich Markup
   

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

Fixed in Git commit b70592cd55646c24592cfc0e4a3d788a97934076.

Taylor R. Campbell <riastradh>
Group Member
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>
Group Member
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>
Group Member
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>
Group Member

 

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

Attach Files:
   
   
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
  • -email is unavailable- added by riastradh (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 7 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2009-10-07 riastradh StatusNone Fixed
        Assigned toNone riastradh
        Open/ClosedOpen Closed
    2008-02-19 riastradh Attached File- Added triples-win.scm, #15076
        Attached File- Added triples-lose.scm, #15077
    2007-01-12 riastradh Attached File- Added triples.scm, #11729
        Attached File- Added triples.pp.scm, #11730

    Back to the top

    Powered by Savane 3.15-e6e5.
    Corresponding source code