bugGnash - The GNU Flash player - Bugs: bug #33780, Hostile Skies caused Gnash to...

 
 

bug #33780: Hostile Skies caused Gnash to freeze on dropping bombs on enemies' plane

Submitter:  Nutchanon Wetchasit <nachanon>
Submitted:  Sat 16 Jul 2011 07:54:10 AM UTC
Votes: 15
 
Category:  ActionScript Severity:  3 - Normal
Release:  0.8.9 Status:  Confirmed
Privacy:  Public Assigned to:  None
Open/Closed:  Open
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Wed 29 Jun 2016 01:25:27 PM UTC, comment #6: 

@strk:
Regarding libming, I think a good way to provide test coverage for Gnash in this aspect, is hacking MakeSWF (or writing a new libming-based utility) to provide an ability to insert ActionScript code into existing SWF:

  • Insert/replace normal action and init action in individual frame of root timeline
  • Insert/replace normal action and init action in individual frame of any sprite (MovieClip) symbol
  • Bind ActionScript class to any sprite (MovieClip) symbol
  • Bind ActionScript class to root movie (not sure if this is possible since Macromedia Flash does not allow this; but it is surely convenient, and commonly used in Flash 9+ AS3 movies)


This way users and testers could closely emulate Macromedia Flash workflow by creating skeleton SWF using SWFmill Simple with arbitrary library symbol combination and timeline structure, then add ActionScript to each part of them (akin to selecting an object and bring up Action dialog under Macromedia Flash).

MTASC currently allows this, but in a very limited fashion, as it does not support multiple-frame timeline ActionScript, init action, sub-MovieClip timeline ActionScript, sub-MovieClip class binding, or assembler directive.

Nutchanon Wetchasit <nachanon>
Wed 29 Jun 2016 01:20:24 PM UTC, comment #5: 

Compare and contrast: If the handler function was declared from outside of the affected MovieClip, then got assigned as an event handler, this handler will run till its end, no matter that the MovieClip it got event from was removed using `removeMovieClip()` in the middle or not.

Test SWFs, source code, build scripts, and player logs are attached as `removemovie-events-fromroot.zip`.

So the termination is likely to be decided from code's closure scope: if handler's closure was destroyed on `removeMovieClip()` (e.g. the handler function was declared from inside the removed MovieClip itself), the affected handler terminates instantly.

On the other hand, if handler's closure was not affected by the `removeMovieClip()` call (e.g. it was declared on root or other MovieClip and got assigned in), the handler code runs until its end.

Gnash: 0.8.11dev (git f6a0b38 2-Jun-2016)
Flash Player: 11.2.202.491 Standalone
System: Debian GNU/Linux 7.0 Wheezy i386

P.S. The `removemovie-keydown-fromroot.swf` is affected by the same onKeyDown event issue as one mentioned in comment 3.


(file #37623)

Nutchanon Wetchasit <nachanon>
Mon 27 Jun 2016 11:32:04 AM UTC, comment #4: 

you minght be able to  bind a method/class to a sub-MovieClip before attaching it to stage under libming (but not makeswf).

Or, you could provide a patch to libming to make it possible (we improved it a lot already starting from Gnash testcases needs)

Sandro Santilli <strk>
Group Member
Mon 27 Jun 2016 03:14:15 AM UTC, comment #3: 

I have tested few possibilities of how `MovieClip.removeMovieClip()` could get called and how it affects/terminates ActionScript runtime flow; it seems that Gnash reacted correctly in the simplest case, but not in more-advanced ones.

  • removeMovieClip() called from timeline of the same sub-MovieClip: sub-MovieClip's timeline code terminated immediately under both Flash Player and Gnash.
  • removeMovieClip() called from onLoad() handler*3 of the same sub-MovieClip: handler's code run till its end under both Flash Player and Gnash.
  • removeMovieClip() called from event handler of the same sub-MovieClip:
    • called from onEnterFrame(): handler's code terminated immediately in Flash Player, but handler's code run till its end under Gnash.
    • called from onMouseDown(): handler's code terminated immediately in Flash Player, but handler's code run till its end under Gnash.
    • called from onKeyDown(): handler's code terminated immediately in Flash Player, but unable to test under Gnash*2.
    • called from function passed to setInterval(): function's code terminated immediately in Flash Player, but function's code run till its end under Gnash.


Test SWFs, source code, and build scripts are attached as `removemovie-events.zip`.

So, in the original Hostile Skies case, `removeMoveClip()` was called in sub-MovieClip's `onEnterFrame()` handler, which terminates it instantly under Adobe Flash. But under Gnash, the handler continued to run, so the it caught up in loop like @bwy mentioned in comment 1, and caused Gnash to freezes.

MakeSWF-based test cases might not suffice for this since it does not support sub-MovieClip. SWFTools' SWFC (or possibly, SWFCombine) is needed.

Note *1: I have yet to test on cases when other MovieClip calls `removeMovieClip()` on another MovieClip; so as when `removeMovieClip()` was issued from root MovieClip, or code inside #initclip of the same MovieClip (or root MovieClip).

Note *2: There seems to be another bug in Gnash that either caused keyDown event to fail propagating to sub-MovieClip, or caused `Selection.setFocus()` to fail bringing focus to sub-MovieClip.

Note *3: I have yet to figure out how to bind a method/class to a sub-MovieClip before attaching it to stage under SWFC or other free software tools (and not sure if it's possible), so I just have this case built under Macromedia Flash MX 2004.

Gnash: 0.8.11dev (git f6a0b38 2-Jun-2016)
Flash Player: 11.2.202.491 Standalone
System: Debian GNU/Linux 7.0 Wheezy i386


(file #37593)

Nutchanon Wetchasit <nachanon>
Mon 18 Jul 2011 11:08:17 PM UTC, comment #2: 

it should be tested if 'j' should be kept alive or the loop be interrupted. I'm pretty sure there's some test of us for "guarded" target, and we have code implementing target guarding to stop execution (when abortOnUnload is given). EventCode (in ExecutableCode.h) is passing abrtOnUnload=false, btw...

Sandro Santilli <strk>
Group Member
Sat 16 Jul 2011 08:24:55 AM UTC, comment #1: 

It's still a bug. The problem appears to be a loop in an onEnterFrame clip event:

j = 2;
while (j <= 3) {
   // ...
   // Under some condition:
   this.removeMovieClip();
   ++j;
}

The call to removeMovieClip() makes j undefined, so incrementing it becomes NaN, and the loop never terminates.

Benjamin Wolsey <bwy>
Group Member
Sat 16 Jul 2011 07:54:10 AM UTC, original submission:  

I've used Gnash 0.8.9 from getgnash.org APT repository on
Debian GNU/Linux 5.0 to play Hostile Skies game (Flash 9)

http://www.miniclip.com/games/hostile-skies/en/
(http://www.miniclip.com/games/hostile-skies/en/hostileskies.swf)

It played pretty fine in Gnash, albeit slowly, with uncontinuous airplane sound which looks more or less like bug #24481 (actionscript sound loop issue).
The game played fine, able to shoot enemies' plane, drop bombs on enemies' ship and submarine,
and able to proceed to all levels.

Except, when I tried to drop the bomb onto enemies' plane (not ship),
as soon as the bomb reached enemies' plane, gnash froze,
gnash's menu didn't respond, gnash window didn't repaint,
and console didn't print anything too.


System: Debian GNU/Linux 5.0 "Lenny" (i386: Intel Celeron 2GHz)
Gnash: gnash 0.8.9-1~lenny (from getgnash.org apt repository)

Nutchanon Wetchasit <nachanon>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #37623:  removemovie-events-fromroot.zip added by nachanon (9KiB - application/zip - Test SWFs on `MovieClip.removeMovieClip()` called from various event handlers (handlers originated in root movie), with source code and logs)
file #37593:  removemovie-events.zip added by nachanon (12KiB - application/zip - Test SWFs on `MovieClip.removeMovieClip()` called from various event handlers, with source code)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by nachanon (Voted in favor of this item)
  • -email is unavailable- added by strk (Posted a comment)
  • -email is unavailable- added by bwy (Posted a comment)
  • -email is unavailable- added by nachanon (Submitted the item)
  •  

    There are 15 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-06-29 nachanon Attached File- Added removemovie-events-fromroot.zip, #37623
    2016-06-27 nachanon Attached File- Added removemovie-events.zip, #37593
    2012-08-19 nachanon Carbon-Copy- Added nachanon
    2011-07-18 strk CategoryNone ActionScript
        StatusNone Confirmed

    Back to the top

    Powered by Savane 3.14-8eb0.
    Corresponding source code