FMSLogo becomes unstable when BITMAPTURTLE has no bitmap
A Logo programming environment for Microsoft Windows
Brought to you by:
david_costanzo
The wxwidgets version of FMSLogo becomes unstable when you call BITMAPTURTLE when there is no bitmap.
How Reproducible:
Every Time
Steps to Reproduce:
1) Run this
SETTURTLE 1 BITMAPTURTLE
2) Open and close the editor repeatedly.
An easy way to do this is to hold down Ctrl+d for a few seconds.
What Happens:
FMSLogo crashes/disappears
Expected Result:
The editor opens and closes without problem.
The turtle that was bitmapped looks as if it is hidden (zero-sized bitmap)
Note: a debug version of the wxWidgets fmslogo.exe prints this assert failure after running BITMAPTURTLE.
---------------------------
MinGW Runtime Assertion
---------------------------
Assertion failed!
Program: C:\Documents and Settings\Dave\My Documents\logo-cvs\logo\wxwidgets\fmslogo.exe
File: ../src/graphwin.cpp, Line 236
Expression: i < g_BitmapsLimit
---------------------------
Abort Retry Ignore
---------------------------
For me, FMSLogo doesn't become unstable. (WIN 7 / 64-bit / 6.32.0 / wxWidgets)
Nothing happend.
This also does not occur.
Thanks for the information, Jan. Indeed, I am also unable to reproduce this using the publicly-released wxWidgets FMSLogo version 6.32.0. I am able to reproduce this using a debug version of OWL or wxWidgets. Debug versions make memory bugs cause obvious problems that may be unlikely (but possible) to occur in release versions. In short, I expect the bug exists, but may not cause visible problems in most causes.
Since this is not specific to the wxWidgets version, I have updated the title.
I was able to reproduce this bug using WIN 7 / 64-bit / 6.35.0 / wxWidgets with the following code:
Steps to Reproduce:
SETBITINDEX 1
BITCUT 20 20
SETTURTLE 2
(BITMAPTURTLE "true)
What Happens:
FMSLogo crashes
Expected Result:
Exception: no bitmap 2 set
or
Bitmap 1 should be mapped to turtle 2
or
The turtle that was bitmapped looks as if it is hidden
Diff:
Thanks Jan. Your repro steps are much better than mine and I could easily reproduce the crash on 6.35.0. Amusingly, on a debug version of 7.0.0 beta, I got a random bitmap for my turtle. I've increased the priority for fixing this.
I have committed a fix, which will be available in FMSLogo 7.0. My fix makes FMSLogo behaves as if the bitmap was zero-sized (as opposed to making it an error). This gives the programmer the freedom to set the turtle before setting the bitmap if that happens to be more natural in their program.