bugGnash - The GNU Flash player - Bugs: bug #47906, Gnash's ActionScript XMLSocket...

 
 

bug #47906: Gnash's ActionScript XMLSocket test produces failing result

Submitter:  Nutchanon Wetchasit <nachanon>
Submitted:  Thu 12 May 2016 01:38:00 PM UTC
   
 
Category:  testsuite Severity:  3 - Normal
Release:  master Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Open
* Mandatory Fields

Add a New Comment Rich Markup
   

Sat 14 May 2016 02:35:03 PM UTC, comment #5: 

I have tested several programs regarding the behavior on connecting to dual-stack TCP server on localhost. (Dual-stack in this case means host name lookup returns both IPv4 and IPv6 address)


If the server listened with IPv4 (ordinary AF_INET) socket, an attempt to connect to server's IPv6 address will fail ("Connection refused") while IPv4 succeeds. But if the server listened with IPv6 (AF_INET6) socket, an attempt to connect to server's IPv4 or IPv6 address would succeed.

For current Gnash's behavior:

  • Gnash HTTP (via libcurl): connects IPv6 first. If fails, tries IPv4.
  • Gnash FTP (via libcurl): connects IPv6 first. If fails, tries IPv4.
  • Gnash RTMP (via libcurl): connects IPv6 first. If fails, tries IPv4.
  • Gnash XMLSocket: connects IPv6 only.


Wget: 1.13.4 (debian)
Iceweasel: 10.0.12 (debian)
Curl: 7.26.0 (debian)
Netcat: 1.10-40 (debian)
Gnash: 0.8.11dev (git c6da486 10-May-2016)
System: Debian GNU/Linux 7.0 Wheezy i386

Nutchanon Wetchasit <nachanon>
Thu 12 May 2016 04:21:21 PM UTC, comment #4: 

For the test failure itself, according to IP address part of test output:

[1183:1] 1011 DEBUG: localhost has address of: ::1
[1183:1] 1011 DEBUG: localhost has address of: 127.0.0.1


It seems that Gnash looked up "localhost" and found two IP address (IPv4 and IPv6, per my default `/etc/hosts`). The output didn't tell which one Gnash tried to connect. So I tried following command (as root):

ifconfig lo del ::1/128


to disable IPv6 and run the test again. This time the test ended quickly (~3 sec) and result is now passing:

$ ./XMLSocketTester
Running first process
Running second process
[2183:1] 1 DEBUG: /home/window/prog/gnash.git/testsuite/misc-ming.all/ appended to local sandboxes
[2183:1] 1 DEBUG: /home/window/prog/gnash.git/testsuite/misc-ming.all/XMLSocketTest.swf appended to local sandboxes
[2183:1] 1 SECURITY: Checking security of URL 'file:///home/window/prog/gnash.git/testsuite/misc-ming.all/XMLSocketTest.swf'
[2183:1] 1 SECURITY: Load of file /home/window/prog/gnash.git/testsuite/misc-ming.all/XMLSocketTest.swf granted (under local sandbox /home/window/prog/gnash.git/testsuite/misc-ming.all/)
[2183:1] 2 DEBUG: Movie file:///home/window/prog/gnash.git/testsuite/misc-ming.all/XMLSocketTest.swf (SWF6) added to library
[2183:1] 2 SECURITY: Extensions disabled
[2183:1] 2 DEBUG: Loading native class MovieClip
[2183:1] 3 DEBUG: void gnash::Gui::resize_view(int, int) enter
[2183:1] 3 DEBUG: void gnash::Gui::resize_view(int, int) returning
[2183:1] 1005 ACTIONSCRIPT ERROR: reference to non-existent variable 'rcsid'
[2183:1] 1005 TRACE: [ master-22369-c6da486]
[2183:1] 1006 ACTIONSCRIPT ERROR: reference to non-existent variable 'OUTPUT_VERSION'
[2183:1] 1006 DEBUG: Loading native class System
[2183:1] 1006 TRACE: SWF - LNX 10,1,999,0

[2183:1] 1011 TRACE: -- RUNNING TEST1 --
[2183:1] 1011 DEBUG: Loading native class XMLSocket
[2183:1] 1012 SECURITY: Load from host localhost granted (default)
[2183:1] 1012 DEBUG: localhost has address of: 127.0.0.1
[2183:1] 1012 DEBUG: localhost has address of: ::1
[2183:1] 1013 TRACE: PASSED: ret == true [./XMLSocketTest.as:84]
[2183:1] 1013 TRACE: PASSED: connectionStatus == true [./XMLSocketTest.as:52]
[2183:1] 1013 TRACE: Connected
[2183:1] 1918 ACTIONSCRIPT ERROR: Reference to undefined member [number:15] of object [object(array):0xb2d0d268]
[2183:1] 2104 ACTIONSCRIPT ERROR: Reference to undefined member [number:16] of object [object(array):0xb2d0d268]
[2183:1] 2104 ACTIONSCRIPT ERROR: Reference to undefined member [number:17] of object [object(array):0xb2d0d268]
[2183:1] 2119 ACTIONSCRIPT ERROR: Reference to undefined member [number:18] of object [object(array):0xb2d0d268]
[2183:1] 2119 ERROR: Socket send error Connection reset by peer
[2183:1] 2119 ACTIONSCRIPT ERROR: Reference to undefined member [number:19] of object [object(array):0xb2d0d268]
[2183:1] 2119 ACTIONSCRIPT ERROR: Reference to undefined member [number:20] of object [object(array):0xb2d0d268]
[2183:1] 2119 TRACE: Connection lost.
[2183:1] 2120 TRACE: PASSED: receivedArray[0] == expectedArray[0] [./XMLSocketTest.as:148]
[2183:1] 2120 TRACE: PASSED: receivedArray[1] == expectedArray[1] [./XMLSocketTest.as:149]
[2183:1] 2120 TRACE: PASSED: receivedArray[2] == expectedArray[2] [./XMLSocketTest.as:150]
[2183:1] 2120 TRACE: PASSED: receivedArray[3] == expectedArray[3] [./XMLSocketTest.as:151]
[2183:1] 2120 TRACE: PASSED: receivedArray[4] == expectedArray[4] [./XMLSocketTest.as:152]
[2183:1] 2120 TRACE: PASSED: receivedArray[5] == expectedArray[5] [./XMLSocketTest.as:153]
[2183:1] 2120 TRACE: PASSED: receivedArray[6] == expectedArray[6] [./XMLSocketTest.as:154]
[2183:1] 2120 TRACE: PASSED: receivedArray[7] == expectedArray[7] [./XMLSocketTest.as:155]
[2183:1] 2120 TRACE: PASSED: receivedArray[8] == expectedArray[8] [./XMLSocketTest.as:156]
[2183:1] 2120 TRACE: PASSED: receivedArray[9] == expectedArray[9] [./XMLSocketTest.as:157]
[2183:1] 2121 TRACE: PASSED: receivedArray[10] == expectedArray[10] [./XMLSocketTest.as:158]
[2183:1] 2121 TRACE: PASSED: receivedArray[11] == expectedArray[11] [./XMLSocketTest.as:159]
[2183:1] 2121 TRACE: PASSED: receivedArray[12] == expectedArray[12] [./XMLSocketTest.as:161]
[2183:1] 2121 TRACE: PASSED: receivedArray[13] == expectedArray[13] [./XMLSocketTest.as:162]
[2183:1] 2121 TRACE: PASSED: receivedArray[14] == expectedArray[14] [./XMLSocketTest.as:163]
[2183:1] 2122 TRACE: PASSED: receivedArray[15].length == 15000 [./XMLSocketTest.as:164]
[2183:1] 2122 TRACE: PASSED: receivedArray[15].charAt(0) == 'a' [./XMLSocketTest.as:165]
[2183:1] 2122 TRACE: PASSED: receivedArray[16] == expectedArray[16] [./XMLSocketTest.as:166]
[2183:1] 2122 TRACE: -- RUNNING TEST2 --
[2183:1] 2123 TRACE: About to instanciate an SC2 now
[2183:1] 2123 ACTIONSCRIPT ERROR: ActionCallMethod: Function requiring gnash::XMLSocket_as* as 'this' called from gnash::as_object* instance.
[2183:1] 2123 TRACE: XFAILED: expected: true obtained:  [./XMLSocketTest.as:123]
[2183:1] 2123 TRACE: ENDOFTEST
[2183:1] 2204 DEBUG: NullGui: exiting on quit
[2183:1] 2204 DEBUG: Main loop ended, cleaning up
[2183:1] 2205 DEBUG: ~Player - _movieDef refcount: 2 (1 will be dropped now)
[2183:1] 2205 DEBUG: ~Gui - _movieDef refcount: 1
PASSED: consistency check: last trace from run of test  (ENDOFTEST) matches pattern (ENDOFTEST)
$


This narrows Gnash's part of this issue to how it deals with a dual-stack TCP server.

Note: at the end of this test run, there was no lurking server process in the background.

Gnash: Gnash 0.8.11dev (git c6da486 10-May-2016)
System: Debian GNU/Linux 7.0 Wheezy i386

Nutchanon Wetchasit <nachanon>
Thu 12 May 2016 02:35:39 PM UTC, comment #3: 

The patch mentioned in previous post is file #37142, the file number was misquoted, sorry.

Nutchanon Wetchasit <nachanon>
Thu 12 May 2016 02:33:17 PM UTC, comment #2: 

After I patched XmlSocketServer to use normal `IO::Socket::INET` as a fallback (using the attached `0001_xmlsocketserver-perl-inet6-optional.patch` file #37140), the XMLSocketTester does not produce Perl error anymore, but the test is still failing:

$ ./XMLSocketTester
Running first process
Running second process
[1183:1] 1 DEBUG: /home/window/prog/gnash.git/testsuite/misc-ming.all/ appended to local sandboxes
[1183:1] 1 DEBUG: /home/window/prog/gnash.git/testsuite/misc-ming.all/XMLSocketTest.swf appended to local sandboxes
[1183:1] 1 SECURITY: Checking security of URL 'file:///home/window/prog/gnash.git/testsuite/misc-ming.all/XMLSocketTest.swf'
[1183:1] 1 SECURITY: Load of file /home/window/prog/gnash.git/testsuite/misc-ming.all/XMLSocketTest.swf granted (under local sandbox /home/window/prog/gnash.git/testsuite/misc-ming.all/)
[1183:1] 1 DEBUG: Movie file:///home/window/prog/gnash.git/testsuite/misc-ming.all/XMLSocketTest.swf (SWF6) added to library
[1183:1] 2 SECURITY: Extensions disabled
[1183:1] 2 DEBUG: Loading native class MovieClip
[1183:1] 2 DEBUG: void gnash::Gui::resize_view(int, int) enter
[1183:1] 2 DEBUG: void gnash::Gui::resize_view(int, int) returning
[1183:1] 1004 ACTIONSCRIPT ERROR: reference to non-existent variable 'rcsid'
[1183:1] 1004 TRACE: [ master-22369-c6da486]
[1183:1] 1004 ACTIONSCRIPT ERROR: reference to non-existent variable 'OUTPUT_VERSION'
[1183:1] 1004 DEBUG: Loading native class System
[1183:1] 1005 TRACE: SWF - LNX 10,1,999,0

[1183:1] 1010 TRACE: -- RUNNING TEST1 --
[1183:1] 1010 DEBUG: Loading native class XMLSocket
[1183:1] 1010 SECURITY: Load from host localhost granted (default)
[1183:1] 1011 DEBUG: localhost has address of: ::1
[1183:1] 1011 DEBUG: localhost has address of: 127.0.0.1
[1183:1] 1011 TRACE: PASSED: ret == true [./XMLSocketTest.as:84]
[1183:1] 1011 TRACE: FAILED: expected: true obtained: false [./XMLSocketTest.as:52]
[1183:1] 1011 TRACE: Initial connection failed!
[1183:1] 40062 DEBUG: NullGui: exiting on timeout
[1183:1] 40062 DEBUG: Main loop ended, cleaning up
[1183:1] 40063 DEBUG: ~Player - _movieDef refcount: 2 (1 will be dropped now)
[1183:1] 40063 DEBUG: ~Gui - _movieDef refcount: 1
FAILED: consistency check: last trace from run of test  (Initial connection failed!) doesn't match pattern (ENDOFTEST)
$ ps f
  PID TTY      STAT   TIME COMMAND
21731 pts/0    Ss     0:00 bash
 1229 pts/0    R+     0:00  \_ ps f
 1181 pts/0    S      0:00 /usr/bin/perl ../../testsuite/XmlSocketServer.pl
$


After the test ended, the server process (`testsuite/XmlSocketServer.pl`) is still lurking behind, and could be connected to using `nc localhost 2229` command (and also can be terminated by typing "closeNow" followed by Enter on netcat's console).

I think the test runner should force kill the server at the end of test (in case ActionScript side failed to request server to terminate). Otherwise it would interfere with the later test run.

Gnash: Gnash 0.8.11dev (git c6da486 10-May-2016)
System: Debian GNU/Linux 7.0 Wheezy i386

Nutchanon Wetchasit <nachanon>
Thu 12 May 2016 01:59:53 PM UTC, comment #1: 

I have tried running the XMLSocketTester test in isolation (in `testsuite/misc-ming.all` folder). The test ended with following output:

$ ./XMLSocketTester
Running first process
Running second process
Can't locate IO/Socket/INET6.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.14.2 /usr/local/share/perl/5.14.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.14 /usr/share/perl/5.14 /usr/local/lib/site_perl .) at ../../testsuite/XmlSocketServer.pl line 2.
BEGIN failed--compilation aborted at ../../testsuite/XmlSocketServer.pl line 2.
[934:1] 1 DEBUG: /home/window/prog/gnash.git/testsuite/misc-ming.all/ appended to local sandboxes
[934:1] 1 DEBUG: /home/window/prog/gnash.git/testsuite/misc-ming.all/XMLSocketTest.swf appended to local sandboxes
[934:1] 1 SECURITY: Checking security of URL 'file:///home/window/prog/gnash.git/testsuite/misc-ming.all/XMLSocketTest.swf'
[934:1] 1 SECURITY: Load of file /home/window/prog/gnash.git/testsuite/misc-ming.all/XMLSocketTest.swf granted (under local sandbox /home/window/prog/gnash.git/testsuite/misc-ming.all/)
[934:1] 1 DEBUG: Movie file:///home/window/prog/gnash.git/testsuite/misc-ming.all/XMLSocketTest.swf (SWF6) added to library
[934:1] 2 SECURITY: Extensions disabled
[934:1] 2 DEBUG: Loading native class MovieClip
[934:1] 2 DEBUG: void gnash::Gui::resize_view(int, int) enter
[934:1] 2 DEBUG: void gnash::Gui::resize_view(int, int) returning
[934:1] 1004 ACTIONSCRIPT ERROR: reference to non-existent variable 'rcsid'
[934:1] 1004 TRACE: [ master-22369-c6da486]
[934:1] 1004 ACTIONSCRIPT ERROR: reference to non-existent variable 'OUTPUT_VERSION'
[934:1] 1004 DEBUG: Loading native class System
[934:1] 1005 TRACE: SWF - LNX 10,1,999,0

[934:1] 1010 TRACE: -- RUNNING TEST1 --
[934:1] 1010 DEBUG: Loading native class XMLSocket
[934:1] 1010 SECURITY: Load from host localhost granted (default)
[934:1] 1011 DEBUG: localhost has address of: ::1
[934:1] 1011 DEBUG: localhost has address of: 127.0.0.1
[934:1] 1011 TRACE: PASSED: ret == true [./XMLSocketTest.as:84]
[934:1] 1011 TRACE: FAILED: expected: true obtained: false [./XMLSocketTest.as:52]
[934:1] 1011 TRACE: Initial connection failed!
[934:1] 40067 DEBUG: NullGui: exiting on timeout
[934:1] 40068 DEBUG: Main loop ended, cleaning up
[934:1] 40068 DEBUG: ~Player - _movieDef refcount: 2 (1 will be dropped now)
[934:1] 40068 DEBUG: ~Gui - _movieDef refcount: 1
FAILED: consistency check: last trace from run of test  (Initial connection failed!) doesn't match pattern (ENDOFTEST)
$


It turned out that XmlSocketServer script tries to import `IO::Socket::INET6` Perl module, which is not a core module; and not available unless user installed a separate `libio-socket-inet6-perl` package.

My system didn't have it installed, so the script just simply error out and terminated, leaving ActionScript side of the test trying to connect a nonexistent server, thus produced test failure.

In any case, XmlSocketServer script shouldn't fail from just a lack of optional IPv6 module while the standard IPv4 one (`IO::Socket::INET` core module) is still available. This could be fixed with few changes to the `use` statement.

Gnash: Gnash 0.8.11dev (git c6da486 10-May-2016)
System: Debian GNU/Linux 7.0 Wheezy i386

Nutchanon Wetchasit <nachanon>
Thu 12 May 2016 01:38:00 PM UTC, original submission:  

This is a follow-up to bug #45840 comment 8.

It bugs me for a while, that every time I run Gnash testsuite (`make check`) on my machine, the ActionScript XMLSocket test would always fail due to some unknown reason:

Test Result Totals:
        Total passes: 46954
        Total unresolved: 9
        Total expected failures: 1320
        Total untested: 470
        * Total real failures: 2

Unexpected failures follow:
 --=[ testsuite/misc-ming.all ]=--
FAIL: XMLSocketTester: expected: true obtained: false [./XMLSocketTest.as:52]
FAIL: XMLSocketTester: consistency check: last trace from run of test  (Initial connection failed!) doesn't match pattern (ENDOFTEST)

Time-related failures follow:
FAIL: XMLSocketTester: consistency check: last trace from run of test  (Initial connection failed!) doesn't match pattern (ENDOFTEST)

See http://wiki.gnashdev.org/PredictableLoading

Non time-related failures follow:
FAIL: XMLSocketTester: expected: true obtained: false [./XMLSocketTest.as:52]

make[4]: *** [anal] Error 1
make[4]: Leaving directory `/home/window/prog/gnash.git'
make[3]: *** [check-local] Error 2
make[3]: Leaving directory `/home/window/prog/gnash.git'
make[2]: *** [check-am] Error 2
make[2]: Leaving directory `/home/window/prog/gnash.git'
make[1]: *** [check-recursive] Error 1
make[1]: Leaving directory `/home/window/prog/gnash.git'
make: *** [check] Error 2


This problem might not be reproducible on every system.

Configuration, build, and test run log are attached as `xmlsockettest.c6da486.zip`.

Gnash: Gnash 0.8.11dev (git c6da486 10-May-2016)
System: Debian GNU/Linux 7.0 Wheezy i386

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 #37142:  0001_xmlsocketserver-perl-inet6-optional.patch added by nachanon (945B - text/x-diff - Patch for fixing XmlSocketServer's `IO::Socket::INET6` import)
file #37140:  xmlsockettest.c6da486.zip added by nachanon (1MiB - application/zip - Configuration, build and test log from Gnash 0.8.11dev git c6da486)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by nachanon (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 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-05-12 nachanon Attached File- Added 0001_xmlsocketserver-perl-inet6-optional.patch, #37142
    2016-05-12 nachanon Attached File- Added xmlsockettest.c6da486.zip, #37140

    Back to the top

    Powered by Savane 3.13-54b4.
    Corresponding source code