Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

anyevent_closed_connection.t hangs on Windows #38

Open
chorny opened this Issue · 5 comments

3 participants

@chorny

Does not print anything. Strawberry perl 5.16.2, 5.18.0.

@debug-ito

I can reproduce this bug.

Environemnt:

  • Windows 7 32bit
  • Strawberry Perl 5.18.2.1
  • Twiggy 0.1024

Cannot install Twiggy 0.1024 because t/anyevent_closed_connection.t hangs.

I have a bad feeling about using alarm() and $SIG{ALRM} in the test. Is it ok to mix them with AnyEvent?

@chorny

Also in version 0.1025. Installing latest versions of AnyEvent, Plack, Test::TCP, EV did not help.

@mishin

I confirm for

Summary of my perl5 (revision 5 version 14 subversion 2) configuration:

  Platform:
    osname=MSWin32, osvers=4.0, archname=MSWin32-x86-multi-thread
    uname='Win32 strawberryperl 5.14.2.1 #1 Tue Nov 22 21:00:59 2011 i386'
    config_args='undef'
    hint=recommended, useposix=true, d_sigaction=undef
    useithreads=define, usemultiplicity=define
    useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
    use64bitint=undef, use64bitall=undef, uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
  Compiler:
    cc='gcc', ccflags =' -s -O2 -DWIN32  -DPERL_TEXTMODE_SCRIPTS -DUSE_SITECUSTOMIZE -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -fno-strict-aliasing -mms-bitfields',
    optimize='-s -O2',
    cppflags='-DWIN32'
    ccversion='', gccversion='4.4.7', gccosandvers=''
    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
    d_longlong=undef, longlongsize=8, d_longdbl=define, longdblsize=12
    ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='long long', lseeksize=8
    alignbytes=8, prototype=define
  Linker and Libraries:
    ld='g++', ldflags ='-s -L"C:\Dwimperl\perl\lib\CORE" -L"C:\Dwimperl\c\lib"'
    libpth=C:\Dwimperl\c\lib C:\Dwimperl\c\i686-w64-mingw32\lib
    libs=-lmoldname -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -lnetapi32 -luuid -lws2_32 -lmpr -lwinmm -lversion -lodbc32 -lodbccp32 -lcomctl32
    perllibs=-lmoldname -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -lnetapi32 -luuid -lws2_32 -lmpr -lwinmm -lversion -lodbc32 -lodbccp32 -lcomctl32
    libc=, so=dll, useshrplib=true, libperl=libperl514.a
    gnulibc_version=''
  Dynamic Linking:
    dlsrc=dl_win32.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' '
    cccdlflags=' ', lddlflags='-mdll -s -L"C:\Dwimperl\perl\lib\CORE" -L"C:\Dwimperl\c\lib"'


Characteristics of this binary (from libperl): 
  Compile-time options: MULTIPLICITY PERL_DONT_CREATE_GVSV
                        PERL_IMPLICIT_CONTEXT PERL_IMPLICIT_SYS
                        PERL_MALLOC_WRAP PERL_PRESERVE_IVUV PL_OP_SLAB_ALLOC
                        USE_ITHREADS USE_LARGE_FILES USE_PERLIO USE_PERL_ATOF
                        USE_SITECUSTOMIZE
  Built under MSWin32
  Compiled at Nov 22 2011 21:13:28
  @INC:
    C:/Dwimperl/perl/site/lib
    C:/Dwimperl/perl/vendor/lib
    C:/Dwimperl/perl/lib
    .

t/anyevent_closed_connection.t hang too

@mishin

I test it with -d

perl -Ilib  -d t/anyevent_closed_connection.t   
main::(t/anyevent_closed_connection.t:52):                                                                                                                                                              
52:     waitpid($server->pid, 0);    #didn't work
50:     local $SIG{ALRM} = sub { $hanged = 1; kill 'TERM' => $server->pid; };                                                                                                                           
  DB<2>                                                                                                                                                                                                 
main::(t/anyevent_closed_connection.t:46):                                                                                                                                                              
46:     request($server->port);                                                                                                                                                                         
  DB<2>                                                                                                                                                                                                 
main::(t/anyevent_closed_connection.t:48):                                                                                                                                                              
48:     kill 'QUIT' => $server->pid;                                                                                                                                                                    
  DB<2>                                                                                                                                                                                                 
main::(t/anyevent_closed_connection.t:49):                                                                                                                                                              
49:     my $hanged = 0;                                                                                                                                                                                 
  DB<2>                                                                                                                                                                                                 
main::(t/anyevent_closed_connection.t:50):                                                                                                                                                              
50:     local $SIG{ALRM} = sub { $hanged = 1; kill 'TERM' => $server->pid; };                                                                                                                           
  DB<2>                                                                                                                                                                                                 
main::(t/anyevent_closed_connection.t:51):                                                                                                                                                              
51:     alarm(5);                                                                                                                                                                                       
  DB<2>                                                                                                                                                                                                 
main::(t/anyevent_closed_connection.t:52):                                                                                                                                                              
52:     waitpid($server->pid, 0);                                                                                                                                                                       
  DB<2>                                                                                                                                                                                                 

hang

@mishin

may be this help?

use POSIX ":sys_wait_h";
my $res = waitpid($server->pid, WNOHANG);
print "Res: $res\n"; #thanks to http://perlmaven.com/how-to-check-if-a-child-process-is-still-running
# waitpid($server->pid, 0);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.