[plt-scheme] Jewel and OSX

From: David Einstein (deinst at gmail.com)
Date: Fri Oct 27 11:54:43 EDT 2006

My girlfriend has become somewhat addicted to playing jewel and has
discovered an intermittent bug.  I think that I have fixed it, but I am less
than sure of the exact problem.
This happened with both versions 301 and 352.

The bug:
Occasionally when ending the game  one of two things happens

1) The machine locks up.  The little spinning cursor pops up, you can move
the mouse, but there seems to be no way to force plt to quit without
shutting down the machine.
2) The dialog asking you for your name appears repeatedly.  After the first
occurrence your name is entered in the high score table normally,
subsequent occurrences enter your sore in the table with the name
"UNKNOWN".  This repeats until the high score tale has all lower scores than
yours replaced with "UNKNOWN"

The fix:
My conjecture is that this was caused by the fact that the 'declife'
function does not turn off the timer when the game is over, and so if you
are in an 'UNSWAPPING' state you can enter the high score routine multiple
times, and one of the functions called by the high score routines is not
thread safe.  Keeping 'declife' from calling the high score routine more
than once seems to have cured the problems, but one can never be sure.  Does
this fix make sense?

I should attempt to recreate the problem with a small snippet of code, but I
am loath to lock may machine up in the interests of science.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20061027/b6f92d0c/attachment.html>

Posted on the users mailing list.