wanderingstan / iphonefrotz

Automatically exported from code.google.com/p/iphonefrotz
Other
0 stars 0 forks source link

Crash iFrotz with built-in game help system #155

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I have been able to crash iFrotz occasionally when using my game's built-in 
help system.  When selecting different choices in the in-game Help. I am not 
sure if this is a new situation with 1.5.2 or if it has existed in earlier 
versions. I use Emily Short's "Menus" extension to display help. It is hard to 
reproduce this error, but it seems to happen the *second* or third time I bring 
up the in-game help system.  I use the N key for next topic and P for Previous. 
 Sometimes it crashes on P, sometimes on N for next.  When I resume iFrotz, it 
resumes in the Help extension but with a blank screen.

Emily Short is a fairly prolific IF writer this extension is quite popular.  It 
could be a bug in her code, but I've never been able to crash other Glulx 
interpreters in this area of the game. (Or in any areas.) 

Sorry I wasn't able to make this more reproduceable.   I am happy to send you 
my .Gblorb file if that's helpful to you.

What is the expected output or behavior?  What do you see instead?
> It should stay in the in-game help system, but crashes out to iOS

What version of Frotz are you using?
>1.5.2

What device model are you using (iPhone 3GS, iPad, iPod Touch 3rd gen,
etc.)
>iPad 1

What version of iOS?  3.2, 4.0, 4.3, etc.)
>4.3.2

Original issue reported on code.google.com by ZUrloc...@hotmail.com on 25 Apr 2011 at 3:37

GoogleCodeExporter commented 9 years ago
I *think* this is fixed in 1.5.3.  Reopen or re-report if you it still occurs 
for you.

Original comment by spath...@gmail.com on 9 Jun 2011 at 11:45

GoogleCodeExporter commented 9 years ago
Thanks much.  It appears to be fixed. Thanks also for getting the email 
attachments open working again.  That's really helpful for my alpha testers.  
If you would like to test the latest version of The Z-Machine Matter, it's 
available here:

http://www.box.net/shared/dp2c38dket

--Zack

Updates:
    Status: Fixed

Original comment by ZUrloc...@hotmail.com on 10 Jun 2011 at 3:11

GoogleCodeExporter commented 9 years ago
Craig,
thanks for the updates to 1.5.3.  It definitely fixes the ability to open games 
via email attachments, which is great.

I have not had a ton of time to test the new version, but I did have one crash 
today in the same area of the help system.  However it does not appear to be 
reproducible.   It was the first time I loaded the game, went  immediately to 
HELP, hit N several times for next topic and BOOM it crashed.  I have not seen 
any crashes on other Glulx interpreters.

I will try to test this again later in the week and see if I can make it 
reproducible.   Also, here's a link to the Gblorb file in case it's helpful.  

http://www.box.net/shared/dp2c38dket

--Zack

Updates:
    Status: Fixed

Original comment by ZUrloc...@hotmail.com on 13 Jun 2011 at 6:08

GoogleCodeExporter commented 9 years ago
Reopening issue.
I was able to reproduce the crashing bug in 1.5.3 with repeated banging on the 
n and p keys in the latest version of The Z-Machine Matter.

Original comment by spath...@gmail.com on 13 Jun 2011 at 6:27

GoogleCodeExporter commented 9 years ago
I think I know why Frotz is intermittently crashing in your help system.  It 
may be a while before I can get up a fix, but I think you can work around the 
problem in your game source as well.

Because of the way iOS works, it was necessary to make Frotz multi-threaded, so 
the UI is updated asynchronously from the game engine that is interpreting the 
story file.  There is a race condition in Frotz's implementation of Glk grid 
windows where a section of code is not properly protected by a mutex lock.  If 
a Glk grid window (such as the status line) is resized smaller by the game 
thread while it is being actually drawn by the UI thread, a crash may occur.

Your help system, for some reason, resizes the top status window to 1 line and 
then back to 4 lines every time you hit N or P.  There doesn't seem to be any 
reason for it to do this, and If it didn't and just left the status line at 4 
lines, it would avoid the crash (and also avoid flickering).

Original comment by spath...@gmail.com on 20 Jun 2011 at 5:12

GoogleCodeExporter commented 9 years ago
Thanks for the info.  All of the Help system code and some code I use to update 
the status line were from extensions that I did not actually write and am 
unfamiliar with.  I will try to post some information about this to the authors 
Emily Short (help) and Eric Eve (Exit lister). 

--Zack

Comment #5 on issue 155 by spath...@gmail.com: Crash iFrotz with built-in game 
help system
http://code.google.com/p/iphonefrotz/issues/detail?id=155

I think I know why Frotz is intermittently crashing in your help system.  It 
may be a while before I can get up a fix, but I think you can work around the 
problem in your game source as well.

Because of the way iOS works, it was necessary to make Frotz multi-threaded, so 
the UI is updated asynchronously from the game engine that is interpreting the 
story file.  There is a race condition in Frotz's implementation of Glk grid 
windows where a section of code is not properly protected by a mutex lock.  If 
a Glk grid window (such as the status line) is resized smaller by the game 
thread while it is being actually drawn by the UI thread, a crash may occur.

Your help system, for some reason, resizes the top status window to 1 line and 
then back to 4 lines every time you hit N or P.  There doesn't seem to be any 
reason for it to do this, and If it didn't and just left the status line at 4 
lines, it would avoid the crash (and also avoid flickering).

Original comment by ZUrloc...@hotmail.com on 22 Jun 2011 at 4:00

GoogleCodeExporter commented 9 years ago
svn revision 259

Original comment by spath...@gmail.com on 3 May 2012 at 6:22

GoogleCodeExporter commented 9 years ago
Fixed in 1.6 on App Store.

Original comment by spath...@gmail.com on 23 Oct 2012 at 1:48