bugGnash - The GNU Flash player - Bugs: bug #40459, master-21901-77966b2 doesn’t...

 
 

bug #40459: master-21901-77966b2 doesn’t show downloaded bytes

Submitted by:  Pablo Rodríguez <ousia>
Submitted on:  Sun Nov 3 18:37:15 2013  
 
Category: ActionScriptSeverity: 3 - Normal
Release: masterStatus: Confirmed
Privacy: PublicAssigned to: None
Open/Closed: Open

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

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

 

(Jump to the original submission Jump to the original submission)

Mon Jan 4 04:49:31 2016, comment #17:

This issue is still consistenly reproducible on current git version of Gnash
when download simulator is in use.

I have made test SWF files (using libming's MakeSWF), one loader that tries
to download another Flash file from a custom download simulation server
which introduces brief pause on specific positions in the stream:

My loaded SWF in this case is 37288 bytes long. Server output lines begin
with `htcheckpoint:`, loader SWF's output lines begin with `testloader:`.

Following is a trace log from Flash Player (interleaved with server output):

Following is a trace log from Gnash (interleaved with server output):

You'd see that on Gnash...

  • `OnLoadStart()` was called when first frame is completed rather than when HTTP response was received.
  • `OnLoadProgress()` was only called only one time when first frame is completed, rather than every time a block of data is received. Reported number of bytes downloaded was also inaccurate (20 instead of 1621).
  • `OnLoadComplete()` was called even when the download was not yet completed. HTTP response code reported to the callback was also incorrect (0 instead of 200).

Test SWFs, source code, download simulator script, and full debug logs
are attached as `movieloader-progresscheck.zip`.

Gnash: 0.8.11dev (git 15d61a8 26-Dec-2015)
Flash Player: 11.2 r202 (11.2.202.491) Standalone
System: Debian GNU/Linux 7.0 Wheezy i386

P.S. The download simulation server runs on TCP port 8085 by default;
this it can be changed by adding `-p PORTNUMBER` option to server's
command line. URL in loader SWF must be adjusted accordingly if the port
is changed.

(file #35912)

Nutchanon Wetchasit <nachanon>
Tue Nov 19 20:34:07 2013, comment #16:

I know what happens with this issue.

Both onLoadStart and onLoadProgress are executed after the file has been completely loaded.

See the trace:

1890:2] 2686 UNIMPLEMENTED: Undocumented tag NAMECHARACTER encountered. Please report this to the Gnash developers!
1890:3] 6868 SECURITY: Checking security of URL 'http://www.archive.org/download/Lessig-Free_Culture/lessig-freeculture.swf'
1890:3] 6868 SECURITY: Load from host http://www.archive.org granted (default)
1890:4] 8563 UNIMPLEMENTED: Bounds table in DefineFont2Tag
1890:4] 10470 UNIMPLEMENTED: Different stream/playback sound rate (5512/11025). This seems common in SWF files, so we'll warn only once.
1890:4] 10470 UNIMPLEMENTED: Different stream/playback sample size (32/16). This seems common in SWF files, so we'll warn only once.
1890:1] 40460 TRACE: onLoadStart timer: 37764
1890:1] 40460 TRACE: onLoadStart reached
1890:1] 40461 TRACE: Real download time: 1
1890:1] 40461 TRACE: First download time: 0.001
1890:1] 40462 TRACE: _root.load_text: 100% (8899984 KB/s)
1890:1] 40462 TRACE: Last timer: 37766
1890:1] 40462 TRACE: KB loaded 8899.984375
1890:1] 40462 TRACE: KB total 8912.3408203125
1890:1] 40463 TRACE: onLoadProgress reached
1890:1] 40463 TRACE: onLoadComplete reached

onLoadStart is to be executed when access to the file has been granted.

onLoadProgress is to be executed after the first byte has been received.

I attach a newer version of the script that includes the traces that show the issues with onLoadStart and onLoadProgress.

Many thanks for your help,

Pablo

(file #29664)

Pablo Rodríguez <ousia>
Wed Nov 6 19:55:53 2013, comment #15:

Sandro,

I load a 6.7MB SWF hosted at http://archive.org with an average download speed of 300KB/s. It takes more than 30 seconds to be loaded. And the whole script works with the Adobe player.

You are the expert here and I don’t know how onLoadComplete is handled internally by Gnash. But it works as expected.

The script attached (still a manual testcase) uses onLoadStart, onLoadError, onLoadProgress and onLoadComplete.

I’m not sure whether onLoadStart works fine. And onLoadProgress doesn’t performs it contents.

onLoadError works fine (at least with the script attached).

And onLoadComplete works fine, since lines 106 to 110 in the attached script are only executed once the external SWF has been completely loaded.

I don’t know what I’m missing here. But if onLoadComplete is executed after the SWF header is read, wouldn’t it be possible that the SWF header can be read only after complete loading?

Many thanks for your help.

(file #29551)

Pablo Rodríguez <ousia>
Wed Nov 6 19:14:01 2013, comment #14:

I'm pretty sure onLoadComplete is invoked as soon as the SWF header is read. It may seem to be working fine only because it's very quick to read files. How did you try ?

It takes a large SWF and a slow network connection (for example).

This is where doing testcases is important.

Thanks for the pointers.

Sandro Santilli <strk>
Project Member
Tue Nov 5 21:14:46 2013, comment #13:

Sandro,

according to the Adobe documentation (http://help.adobe.com/en_US/AS2LCR/Flash_10.0/help.html?content=00001383.html) onLoadComplete is ”[i]nvoked when a file that was loaded with MovieClipLoader.loadClip() is completely downloaded.” This part seems to work fine in Gnash.

onLoadInit is “[i]nvoked when the actions on the first frame of the loaded clip have been executed” (http://help.adobe.com/en_US/AS2LCR/Flash_10.0/help.html?content=00001385.html),

onLoadStart is “[i]nvoked when a call to MovieClipLoader.loadClip() has begun to download a file” (http://help.adobe.com/en_US/AS2LCR/Flash_10.0/help.html?content=00001387.html).

onLoadError works also fine (at least with the script I provided).

And onLoadProgress is “[i]nvoked every time the loading content is written to the hard disk during the loading process (that is, between MovieClipLoader.onLoadStart and MovieClipLoader.onLoadComplete)” (http://help.adobe.com/en_US/AS2LCR/Flash_10.0/help.html?content=00001386.html).

I hope it helps,

Pablo

Pablo Rodríguez <ousia>
Tue Nov 5 18:37:02 2013, comment #12:

onLoadStart, onLoadProgress, onLoadComplete and onLoadInit all have to be clarified. We currently invoke them in that order as soon as the SWF header of the loaded resource is read.

Sandro Santilli <strk>
Project Member
Tue Nov 5 18:35:00 2013, comment #11:

Besides, if you read the FIXME lines in the C++ code you see that they also request to research about semantics of onLoadComplete argument.

In particular it's not clear to me if onLoadComplete should be called when the whole resource was loaded or only after the first bytes arrive.

Sandro Santilli <strk>
Project Member
Tue Nov 5 17:24:35 2013, comment #10:

You don't need to code in C++ as long as you can produce a self-contained testcase (one that printes PASSED/FAILED messages when run).

In orer to compile sound.sc you just type: make sound.swf, the Makefile rule will take care of everything else. The include directive will be processed before invoking swfc. The preprocessor will substitute the MEDIA(sound1.wav).

That said, sound.sc is really not the right place to do your work about MovieLoader, as it's unrelated to sound.

Actually it won't be easy to code a testcase for onLoadProgress because the callback is expected to be called every 65535 bytes parsed, so any test would need to request load of something that is at least 128k big, and we might now want to encode such swf in the testsuite as a payload. The biggest SWF file in misc-swfc.all testsuite is 40k. But there's a ~230k zoomhenge.swf file located in testsuite/movie.all that might be used as payload.

You could also do the test in actioncsript/MovieClipLoader.as, which may be easier as it's already focused on MovieClipLoader.
You'll need libming installed for that one.

Sandro Santilli <strk>
Project Member
Mon Nov 4 20:34:13 2013, comment #9:

Sandro,

sorry for having expressed myself wrong: I haven’t reported the sound issue yet. (I have to clear other issues before.)

I cannot code and C++ is Greek to me. I can read basic ActionScript (understanding is something different ;-)) and I can write very simple ActionScript. So, I see which FIXME you mean in libcore/MovieLoader.cpp, but not more than that.

I have tried to add checks to the script I provided yesterday, In order to understand how to do it, I wanted to compile testsuite/misc-swfc.all/sound.sc, but I found two issues:

First, on line 8 there is a C++ include directive. As far as I know this cannot be complied with swfc.

Second, as far as I know (I can check this back with the mailing list), line 11 should read
.sound audio "sound1.wav"
instead of
.sound audio MEDIA(sound1.wav)"

I guess I have to be missing something here.

With all these limits, how can I help best to the bug resolution?

Many thanks for your help,

Pablo

Pablo Rodríguez <ousia>
Sun Nov 3 22:17:25 2013, comment #8:

I just checked, onLoadProgress is indeed only called once at the end of load. The relevant code is in libcore/MovieLoader.cpp and already tagged as FIXME. Surely nothing to do with sound, so if you have to make a test in swfc it would be more appropriate to create a new one, or tweak the one in actionscript.all (you need Ming library to build that one)

Sandro Santilli <strk>
Project Member
Sun Nov 3 21:46:19 2013, comment #7:

Note that onLoadProgress should be implemented, somewhat tested in testsuite/actionscript.all/MovieClipLoader.as

Sandro Santilli <strk>
Project Member
Sun Nov 3 21:41:57 2013, comment #6:

Great, it surely helps to know what's missing.
You can take a look at testsuite/misc-swfc.all where other swfc-based testcases are located.

You'll see the use of "Dejagnu.sc" include and related check methods. You could add checks into existing tests, like in sound.sc (simpler) or craft a new one. Crafting a new one would require adding relevant entries in Makefile.am.

Sandro Santilli <strk>
Project Member
Sun Nov 3 21:21:02 2013, comment #5:

Sandro,

attached you have a test case.

listen_loading.onLoadProgress seems to be the part not working.

I hope it helps,

Pablo

(file #29533)

Pablo Rodríguez <ousia>
Sun Nov 3 19:27:21 2013, comment #4:

BTW, in the previous comment “how show I make” should read “how should I make”.

Pablo Rodríguez <ousia>
Sun Nov 3 19:25:00 2013, comment #3:

Sandro, I am the author of both SWF files.

How show I make the test case? Do I have to meet any standards specified somewhere?

Many thanks for your help.

Pablo Rodríguez <ousia>
Sun Nov 3 19:09:22 2013, comment #2:

Are you the author of the SWF ? Can you prepare a testcase for the gnash testsuite showing this case ?

Sandro Santilli <strk>
Project Member
Sun Nov 3 19:06:39 2013, comment #1:

FYI: the logged ERROR was downgraded to a DEBUG with http://git.savannah.gnu.org/cgit/gnash.git/commit/?id=1606ab48c70dcdda3ca95ff5212b836418b01c3d

Sandro Santilli <strk>
Project Member
Sun Nov 3 18:37:15 2013, original submission:

http://www.archive.org/download/Lessig-Free_Culture/lessig-freeculture-loader.swf is a small loader that allows the downloading of http://www.archive.org/download/Lessig-Free_Culture/lessig-freeculture.swf.

It downloads the file, but I’m afraid it doesn’t show the bytes downloaded and total size.

Here you have a minimal log:

$ gtk-gnash -v http://www.archive.org/download/Lessig-Free_Culture/lessig-freeculture-loader.swf
13454:1] 2160 SECURITY: Checking security of URL 'http://www.archive.org/download/Lessig-Free_Culture/lessig-freeculture-loader.swf'
13454:1] 2160 SECURITY: Load from host http://www.archive.org granted (default)
13454:1] 3880 SECURITY: Extensions disabled
13454:2] 3882 UNIMPLEMENTED: Bounds table in DefineFont2Tag
13454:2] 3882 UNIMPLEMENTED: Undocumented tag NAMECHARACTER encountered. Please report this to the Gnash developers!
13454:3] 6257 SECURITY: Checking security of URL 'http://www.archive.org/download/Lessig-Free_Culture/lessig-freeculture.swf'
13454:3] 6257 SECURITY: Load from host http://www.archive.org granted (default)
13454:4] 11330 UNIMPLEMENTED: Different stream/playback sound rate (5512/11025). This seems common in SWF files, so we'll warn only once.
13454:4] 11330 UNIMPLEMENTED: Different stream/playback sample size (32/16). This seems common in SWF files, so we'll warn only once.

And I don’t know whether this comes from the patch from https://savannah.gnu.org/bugs/?24638#comment8:

13454:5] 91855 ERROR: AudioDecoderFfmpeg: could not find a complete frame in the last 124 bytes of input (malformed SWF or FLV?)
13454:5] 108252 ERROR: AudioDecoderFfmpeg: could not find a complete frame in the last 39 bytes of input (malformed SWF or FLV?)
13454:5] 124702 ERROR: AudioDecoderFfmpeg: could not find a complete frame in the last 164 bytes of input (malformed SWF or FLV?)

Just in case it could be fixed.

Many thanks for your help,

Pablo

Pablo Rodríguez <ousia>

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #35912:  movieloader-progresscheck.zip added by nachanon (26kB - application/zip - Download tester SWF files, source code, and download simulator script)
file #29664:  freeculture-loader.sc added by ousia (5kB - application/vnd.ibm.secure-container - script version with traces)
file #29551:  freeculture-loader.sc added by ousia (4kB - application/vnd.ibm.secure-container - clearer version of the script)
file #29533:  freeculture-loader.sc added by ousia (4kB - application/vnd.ibm.secure-container - freeculture-loader from the Internet Archive)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by nachanon (Updated the item)
  • -unavailable- added by strk (Posted a comment)
  • -unavailable- added by ousia (Submitted the item)
  •  

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

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 6 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon Jan 4 04:49:31 2016nachanonAttached File-=>Added movieloader-progresscheck.zip, #35912
    Tue Nov 19 20:34:07 2013ousiaAttached File-=>Added freeculture-loader.sc, #29664
    Wed Nov 6 19:55:52 2013ousiaAttached File-=>Added freeculture-loader.sc, #29551
    Sun Nov 3 22:17:34 2013strkStatusNone=>Confirmed
    Sun Nov 3 21:46:19 2013strkCategoryNone=>ActionScript
    Sun Nov 3 21:21:02 2013ousiaAttached File-=>Added freeculture-loader.sc, #29533

    Back to the top


    Powered by Savane 3.1-cleanup