bugGnash - The GNU Flash player - Bugs: bug #27981, fscommand:quit ineffective if in...

 
 

bug #27981: fscommand:quit ineffective if in first frame

Submitted by:  Sandro Santilli <strk>
Submitted on:  Mon 09 Nov 2009 05:35:22 PM UTC  
 
Category:  gui Severity:  3 - Normal
Release:  None Status:  Fixed
Privacy:  Public Assigned to:  Sandro Santilli <strk>
Open/Closed:  Closed

Add a New Comment (Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

( Jump to the original submission)

Sat 16 Jan 2016 11:10:55 AM UTC, comment #9:

This if fixed by patch #8858, thanks !
(tested with GUI gtk,qt4,sdl,dump)

Sandro Santilli <strk>
Project MemberIn charge of this item.
Fri 15 Jan 2016 10:17:22 AM UTC, comment #8:

I think moving window cleanup code from `Gtk::quitUI()` to `GtkGui::run()`
just after `gtk_main()` should help, as it ensure that the cleanup code
only run at the end, after all the drawing operations were already dealt with.

Patch included, see patch #8858 comment 1.

Gnash: 0.8.11dev (patched against git e8b111c 13-Jan-2016)
System: Debian GNU/Linux 7.0 Wheezy i386

Nutchanon Wetchasit <nachanon>
Fri 15 Jan 2016 09:48:52 AM UTC, comment #7:

Regarding window-related assertion warnings, I have tested around and found
that they were caused by two part of screen refreshing code which took place
after frame's initial ActionScript interpretation in frame-advancing.

Warnings appeared as screen refreshing code is run without knowing that
the window was already destroyed by `GtkGui::quitUI()`.

For the reason that `secondframeexit.swf` produced no assertion warnings even
`GtkGui::quitUI()` ran before window refreshing, is that there was no graphics
change between first and second frame, thus refreshing was skipped.

I have created a variant of `secondframeexit.swf` which has graphics drawn
on second frame. When run with Gnash, you'd see that the window assertion
warnings are now appeared:

`gnash -vv secondframeexit-repaint.swf`:

83 DEBUG: gnash::GtkAggGlue::GtkAggGlue() enter
83 DEBUG: gnash::GtkAggGlue::GtkAggGlue() returning
83 DEBUG: virtual bool gnash::GtkAggGlue::init(int, char***) enter
83 DEBUG: virtual bool gnash::GtkAggGlue::init(int, char***) returning
107 DEBUG: gnash_canvas_size_allocate 257 1
107 DEBUG: virtual void gnash::GtkAggGlue::prepDrawingArea(GtkWidget*) enter
107 DEBUG: virtual void gnash::GtkAggGlue::prepDrawingArea(GtkWidget*) returning
107 DEBUG: virtual gnash::Renderer* gnash::GtkAggGlue::createRenderHandler() enter
108 DEBUG: Framebuffer pixel format is BGRA32 (little-endian host)
108 DEBUG: virtual gnash::Renderer* gnash::GtkAggGlue::createRenderHandler() returning
108 DEBUG: virtual void gnash::GtkAggGlue::setRenderHandlerSize(int, int) enter
108 DEBUG: virtual void gnash::GtkAggGlue::setRenderHandlerSize(int, int) returning
109 DEBUG: /home/window/Desktop/secondframeexit-repaint/ appended to local sandboxes
109 DEBUG: /home/window/Desktop/secondframeexit-repaint/secondframeexit-repaint.swf appended to local sandboxes
109 SECURITY: Checking security of URL 'file:///home/window/Desktop/secondframeexit-repaint/secondframeexit-repaint.swf'
109 SECURITY: Load of file /home/window/Desktop/secondframeexit-repaint/secondframeexit-repaint.swf granted (under local sandbox /home/window/Desktop/secondframeexit-repaint/)
109 DEBUG: Movie file:///home/window/Desktop/secondframeexit-repaint/secondframeexit-repaint.swf (SWF7) added to library
135 SECURITY: Extensions disabled
136 DEBUG: Advance interval timer set to 10 ms (~ 100 FPS)
136 DEBUG: Loading native class MovieClip
136 TRACE: This is first frame.
136 DEBUG: void gnash::Gui::resize_view(int, int) enter
136 DEBUG: void gnash::Gui::resize_view(int, int) returning
143 DEBUG: gnash_canvas_size_allocate 320 240
143 DEBUG: virtual void gnash::GtkAggGlue::setRenderHandlerSize(int, int) enter
159 DEBUG: virtual void gnash::GtkAggGlue::setRenderHandlerSize(int, int) returning
159 DEBUG: virtual void gnash::GtkAggGlue::setRenderHandlerSize(int, int) enter
159 DEBUG: virtual void gnash::GtkAggGlue::setRenderHandlerSize(int, int) returning
159 DEBUG: void gnash::Gui::resize_view(int, int) enter
161 DEBUG: void gnash::Gui::resize_view(int, int) returning
222 TRACE: This is second frame start.
223 TRACE: This is second frame end.

(gtk-gnash:10008): Gdk-CRITICAL **: gdk_window_invalidate_rect_full: assertion `GDK_IS_WINDOW (window)' failed

(gtk-gnash:10008): Gdk-CRITICAL **: IA__gdk_window_process_updates: assertion `GDK_IS_WINDOW (window)' failed
225 DEBUG: Main loop ended, cleaning up
225 DEBUG: ~Player - _movieDef refcount: 2 (1 will be dropped now)
225 DEBUG: ~Gui - _movieDef refcount: 1

Test files and source code are attached as `secondframeexit-repaint.zip`.

Gnash: 0.8.11dev (git e8b111c 13-Jan-2016)
System: Debian GNU/Linux 7.0 Wheezy i386

Note: `secondframeexit-repaint.swf` is hand-crafted using SWFML Simple,
as SWFTools's SWFC did not recognize the built-in `getURL()` function,
and Gnash did not recognize "fscommand:" scheme in `MovieClip.getURL()`.

(file #36046)

Nutchanon Wetchasit <nachanon>
Thu 14 Jan 2016 04:01:13 PM UTC, comment #6:

Patch included, see patch #8858.

This patch make sure that `GtkGui::quitUI()` calls `gtk_main_quit()` only
when `gtk_main()` is running. It also adds an `_exiting` flag inside `GtkGui`,
which once set via `GtkGui::quitUI()`, will instruct `GtkGui::run()`
to avoid entering `gtk_main()` when it was not already entered;
eliminating the freeze, though it does not fix other window-related assertion warnings.

Gnash: 0.8.11dev (patched against git e8b111c 13-Jan-2016)
System: Debian GNU/Linux 7.0 Wheezy i386

Nutchanon Wetchasit <nachanon>
Thu 14 Jan 2016 03:40:51 PM UTC, comment #5:

Compare an contrast, using Gnash with the same diagnostic patch, but running
SWF that issues `fscommand("quit")` in second frame:

`gtk-gnash -vv secondframeexit.swf`:

66 DEBUG: gnash::GtkAggGlue::GtkAggGlue() enter
66 DEBUG: gnash::GtkAggGlue::GtkAggGlue() returning
66 DEBUG: virtual bool gnash::GtkAggGlue::init(int, char***) enter
66 DEBUG: virtual bool gnash::GtkAggGlue::init(int, char***) returning
91 DEBUG: gnash_canvas_size_allocate 261 1
91 DEBUG: virtual void gnash::GtkAggGlue::prepDrawingArea(GtkWidget*) enter
91 DEBUG: virtual void gnash::GtkAggGlue::prepDrawingArea(GtkWidget*) returning
91 DEBUG: virtual gnash::Renderer* gnash::GtkAggGlue::createRenderHandler() enter
92 DEBUG: Framebuffer pixel format is BGRA32 (little-endian host)
92 DEBUG: virtual gnash::Renderer* gnash::GtkAggGlue::createRenderHandler() returning
92 DEBUG: virtual void gnash::GtkAggGlue::setRenderHandlerSize(int, int) enter
92 DEBUG: virtual void gnash::GtkAggGlue::setRenderHandlerSize(int, int) returning
92 DEBUG: /home/window/Desktop/secondframeexit/ appended to local sandboxes
92 DEBUG: /home/window/Desktop/secondframeexit/secondframeexit.swf appended to local sandboxes
93 SECURITY: Checking security of URL 'file:///home/window/Desktop/secondframeexit/secondframeexit.swf'
93 SECURITY: Load of file /home/window/Desktop/secondframeexit/secondframeexit.swf granted (under local sandbox /home/window/Desktop/secondframeexit/)
93 DEBUG: Movie file:///home/window/Desktop/secondframeexit/secondframeexit.swf (SWF7) added to library
107 SECURITY: Extensions disabled
107 DEBUG: Advance interval timer set to 10 ms (~ 100 FPS)
107 DEBUG: Loading native class MovieClip
108 TRACE: This is first frame.
108 DEBUG: void gnash::Gui::resize_view(int, int) enter
108 DEBUG: void gnash::Gui::resize_view(int, int) returning
109 DEBUG: GtkGui: starting GTK main loop
113 DEBUG: gnash_canvas_size_allocate 320 240
113 DEBUG: virtual void gnash::GtkAggGlue::setRenderHandlerSize(int, int) enter
113 DEBUG: virtual void gnash::GtkAggGlue::setRenderHandlerSize(int, int) returning
113 DEBUG: virtual void gnash::GtkAggGlue::setRenderHandlerSize(int, int) enter
113 DEBUG: virtual void gnash::GtkAggGlue::setRenderHandlerSize(int, int) returning
113 DEBUG: void gnash::Gui::resize_view(int, int) enter
114 DEBUG: void gnash::Gui::resize_view(int, int) returning
199 TRACE: This is second frame start.
200 DEBUG: GtkGui: terminating GTK main loop level 1
200 TRACE: This is second frame end.
200 DEBUG: GtkGui: GTK main loop ended
200 DEBUG: Main loop ended, cleaning up
201 DEBUG: ~Player - _movieDef refcount: 2 (1 will be dropped now)
201 DEBUG: ~Gui - _movieDef refcount: 1

You'd see that in this case, `gtk_main_quit()` is run while `gtk_main()`
was running, thus no problem on terminating the main loop.

Gnash: 0.8.11dev (patched against git e8b111c 13-Jan-2016)
System: Debian GNU/Linux 7.0 Wheezy i386

Nutchanon Wetchasit <nachanon>
Thu 14 Jan 2016 12:52:58 PM UTC, comment #4:

First assertion error message seems to be caused by calling `gtk_main_quit()`
before the GUI code enters `gtk_main()`. I have created a dummy patch
which prints DEBUG message when `gtk-gnash` enter/terminate/exit main GTK loop,
see the attached `show-gtk-main-loop-level.patch`.

After applied the patch, I tested using `gtk-gnash -vv singleframeexit.swf`:

81 DEBUG: gnash::GtkAggGlue::GtkAggGlue() enter
81 DEBUG: gnash::GtkAggGlue::GtkAggGlue() returning
81 DEBUG: virtual bool gnash::GtkAggGlue::init(int, char***) enter
81 DEBUG: virtual bool gnash::GtkAggGlue::init(int, char***) returning
112 DEBUG: gnash_canvas_size_allocate 257 1
112 DEBUG: virtual void gnash::GtkAggGlue::prepDrawingArea(GtkWidget*) enter
112 DEBUG: virtual void gnash::GtkAggGlue::prepDrawingArea(GtkWidget*) returning
112 DEBUG: virtual gnash::Renderer* gnash::GtkAggGlue::createRenderHandler() enter
113 DEBUG: Framebuffer pixel format is BGRA32 (little-endian host)
113 DEBUG: virtual gnash::Renderer* gnash::GtkAggGlue::createRenderHandler() returning
113 DEBUG: virtual void gnash::GtkAggGlue::setRenderHandlerSize(int, int) enter
113 DEBUG: virtual void gnash::GtkAggGlue::setRenderHandlerSize(int, int) returning
113 DEBUG: /home/window/Desktop/firstframeexit/ appended to local sandboxes
113 DEBUG: /home/window/Desktop/firstframeexit/singleframeexit.swf appended to local sandboxes
114 SECURITY: Checking security of URL 'file:///home/window/Desktop/firstframeexit/singleframeexit.swf'
114 SECURITY: Load of file /home/window/Desktop/firstframeexit/singleframeexit.swf granted (under local sandbox /home/window/Desktop/firstframeexit/)
114 DEBUG: Movie file:///home/window/Desktop/firstframeexit/singleframeexit.swf (SWF7) added to library
139 SECURITY: Extensions disabled
139 DEBUG: Advance interval timer set to 10 ms (~ 100 FPS)
139 DEBUG: Loading native class MovieClip
140 TRACE: This is first frame start.
142 DEBUG: GtkGui: terminating GTK main loop level 0

(gtk-gnash:20173): Gtk-CRITICAL **: IA__gtk_main_quit: assertion `main_loops != NULL' failed
142 TRACE: This is first frame end.
142 DEBUG: void gnash::Gui::resize_view(int, int) enter
142 DEBUG: void gnash::Gui::resize_view(int, int) returning

(gtk-gnash:20173): Gdk-CRITICAL **: gdk_window_invalidate_rect_full: assertion `GDK_IS_WINDOW (window)' failed

(gtk-gnash:20173): Gdk-CRITICAL **: IA__gdk_window_process_updates: assertion `GDK_IS_WINDOW (window)' failed
151 DEBUG: GtkGui: starting GTK main loop

From debug output, you'd see that Gnash tried to terminate main GTK loop before
the main loop is run, so it failed. When the GTK main loop is run afterward,
there were nothing else to stop it, so Gnash simply froze instead of exiting.

Gnash: 0.8.11dev (patched against git e8b111c 13-Jan-2016)
System: Debian GNU/Linux 7.0 Wheezy i386

(file #36027)

Nutchanon Wetchasit <nachanon>
Wed 13 Jan 2016 04:51:24 PM UTC, comment #3:

I have made a variant of test files (using makeswf and MTASC) which do
`fscommand("quit")` in second frame rather than first frame, as a comparison.

See the attached `secondframeexit.zip`.

(file #36015)

Nutchanon Wetchasit <nachanon>
Sun 13 Dec 2015 12:19:20 PM UTC, comment #2:

This is still reproducible under current Gnash git version.
(`set ignoreFSCommand` statement in `~/.gnashrc` must be set to `false`)

I have created few variants of dummy Flash files (Flash 7) that tries to run
`fscommand("quit")` on the first frame, using libming's makeswf and MTASC:

  • Single-frame SWF with `fscommand("quit")` code on its timeline.
  • Two-frame SWF with `fscommand("quit")` code on its first frame of timeline.
  • Twenty-four frame SWF with `fscommand("quit")` code on its first frame of timeline.
  • Single-frame SWF with `fscommand("quit")` code in MTASC's `main()`.

and played them under multiple variants of Gnash (and also Flash Player):

  • `gtk-gnash`
    • Single frame case: assertion errors appeared, ActionScript executed to the end of frame, then freezes.
    • Two frame case: assertion errors appeared, ActionScript executed to the end of first frame, then freezes.
    • Twenty-four frame case: assertion errors appeared, ActionScript executed to the end of first frame, then freezes.
    • MTASC case: assertion errors appeared, ActionScript executed to the end of `main()`, then freezes.
  • `qt4-gnash`
    • Single frame case: ActionScript executed to the end of frame, and terminated.
    • Two frame case: ActionScript executed to the end of first frame, and terminated.
    • Twenty-four frame case: ActionScript executed to the end of first frame, and terminated.
    • MTASC case: ActionScript executed to the end of `main()`, and terminated.
  • `sdl-gnash`
    • Single frame case: ActionScript terminated at `fscommand()` call.
    • Two frame case: ActionScript terminated at `fscommand()` call.
    • Twenty-four frame case: ActionScript terminated at `fscommand()` call.
    • MTASC case: ActionScript terminated at `fscommand()` call.
  • `fb-gnash`
    • Single frame case: ActionScript terminated at `fscommand()` call.
    • Two frame case: ActionScript terminated at `fscommand()` call.
    • Twenty-four frame case: ActionScript terminated at `fscommand()` call.
    • MTASC case: ActionScript terminated at `fscommand()` call.
  • `dump-gnash`
    • Single frame case: ActionScript executed to the end of first frame, and terminated
    • Two frame case: ActionScript executed to the end of first frame, and terminated.
    • Twenty-four frame case: ActionScript executed to the end of first frame, and terminated.
    • MTASC case: ActionScript executed to the end of `main()`, and terminated.
  • Flash Player:
    • Single frame case: ActionScript executed to the end of frame, and terminated.
    • Two frame case: ActionScript executed to the end of second frame, and terminated.
    • Twenty-four frame case: ActionScript executed to the end of second frame, and terminated.
    • MTASC case: ActionScript executed to the end of `main()`, and terminated.

From the result and GDB backtrace, this issue seems to be specific to
`gtk-gnash` and is very similar to bug #46308 (`gtk-gnash -1` freezes on
single-frame SWF) even the exit is triggered by a different reason.

Debug log (verbosity 2, with action error log) of all SWF-Gnash variant
combination, trace log from Flash player, GDB backtrace from `gtk-gnash`
(collected from SIGQUIT core dump) are attached as `firstframexit.zip`
together with SWFs and their source files.

Gnash: 0.8.11dev (git 95763ce 8-Dec-2015)
System: Debian GNU/Linux 7.0 Wheezy i386

Flash Player: 10.1.82.76 Standalone
System: Microsoft Windows XP Professional SP3

Note #1: `fltk-gnash` is not tested as Gnash's configure script doesn't
correctly detect FLTK 1.1/1.3 header in my configuration.

Note #2: Adobe Flash Player doesn't seem to be strict on exit timing,
as it let another frame played after `fscommand()` call before terminating.

(file #35727)

Nutchanon Wetchasit <nachanon>
Mon 09 Nov 2009 07:00:32 PM UTC, comment #1:

I found a case which also gets gtk to confirm that
assumption:

(lt-gtk-gnash:18504): Gtk-CRITICAL **: gtk_main_quit: assertion `main_loops != NULL' failed

this is using swfdec's test invalid-utf8-4.swf

Sandro Santilli <strk>
Project MemberIn charge of this item.
Mon 09 Nov 2009 05:35:22 PM UTC, original submission:

Looks like an fscommand:quit in first frame has no effect
until a restart happens.

It is fine in second frame on.

I guess it has to do with fscommand handler not being
available at time of executino of first frame actions ?

Sandro Santilli <strk>
Project MemberIn charge of this item.

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #36046:  secondframeexit-repaint.zip added by nachanon (5KiB - application/zip - Test Flash files (second-frame exit with screen redraw) and source code)
file #36027:  show-gtk-main-loop-level.patch added by nachanon (879B - text/x-patch - Patch to show diagnostic information on gtk-gnash's GTK main loop)
file #36015:  secondframeexit.zip added by nachanon (6KiB - application/zip - Test Flash files (second-frame exit) and source code)
file #35727:  firstframeexit.zip added by nachanon (58KiB - application/zip - Test Flash files, source code, and logs)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by nachanon (Updated the item)
  • -email is unavailable- added by strk (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

     

     

    Follow 7 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-01-16 strk StatusNone => Fixed
        Assigned toNone => strk
        Open/ClosedOpen => Closed
    2016-01-15 nachanon Attached File- => Added secondframeexit-repaint.zip, #36046
    2016-01-14 nachanon Attached File- => Added show-gtk-main-loop-level.patch, #36027
    2016-01-13 nachanon Attached File- => Added secondframeexit.zip, #36015
    2015-12-13 nachanon Attached File- => Added firstframeexit.zip, #35727

    Back to the top


    Powered by Savane 3.4