microsoft / WSL

Issues found on WSL
https://docs.microsoft.com/windows/wsl
MIT License
17.26k stars 812 forks source link

Failed tests in Perl module IO::Socket::SSL #2763

Closed jadeallenx closed 7 months ago

jadeallenx commented 6 years ago

t/nonblack.t test fails at test 11

strace prove -lv t/nonblock.t output

genio commented 6 years ago

I'm running into the same issues. Here's some information:

$ perl -V
Summary of my perl5 (revision 5 version 28 subversion 0) configuration:

  Platform:
    osname=linux
    osvers=4.4.0-17134-microsoft
    archname=x86_64-linux
    uname='linux laptop-5322 4.4.0-17134-microsoft #137-microsoft thu jun 14 18:46:00 pst 2018 x86_64 x86_64 x86_64 gnulinux '
    config_args='-de -Dprefix=/home/cwhitener/perl5/perlbrew/perls/perl-5.28.0 -Aeval:scriptdir=/home/cwhitener/perl5/perlbrew/perls/perl-5.28.0/bin'
    hint=recommended
    useposix=true
    d_sigaction=define
    useithreads=undef
    usemultiplicity=undef
    use64bitint=define
    use64bitall=define
    uselongdouble=undef
    usemymalloc=n
    default_inc_excludes_dot=define
    bincompat5005=undef
  Compiler:
    cc='cc'
    ccflags ='-fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64'
    optimize='-O2'
    cppflags='-fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include'
    ccversion=''
    gccversion='7.3.0'
    gccosandvers=''
    intsize=4
    longsize=8
    ptrsize=8
    doublesize=8
    byteorder=12345678
    doublekind=3
    d_longlong=define
    longlongsize=8
    d_longdbl=define
    longdblsize=16
    longdblkind=3
    ivtype='long'
    ivsize=8
    nvtype='double'
    nvsize=8
    Off_t='off_t'
    lseeksize=8
    alignbytes=8
    prototype=define
  Linker and Libraries:
    ld='cc'
    ldflags =' -fstack-protector-strong -L/usr/local/lib'
    libpth=/usr/local/lib /usr/lib/gcc/x86_64-linux-gnu/7/include-fixed /usr/include/x86_64-linux-gnu /usr/lib /lib/x86_64-linux-gnu /lib/../lib /usr/lib/x86_64-linux-gnu /usr/lib/../lib /lib
    libs=-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc
    perllibs=-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc
    libc=libc-2.27.so
    so=so
    useshrplib=false
    libperl=libperl.a
    gnulibc_version='2.27'
  Dynamic Linking:
    dlsrc=dl_dlopen.xs
    dlext=so
    d_dlsymun=undef
    ccdlflags='-Wl,-E'
    cccdlflags='-fPIC'
    lddlflags='-shared -O2 -L/usr/local/lib -fstack-protector-strong'

Characteristics of this binary (from libperl):
  Compile-time options:
    HAS_TIMES
    PERLIO_LAYERS
    PERL_COPY_ON_WRITE
    PERL_DONT_CREATE_GVSV
    PERL_MALLOC_WRAP
    PERL_OP_PARENT
    PERL_PRESERVE_IVUV
    USE_64_BIT_ALL
    USE_64_BIT_INT
    USE_LARGE_FILES
    USE_LOCALE
    USE_LOCALE_COLLATE
    USE_LOCALE_CTYPE
    USE_LOCALE_NUMERIC
    USE_LOCALE_TIME
    USE_PERLIO
    USE_PERL_ATOF
  Locally applied patches:
    Devel::PatchPerl 1.52
  Built under linux
  Compiled at Jul 25 2018 13:09:03
  %ENV:
    PERL5LIB="/home/cwhitener/.perlbrew/libs/perl-5.28.0@normal/lib/perl5"
    PERLBREW_HOME="/home/cwhitener/.perlbrew"
    PERLBREW_LIB="normal"
    PERLBREW_MANPATH="/home/cwhitener/.perlbrew/libs/perl-5.28.0@normal/man:/home/cwhitener/perl5/perlbrew/perls/perl-5.28.0/man"
    PERLBREW_PATH="/home/cwhitener/.perlbrew/libs/perl-5.28.0@normal/bin:/home/cwhitener/perl5/perlbrew/bin:/home/cwhitener/perl5/perlbrew/perls/perl-5.28.0/bin"
    PERLBREW_PERL="perl-5.28.0"
    PERLBREW_ROOT="/home/cwhitener/perl5/perlbrew"
    PERLBREW_SHELLRC_VERSION="0.84"
    PERLBREW_VERSION="0.84"
    PERL_LOCAL_LIB_ROOT="/home/cwhitener/.perlbrew/libs/perl-5.28.0@normal"
    PERL_MB_OPT="--install_base /home/cwhitener/.perlbrew/libs/perl-5.28.0@normal"
    PERL_MM_OPT="INSTALL_BASE=/home/cwhitener/.perlbrew/libs/perl-5.28.0@normal"
  @INC:
    /home/cwhitener/.perlbrew/libs/perl-5.28.0@normal/lib/perl5/x86_64-linux
    /home/cwhitener/.perlbrew/libs/perl-5.28.0@normal/lib/perl5
    /home/cwhitener/perl5/perlbrew/perls/perl-5.28.0/lib/site_perl/5.28.0/x86_64-linux
    /home/cwhitener/perl5/perlbrew/perls/perl-5.28.0/lib/site_perl/5.28.0
    /home/cwhitener/perl5/perlbrew/perls/perl-5.28.0/lib/5.28.0/x86_64-linux
    /home/cwhitener/perl5/perlbrew/perls/perl-5.28.0/lib/5.28.0

We can see the necessary libraries installed:

$ sudo apt install build-essential libssl-dev libcrypto++-dev zlib1g-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
build-essential is already the newest version (12.4ubuntu1).
zlib1g-dev is already the newest version (1:1.2.11.dfsg-0ubuntu2).
libcrypto++-dev is already the newest version (5.6.4-8).
libssl-dev is already the newest version (1.1.0g-2ubuntu4.1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

Net::SSLeay installs without error:

$ cpanm Net::SSLeay
--> Working on Net::SSLeay
Fetching http://www.cpan.org/authors/id/M/MI/MIKEM/Net-SSLeay-1.85.tar.gz ... OK
Configuring Net-SSLeay-1.85 ... OK
Building and testing Net-SSLeay-1.85 ... OK
Successfully reinstalled Net-SSLeay-1.85
1 distribution installed

And here's the output for IO::Socket::SSL

$ cpanm -v IO::Socket::SSL
cpanm (App::cpanminus) 1.7044 on perl 5.028000 built for x86_64-linux
Work directory is /home/cwhitener/.cpanm/work/1537210093.589
You have make /usr/bin/make
You have LWP 6.35
You have /bin/tar: tar (GNU tar) 1.29
Copyright (C) 2015 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by John Gilmore and Jay Fenlason.
Searching IO::Socket::SSL () on cpanmetadb ...
Unpacking IO-Socket-SSL-2.060.tar.gz
--> Working on IO::Socket::SSL
Fetching http://www.cpan.org/authors/id/S/SU/SULLR/IO-Socket-SSL-2.060.tar.gz ... OK
IO-Socket-SSL-2.060/
IO-Socket-SSL-2.060/certs/
IO-Socket-SSL-2.060/certs/server-cert.pem
IO-Socket-SSL-2.060/certs/server-key.enc
IO-Socket-SSL-2.060/certs/server.p12
IO-Socket-SSL-2.060/certs/server-wildcard.pem
IO-Socket-SSL-2.060/certs/test-ca.pem
IO-Socket-SSL-2.060/certs/client-cert.pem
IO-Socket-SSL-2.060/certs/server2-cert.pem
IO-Socket-SSL-2.060/certs/proxyca.pem
IO-Socket-SSL-2.060/certs/server-key.pem
IO-Socket-SSL-2.060/certs/server-cert.der
IO-Socket-SSL-2.060/certs/create-certs.pl
IO-Socket-SSL-2.060/certs/client-key.pem
IO-Socket-SSL-2.060/certs/client-key.enc
IO-Socket-SSL-2.060/certs/server2-key.pem
IO-Socket-SSL-2.060/certs/server_enc.p12
IO-Socket-SSL-2.060/certs/server-key.der
IO-Socket-SSL-2.060/t/
IO-Socket-SSL-2.060/t/io-socket-ip.t
IO-Socket-SSL-2.060/t/io-socket-inet6.t
IO-Socket-SSL-2.060/t/acceptSSL-timeout.t
IO-Socket-SSL-2.060/t/npn.t
IO-Socket-SSL-2.060/t/compatibility.t
IO-Socket-SSL-2.060/t/external/
IO-Socket-SSL-2.060/t/external/fingerprint.pl
IO-Socket-SSL-2.060/t/external/ocsp.t
IO-Socket-SSL-2.060/t/external/usable_ca.t
IO-Socket-SSL-2.060/t/public_suffix_ssl.t
IO-Socket-SSL-2.060/t/sessions.t
IO-Socket-SSL-2.060/t/mitm.t
IO-Socket-SSL-2.060/t/start-stopssl.t
IO-Socket-SSL-2.060/t/startssl-failed.t
IO-Socket-SSL-2.060/t/readline.t
IO-Socket-SSL-2.060/t/protocol_version.t
IO-Socket-SSL-2.060/t/sni.t
IO-Socket-SSL-2.060/t/ecdhe.t
IO-Socket-SSL-2.060/t/auto_verify_hostname.t
IO-Socket-SSL-2.060/t/connectSSL-timeout.t
IO-Socket-SSL-2.060/t/sysread_write.t
IO-Socket-SSL-2.060/t/session_ticket.t
IO-Socket-SSL-2.060/t/public_suffix_lib_encode_idn.t
IO-Socket-SSL-2.060/t/verify_hostname.t
IO-Socket-SSL-2.060/t/nonblock.t
IO-Socket-SSL-2.060/t/cert_no_file.t
IO-Socket-SSL-2.060/t/startssl.t
IO-Socket-SSL-2.060/t/public_suffix_lib.pl
IO-Socket-SSL-2.060/t/public_suffix_lib_uri.t
IO-Socket-SSL-2.060/t/testlib.pl
IO-Socket-SSL-2.060/t/plain_upgrade_downgrade.t
IO-Socket-SSL-2.060/t/signal-readline.t
IO-Socket-SSL-2.060/t/verify_hostname_standalone.t
IO-Socket-SSL-2.060/t/public_suffix_lib_libidn.t
IO-Socket-SSL-2.060/t/verify_fingerprint.t
IO-Socket-SSL-2.060/t/dhe.t
IO-Socket-SSL-2.060/t/cert_formats.t
IO-Socket-SSL-2.060/t/sni_verify.t
IO-Socket-SSL-2.060/t/core.t
IO-Socket-SSL-2.060/t/alpn.t
IO-Socket-SSL-2.060/t/memleak_bad_handshake.t
IO-Socket-SSL-2.060/t/01loadmodule.t
IO-Socket-SSL-2.060/lib/
IO-Socket-SSL-2.060/lib/IO/
IO-Socket-SSL-2.060/lib/IO/Socket/
IO-Socket-SSL-2.060/lib/IO/Socket/SSL.pod
IO-Socket-SSL-2.060/lib/IO/Socket/SSL.pm
IO-Socket-SSL-2.060/lib/IO/Socket/SSL/
IO-Socket-SSL-2.060/lib/IO/Socket/SSL/Utils.pm
IO-Socket-SSL-2.060/lib/IO/Socket/SSL/Intercept.pm
IO-Socket-SSL-2.060/lib/IO/Socket/SSL/PublicSuffix.pm
IO-Socket-SSL-2.060/Makefile.PL
IO-Socket-SSL-2.060/example/
IO-Socket-SSL-2.060/example/lwp-with-verifycn.pl
IO-Socket-SSL-2.060/example/ssl_server.pl
IO-Socket-SSL-2.060/example/ssl_client.pl
IO-Socket-SSL-2.060/example/simulate_proxy.pl
IO-Socket-SSL-2.060/example/async_https_server.pl
IO-Socket-SSL-2.060/example/ssl_mitm.pl
IO-Socket-SSL-2.060/docs/
IO-Socket-SSL-2.060/docs/debugging.txt
IO-Socket-SSL-2.060/MANIFEST
IO-Socket-SSL-2.060/README.Win32
IO-Socket-SSL-2.060/Changes
IO-Socket-SSL-2.060/BUGS
IO-Socket-SSL-2.060/README
IO-Socket-SSL-2.060/META.yml
IO-Socket-SSL-2.060/META.json
Entering IO-Socket-SSL-2.060
Checking configure dependencies from META.json
Checking if you have ExtUtils::MakeMaker 6.58 ... Yes (7.34)
Running Makefile.PL
Configuring IO-Socket-SSL-2.060 ... Checking if your kit is complete...
Looks good
Generating a Unix-style Makefile
Writing Makefile for IO::Socket::SSL
Writing MYMETA.yml and MYMETA.json
Checking dependencies from MYMETA.json ...
Checking if you have Mozilla::CA 0 ... Yes (20180117)
Checking if you have Net::SSLeay 1.46 ... Yes (1.85)
Checking if you have Scalar::Util 0 ... Yes (1.50)
Checking if you have ExtUtils::MakeMaker 0 ... Yes (7.34)
OK
Building and testing IO-Socket-SSL-2.060 ... cp lib/IO/Socket/SSL.pm blib/lib/IO/Socket/SSL.pm
cp lib/IO/Socket/SSL/Utils.pm blib/lib/IO/Socket/SSL/Utils.pm
cp lib/IO/Socket/SSL.pod blib/lib/IO/Socket/SSL.pod
cp lib/IO/Socket/SSL/PublicSuffix.pm blib/lib/IO/Socket/SSL/PublicSuffix.pm
cp lib/IO/Socket/SSL/Intercept.pm blib/lib/IO/Socket/SSL/Intercept.pm
Manifying 4 pod documents
PERL_DL_NONLAZY=1 "/home/cwhitener/perl5/perlbrew/perls/perl-5.28.0/bin/perl" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib/lib', 'blib/arch')" t/*.t t/external/*.t
# openssl version compiled=0x1010007f linked=0x1010007f -- OpenSSL 1.1.0g  2 Nov 2017
# Net::SSLeay version=1.85
# parent IO::Socket::IP version=0.39
t/01loadmodule.t .................. ok
t/acceptSSL-timeout.t ............. ok
t/alpn.t .......................... ok
t/auto_verify_hostname.t .......... ok
t/cert_formats.t .................. ok
t/cert_no_file.t .................. ok
t/compatibility.t ................. ok
t/connectSSL-timeout.t ............ ok
t/alpn.t .......................... ok
t/auto_verify_hostname.t .......... ok
t/cert_formats.t .................. ok
t/cert_no_file.t .................. ok
t/compatibility.t ................. ok
t/connectSSL-timeout.t ............ ok
t/core.t .......................... ok
t/dhe.t ........................... ok
t/ecdhe.t ......................... ok
# tcp connect to www.chksum.de:443 ok
# fingerprint matches
# validation with default CA w/o OCSP ok
# got stapled response as expected
# validation with default CA with OCSP defaults ok
# validation with default CA with OCSP full chain ok
# tcp connect to www.bild.de:443 ok
# tcp connect to revoked.grc.com:443 ok
# fingerprint matches
# validation with default CA w/o OCSP ok
t/external/ocsp.t ................. ok
# found 134 CA certs
# have root CA for www.bild.de in store
# 5 connections to www.bild.de ok
# have root CA for www.yahoo.com in store
# 5 connections to www.yahoo.com ok
# have root CA for www.comdirect.de in store
# 5 connections to www.comdirect.de ok
# have root CA for meine.deutsche-bank.de in store
# 5 connections to meine.deutsche-bank.de ok
# have root CA for www.twitter.com in store
# 5 connections to www.twitter.com ok
# have root CA for www.facebook.com in store
# 5 connections to www.facebook.com ok
# fingerprint www.facebook.com matches
# check www.facebook.com against builtin CA store ok
# have root CA for www.live.com in store
# 5 connections to www.live.com ok
t/external/usable_ca.t ............ ok
t/io-socket-inet6.t ............... skipped: no IO::Socket::INET6 available
t/io-socket-ip.t .................. ok
t/memleak_bad_handshake.t ......... ok
t/mitm.t .......................... ok
t/nonblock.t ......................
Failed 11/27 subtests
t/npn.t ........................... ok
# -- test: newINET start_SSL stop_SSL start_SSL
# server accepted new client
# wait for initial data from client
# got 0x666f6f from client
# server: got plain data at start of connection
# server: TLS upgrade
# server: TLS downgrade
# server: TLS upgrade#2
# -- test: newSSL stop_SSL connect_SSL
# server accepted new client
# wait for initial data from client
# got 0x160301 from client
# server: TLS upgrade
# server: TLS downgrade
# server: TLS upgrade#2
# -- test: newSSL:0 connect_SSL stop_SSL connect_SSL
# server accepted new client
# wait for initial data from client
# got 0x666f6f from client
# server: got plain data at start of connection
# server: TLS upgrade
# server: TLS downgrade
# server: TLS upgrade#2
# -- test: newSSL:0 start_SSL stop_SSL connect_SSL
# server accepted new client
# wait for initial data from client
# got 0x666f6f from client
# server: got plain data at start of connection
# server: TLS upgrade
# server: TLS downgrade
# server: TLS upgrade#2
# server accepted new client
# wait for initial data from client
# got 0x656e64 from client
# client requested end of tests
t/plain_upgrade_downgrade.t ....... ok
# looks like OpenSSL was compiled without SSLv3 support
# looks like OpenSSL was compiled without TLSv1_3 support
t/protocol_version.t .............. ok
t/public_suffix_lib_encode_idn.t .. ok
t/public_suffix_lib_libidn.t ...... ok
t/public_suffix_lib_uri.t ......... ok
t/public_suffix_ssl.t ............. ok
t/readline.t ...................... ok
# listen at 127.0.0.1:54692
# listen at 127.0.0.1:54693
# connect to 0: success reuse=0
# connect to 0: success reuse=1
# connect to 1: success reuse=1
# connect to 1: success reuse=0
# connect to 0: success reuse=0
# connect to 0: success reuse=1
t/session_ticket.t ................ ok
t/sessions.t ...................... ok
t/signal-readline.t ............... ok
t/sni.t ........................... ok
t/sni_verify.t .................... ok
t/start-stopssl.t ................. ok
t/startssl-failed.t ............... ok
t/startssl.t ...................... ok
t/sysread_write.t ................. ok
t/verify_fingerprint.t ............ ok
t/verify_hostname.t ............... ok
t/verify_hostname_standalone.t .... ok

Test Summary Report
-------------------
t/nonblock.t                    (Wstat: 0 Tests: 22 Failed: 6)
  Failed tests:  12-13, 19-22
  Parse errors: Bad plan.  You planned 27 tests but ran 22.
Files=38, Tests=793, 148 wallclock secs ( 0.11 usr  0.36 sys +  3.90 cusr  7.76 csys = 12.13 CPU)
Result: FAIL
Failed 1/38 test programs. 6/793 subtests failed.
Makefile:878: recipe for target 'test_dynamic' failed
make: *** [test_dynamic] Error 255
! Installing IO::Socket::SSL failed. See /home/cwhitener/.cpanm/work/1537210093.589/build.log for details. Retry with --force to force install it.
FAIL
ethanherbertson commented 5 years ago

Ditto for me.

E3V3A commented 5 years ago

I think this should be reported to the maintainer of IO::Socket::SSL. I have the same problem with Perl in Cygwin. Fails without any good reason.

therealkenc commented 5 years ago

If the IO::Socket::SSL maintainers can nail down a diverge I'd be happy to turn this into a repro the devs can consume. Or (with regret) dupe it to another issue. This one went chirping crickets because there isn't an identifiable hard fail in the strace, just a bunch of successful read/writes/selects. One write(2) sends a "not ok", which doesn't bode well, but doesn't help identify where WSL is diverging from Real Linux. [And then there is a second post with three screenfulls of config noise, which I am sure was well meaning but serves mostly to bury the OP.]

The other problem (if that is the word) is that we have to take as a given that IO:Socket::SSL "works", for some value of working, or the Perl webdev ecosystem would fall down and there would be screeching. No screeching, rather a test case that fails without indentifying a consequence.

Idle thought; it could be recently reported #3813, given the headline title of the test (nonblack.t) which I assume (?) has to do with nonblocking socket behavior rather than lack of blackness.

E3V3A commented 5 years ago

Apparently (at least) they seem to have a github for that module: https://github.com/noxxi/p5-io-socket-ssl/issues

And from the PRs there, it seem to have been a long range of Windows issues. In particular in this issue Where I also posted my recent problem, which then was resolved in a seemingly random way.

The only straight-forward solution at this point (given that make passes) is a forced install.

microsoft-github-policy-service[bot] commented 7 months ago

This issue has been automatically closed since it has not had any activity for the past year. If you're still experiencing this issue please re-file this as a new issue or feature request.

Thank you!