"APPLY [ [] [unknown] ] []" leaks memory
A Logo programming environment for Microsoft Windows
Brought to you by:
david_costanzo
If APPLY attempts to run a "named slot template" instruction list and it has an unknown procedure, FMSLogo leaks memory.
I have reproduced this as far back as FMSLogo 6.11.0. In FMSLogo 6.10.1, the leak is not reproducible. A leak is reproducible in MSWLogo 6.5b, but I suspect that's a different memory leak that was fixed before FMSLogo 6.10.0.
How Reproducible:
Every Time
Steps to Reproduce:
SHOW NODES
REPEAT 1000 [ CATCH "error (LIST "APPLY (LIST [] (LIST "unknown) ) [] ) ]
SHOW NODES
What Happens:
The first item in the second NODES printout is several thousand larger than the first item in the first NODES printout
Expected Result:
The first item in the second NODES printout is about the same (within a hundred) of the first item in the first NODES printout.
The bug is not limited to an unknown procedure, it seems like any "named slot template" instruction will cause it. For example, this also reproduces the leak:
At first glance of the leaked nodes, it looks the node representing the anonymous function is leaked because the "treeification" creates a circular reference that is only broken if the node is explicitly untreeified.
In looking at CHANGELOG.TXT for version 6.11.0, I don't see anything that could have introduced this.