Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

select on non-socket should be fatal on win32, not an error code #14743

Closed
p5pRT opened this issue Jun 9, 2015 · 8 comments
Closed

select on non-socket should be fatal on win32, not an error code #14743

p5pRT opened this issue Jun 9, 2015 · 8 comments

Comments

@p5pRT
Copy link

p5pRT commented Jun 9, 2015

Migrated from rt.perl.org#125370 (status was 'resolved')

Searchable as RT125370$

@p5pRT
Copy link
Author

p5pRT commented Jun 9, 2015

From @bulk88

Created by @bulk88

While debugging a problem with IO​::Select and can_read() on a pipe fd on
Win32, I discovered, that add() only does a fileno() to validate the fd,
and ultimately can_read() never returns an added pipe fd since core
select() fails each time (core select on Win32 does not support anything
but sockets) and can_read() silently returns empty list on core select()
failing. core select should fatally error on non-sockets on Win32 rather
than quietly error.

Perl Info

Flags:
         category=core
         severity=low

Site configuration information for perl 5.21.12:

Configured by Owner at Sun May 10 14:57:08 2015.

Summary of my perl5 (revision 5 version 21 subversion 12) configuration:
       Derived from: 4d372299b1277414fd5be2324b8b67755273b9fb
       Platform:
         osname=MSWin32, osvers=5.1, archname=MSWin32-x86-multi-thread
         uname=''
         config_args='undef'
         hint=recommended, useposix=true, d_sigaction=undef
         useithreads=define, usemultiplicity=define
         use64bitint=undef, use64bitall=undef, uselongdouble=undef
         usemymalloc=n, bincompat5005=undef
       Compiler:
         cc='cl', ccflags ='-nologo -GF -W3 -O1 -MD -Zi -DNDEBUG -GL -DWIN32
-D_CONSOLE -DNO_STRICT  -DPERL_TEXTMODE_SCRIPTS -DPERL_IMPLICIT_CONTEXT
-DPERL_IMPLICIT_SYS -D_USE_32BIT_TIME_T',
         optimize='-O1 -MD -Zi -DNDEBUG -GL',
         cppflags='-DWIN32'
         ccversion='13.10.6030', gccversion='', gccosandvers=''
         intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234,
doublekind=3
         d_longlong=undef, longlongsize=8, d_longdbl=define, longdblsize=8,
longdblkind=0
         ivtype='long', ivsize=4, nvtype='double', nvsize=8, 
Off_t='__int64',
lseeksize=8
         alignbytes=8, prototype=define
       Linker and Libraries:
         ld='link', ldflags ='-nologo -nodefaultlib -debug -opt:ref,icf 
-ltcg
             -libpath:"c:\perl\lib\CORE"         -machine:x86'
         libpth=\lib
         libs=oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib
comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib
netapi32.lib uuid.lib ws2_32.lib mpr.lib winmm.lib version.lib
odbc32.lib odbccp32.lib comctl32.lib msvcrt.lib
         perllibs=oldnames.lib kernel32.lib user32.lib gdi32.lib 
winspool.lib
comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib
netapi32.lib uuid.lib ws2_32.lib mpr.lib winmm.lib version.lib
odbc32.lib odbccp32.lib comctl32.lib msvcrt.lib
         libc=msvcrt.lib, so=dll, useshrplib=true, libperl=perl521.lib
         gnulibc_version=''
       Dynamic Linking:
         dlsrc=dl_win32.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' '
         cccdlflags=' ', lddlflags='-dll -nologo -nodefaultlib -debug
-opt:ref,icf -ltcg         -libpath:"c:\perl\lib\CORE"         -machine:x86'

Locally applied patches:
         uncommitted-changes


@INC for perl 5.21.12:
         C:/perl521/srcnewb4opt/lib
         .


Environment for perl 5.21.12:
         HOME (unset)
         LANG (unset)
         LANGUAGE (unset)
         LD_LIBRARY_PATH (unset)
         LOGDIR (unset)
         PATH=C:\Program Files\Dr.
Memory\bin;C:\sperl\c\bin;C:\WINDOWS\system32;C:\Program Files\Microsoft
Visual Studio .NET 2003\Vc7\bin;C:\Program Files\Microsoft Visual Studio
.NET 2003\Common7\IDE;C:\WINDOWS;C:\Program Files\Git\cmd;C:\Program
Files\Microsoft Visual Studio .NET 2003\Common7\Tools\bin;C:\perl\bin
         PERL_BADLANG (unset)
         PERL_JSON_BACKEND=Cpanel::JSON::XS
         PERL_YAML_BACKEND=YAML
         SHELL (unset)







@p5pRT
Copy link
Author

p5pRT commented Jun 10, 2015

From @tonycoz

On Tue Jun 09 14​:20​:42 2015, bulk88 wrote​:

While debugging a problem with IO​::Select and can_read() on a pipe fd on
Win32, I discovered, that add() only does a fileno() to validate the fd,
and ultimately can_read() never returns an added pipe fd since core
select() fails each time (core select on Win32 does not support anything
but sockets) and can_read() silently returns empty list on core select()
failing. core select should fatally error on non-sockets on Win32 rather
than quietly error.

The problem is IO​::Select doesn't have a way to distinguish
between an error and a timeout.

Tony

@p5pRT
Copy link
Author

p5pRT commented Jun 10, 2015

The RT System itself - Status changed from 'new' to 'open'

@p5pRT
Copy link
Author

p5pRT commented Jun 10, 2015

From @ikegami

On Tue, Jun 9, 2015 at 8​:40 PM, Tony Cook via RT <perlbug-followup@​perl.org>
wrote​:

The problem is IO​::Select doesn't have a way to distinguish
between an error and a timeout.

Which is truly unfortunate since you always need to use a timeout when
relying on signals to abort select() because of a race condition.

@p5pRT
Copy link
Author

p5pRT commented Nov 12, 2017

From zefram@fysh.org

Tony Cook wrote​:

The problem is IO​::Select doesn't have a way to distinguish
between an error and a timeout.

Actually it *is* possible to distinguish them, though a bit awkward.
I've documented it in commit bc33310.
That should address this issue, without changing any behaviour.

If we were to change any behaviour, it should be in IO​::Select, not
core select(), because core select() has a perfectly well defined way to
signal errors. But since errors are actually detectable with IO​::Select,
albeit by a less nice mechanism, I don't think we should change any of
this behaviour at all.

-zefram

@p5pRT
Copy link
Author

p5pRT commented Nov 12, 2017

@cpansprout - Status changed from 'open' to 'pending release'

@p5pRT
Copy link
Author

p5pRT commented Jun 23, 2018

From @khwilliamson

Thank you for filing this report. You have helped make Perl better.

With the release yesterday of Perl 5.28.0, this and 185 other issues have been
resolved.

Perl 5.28.0 may be downloaded via​:
https://metacpan.org/release/XSAWYERX/perl-5.28.0

If you find that the problem persists, feel free to reopen this ticket.

@p5pRT
Copy link
Author

p5pRT commented Jun 23, 2018

@khwilliamson - Status changed from 'pending release' to 'resolved'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant