The following code puts FMSLogo into an undefined state
OPENUPDATE "clipboard CLOSE "clipboard
This is due to a code path that uses an uninitialized FILE* tstrm in open_file() in files.cpp. This bug has existed at least as far back as MSWLogo 5.6b, which crashes in this case. FMSLogo has the same bug, but usually doesn't crash, perhaps because the gcc C Runtime is more forgiving or gcc fills the stack with zero bytes. Instead, FMSLogo usually throws a File System Error in OPENUPDATE, but it can also crash.
In debug versions of FMSLogo, OPENUPDATE "clipboard crashes every time.
To reproduce the crash in a production FMSLogo, run this
REPEAT 1000 [
CATCH "ERROR [
OPENUPDATE "clipboard
CLOSE "clipboard
]
]
Note: There are other modes which exhibit the same bug, including (OPENREAD "clipboard "true). By inspection of the source code, the only safe ways to open the clipboard is the OPENREAD or OPENWRITE with default number of inputs.
This is fixed by [r5453]. The fix will be available in FMSLogo 8.0.0.
Related
Commit: [r5453]