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

 
 

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

Submitter:  Pablo Rodríguez <ousia>
Submitted:  Sun 03 Nov 2013 06:37:15 PM UTC
   
 
Category:  ActionScript Severity:  3 - Normal
Release:  master Status:  Confirmed
Privacy:  Public Assigned to:  None
Open/Closed:  Open
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Mon 04 Jan 2016 04:49:31 AM UTC, 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):

testloader: starting download
htcheckpoint: request received, pausing 2000 ms
htcheckpoint: sent 0 byte(s), pausing 2000 ms
testloader: download started
htcheckpoint: sent 1 byte(s), pausing 2000 ms
Warning: Not a known player download type, http://localhost:8085/testpattern.swf
testloader: downloading: 0/0
htcheckpoint: sent 1621 byte(s), pausing 2000 ms
testloader: downloading: 1621/37288
htcheckpoint: sent 9322 byte(s), pausing 2000 ms
testloader: downloading: 5717/37288
testloader: downloading: 9322/37288
htcheckpoint: sent 18644 byte(s), pausing 2000 ms
testloader: downloading: 17514/37288
testloader: downloading: 18644/37288
htcheckpoint: sent 27966 byte(s), pausing 2000 ms
testloader: downloading: 26836/37288
testloader: downloading: 27966/37288
htcheckpoint: sent 37287 byte(s), pausing 2000 ms
testloader: downloading: 32062/37288
testloader: downloading: 36158/37288
testloader: downloading: 37287/37288
htcheckpoint: sent 37288 byte(s), pausing 2000 ms
testloader: downloading: 37288/37288
testloader: download completed: status 200
testloader: started action


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

126 TRACE: testloader: starting download
htcheckpoint: request received, pausing 2000 ms
htcheckpoint: sent 0 byte(s), pausing 2000 ms
htcheckpoint: sent 1 byte(s), pausing 2000 ms
htcheckpoint: sent 1621 byte(s), pausing 2000 ms
6146 TRACE: testloader: download started
6147 TRACE: testloader: downloading: 20/37288
6147 TRACE: testloader: download completed: status 0
6147 TRACE: testloader: started action
htcheckpoint: sent 9322 byte(s), pausing 2000 ms
htcheckpoint: sent 18644 byte(s), pausing 2000 ms
htcheckpoint: sent 27966 byte(s), pausing 2000 ms
htcheckpoint: sent 37287 byte(s), pausing 2000 ms
htcheckpoint: sent 37288 byte(s), pausing 2000 ms


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 19 Nov 2013 08:34:07 PM UTC, 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 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 06 Nov 2013 07:55:53 PM UTC, 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 06 Nov 2013 07:14:01 PM UTC, 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>
Group Member
Tue 05 Nov 2013 09:14:46 PM UTC, 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 05 Nov 2013 06:37:02 PM UTC, 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>
Group Member
Tue 05 Nov 2013 06:35:00 PM UTC, 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>
Group Member
Tue 05 Nov 2013 05:24:35 PM UTC, 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>
Group Member
Mon 04 Nov 2013 08:34:13 PM UTC, 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 03 Nov 2013 10:17:25 PM UTC, 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>
Group Member
Sun 03 Nov 2013 09:46:19 PM UTC, comment #7: 

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

Sandro Santilli <strk>
Group Member
Sun 03 Nov 2013 09:41:57 PM UTC, 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>
Group Member
Sun 03 Nov 2013 09:21:02 PM UTC, 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 03 Nov 2013 07:27:21 PM UTC, comment #4: 

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

Pablo Rodríguez <ousia>
Sun 03 Nov 2013 07:25:00 PM UTC, 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 03 Nov 2013 07:09:22 PM UTC, comment #2: 

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

Sandro Santilli <strk>
Group Member
Sun 03 Nov 2013 07:06:39 PM UTC, comment #1: 
Sandro Santilli <strk>
Group Member
Sun 03 Nov 2013 06:37:15 PM UTC, 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 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 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 Files:
   
   
Comment:
   

Attached Files
file #35912:  movieloader-progresscheck.zip added by nachanon (26KiB - application/zip - Download tester SWF files, source code, and download simulator script)
file #29664:  freeculture-loader.sc added by ousia (5KiB - application/vnd.ibm.secure-container - script version with traces)
file #29551:  freeculture-loader.sc added by ousia (4KiB - application/vnd.ibm.secure-container - clearer version of the script)
file #29533:  freeculture-loader.sc added by ousia (4KiB - 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
  • -email is unavailable- added by nachanon (Updated the item)
  • -email is unavailable- added by strk (Posted a comment)
  • -email is unavailable- added by ousia (Submitted the item)
  •  

    There are 0 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 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-01-04 nachanon Attached File- Added movieloader-progresscheck.zip, #35912
    2013-11-19 ousia Attached File- Added freeculture-loader.sc, #29664
    2013-11-06 ousia Attached File- Added freeculture-loader.sc, #29551
    2013-11-03 strk StatusNone Confirmed
    2013-11-03 strk CategoryNone ActionScript
    2013-11-03 ousia Attached File- Added freeculture-loader.sc, #29533

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code