• Join/Login
  • Business Software
  • Open Source Software
  • For Vendors
  • Blog
  • About
  • More
    • Articles
    • Create
    • SourceForge Podcast
    • Site Documentation
    • Subscribe to our Newsletter
    • Support Request
SourceForge logo
For Vendors Help Create Join Login
SourceForge logo
Business Software
Open Source Software
SourceForge Podcast
Resources
  • Articles
  • Case Studies
  • Blog
Menu
  • Help
  • Create
  • Join
  • Login
  • Home
  • Browse
  • FMSLogo
  • Bugs
FMSLogo

Using COPYDEF of OUTPUT can crash

A Logo programming environment for Microsoft Windows

Brought to you by: david_costanzo
  • Summary
  • Files
  • Reviews
  • Support
  • Tickets ▾
    • Feature Requests
    • Bugs
    • Support Requests
  • Discussion
  • Code
Menu ▾ ▴
  • Create Ticket
  • View Stats

Group

  • v_6.06x
  • v_6.07.X
  • v_6.08.X
  • v_6.10.X
  • v_6.11.X
  • v_6.13.X
  • v_6.22.X
  • v_6.25.X
  • v_6.26.X
  • v_6.27.X
  • v_6.28.X
  • v_6.29.X

Searches

  • Changes
  • Closed Tickets
  • Open Tickets

Help

  • Formatting Help

#126 Using COPYDEF of OUTPUT can crash

v_6.06x
open
David Costanzo
Language Engine (245)
1
2026-07-28
2006-03-20
David Costanzo
No

COPYDEF can be used to create a new name for an existing procedure. However if you use a COPYDEF of OUTPUT, it can crash when its used. So far, I have only seen this in contrived cases, where the COPYDEF was called within the procedure where it was used. I have been able to use a COPYDEF of OUTPUT successfully in other scenarios.

How Reproducible:
Every Time

Steps to Reproduce:

TO MYPROC
COPYDEF "MYOUTPUT "OUTPUT
MYOUTPUT 123
END

SHOW MYPROC

What Happens:
FMSLogo crashes

Expected Result:
SHOW MYPROC prints 123.

Related

Bugs: #620

Discussion

  • David Costanzo

    David Costanzo - 2006-09-10

    Logged In: YES
    user_id=109252

    I have checked in a further mitigation for this bug, which
    will be available in FMSLogo 6.11.0.

    The fix was copied in from UCBLogo, but that fix leaks
    memory. The problem is that the code doesn't "re-treeify" a
    body node if the definition of a function changes in
    mid-execution, which could crash if the definition changed
    in a significant way for tree-ification (such going from
    undefined to defined, or changing the number of inputs).

    UCBLogo "leaks" the tree-ificiation of the procedure, which
    is not a problem for UCBLogo, because it has true garbage
    collection. But this results in a very significant memory
    leak for FMSLogo. My stop-gap fix for this memory leak is
    to untree-ify the procedure after it is executed.
    Unfortunately, this means that the original bug still exists
    for functions that are tree-recursive (non-tail recursive)
    because once the inner call exits, the outer call becomes
    untree-ified and can no longer handle having a procedure change.

    Since the current change reduces the scope of the bug, I
    have submitted it. I'm not sure what the final fix will
    be--it may either be a reference count on the tree-ification
    or simply to keep the tree-ification around for the lifetime
    of the procedure.

     
    If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
  • David Costanzo

    David Costanzo - 2006-10-01

    Logged In: YES
    user_id=109252

    The strategy that I mentioned in the previous comment had a
    noticable, deterimal effect on performance, so I have
    instead adopted a different strategy that is closer to what
    UCBLogo does.

    Now, the code untreeifies a procedure in three places:
    1) When the workspace generation changes.
    2) When a procedure is erased.
    3) When FMSLogo is shut down.

    This "lazy evaluation" has the added benifit of not
    treeifing a procedure every time it is called. It has the
    drawback of increasing the working set for FMSLogo.

    This change will be available in FMSLogo 6.11.0.

     
    If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
  • amicheler

    amicheler - 2007-02-10

    Logged In: YES
    user_id=1303092
    Originator: NO

    Hallo David,

    do you have a solution for this bug (#1454113) already?
    I have the same problem in aUCBLogo.

    Thanks,
    Andreas

     
    If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
  • David Costanzo

    David Costanzo - 2007-02-11

    Logged In: YES
    user_id=109252
    Originator: YES

    No, I haven't fixed this bug. I got COPYDEF to work in most cases, but it still crashes/hangs when a COPYDEF of OUTPUT is used in a tree-recursive procedure. (This is the only test case that is commented out in src\test\copydef.lgo).

    I'm surprised that this is a problem for aUCBLogo because I thought aUCBLogo was based on the most recent UCBLogo engine, and I didn't think that UCBLogo had this bug.

     
    If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
  • amicheler

    amicheler - 2007-02-11

    Logged In: YES
    user_id=1303092
    Originator: NO

    I got this to working last night,
    so it's not important for aUCBLogo any more.

    I thinks I had destroyed
    the working UCBLogo copydef-eval implementation some time before.
    Now it is fixed in aUCBLogo again (was pretty hard).

    Thanks,
    Andreas

     
    If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
  • David Costanzo

    David Costanzo - 2026-07-28
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -1,24 +1,20 @@
    -COPYDEF can be used to create a new name for an
    -existing procedure.  However if you use a COPYDEF of
    -OUTPUT, it can crash when its used.  So far, I have
    -only seen this in contrived cases, where the COPYDEF
    -was called within the procedure where it was used.  I
    -have been able to use a COPYDEF of OUTPUT successfully
    -in other scenarios.
    +COPYDEF can be used to create a new name for an existing procedure.  However if you use a COPYDEF of OUTPUT, it can crash when its used.  So far, I have only seen this in contrived cases, where the COPYDEF was called within the procedure where it was used.  I have been able to use a COPYDEF of OUTPUT successfully in other scenarios.
    
    -How Reproducible:
    +**How Reproducible:**
     Every Time
    
    -Steps to Reproduce:
    +**Steps to Reproduce:**
    +```text
     TO MYPROC
     COPYDEF "MYOUTPUT "OUTPUT
    -MYOUPUT 123
    +MYOUTPUT 123
     END
    
     SHOW MYPROC
    +```
    
    -What Happens:
    +**What Happens:**
     FMSLogo crashes
    
    -Expected Result:
    -SHOW MYPROC prints 123.
    +**Expected Result:**
    +`SHOW MYPROC` prints 123.
    
     
    If you would like to refer to this comment somewhere else in this project, copy and paste the following link:

Log in to post a comment.

SourceForge
  • Create a Project
  • Open Source Software
  • Business Software
  • Top Downloaded Projects
Company
  • About
  • Team
  • SourceForge Headquarters
    1320 Columbia Street Suite 310
    San Diego, CA 92101
    +1 (858) 422-6466
Resources
  • Support
  • Site Documentation
  • Site Status
  • SourceForge Reviews
SourceForge logo
© 2026 Slashdot Media. All Rights Reserved.
Terms Privacy Opt Out Advertise

Cerberus Logo