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

MSWin32: can't disable crlf trans. on STDxxx using :raw or binmode #8688

Closed
p5pRT opened this issue Nov 22, 2006 · 6 comments
Closed

MSWin32: can't disable crlf trans. on STDxxx using :raw or binmode #8688

p5pRT opened this issue Nov 22, 2006 · 6 comments

Comments

@p5pRT
Copy link

p5pRT commented Nov 22, 2006

Migrated from rt.perl.org#40964 (status was 'open')

Searchable as RT40964$

@p5pRT
Copy link
Author

p5pRT commented Nov 22, 2006

From vaclav.ovsik@i.cz

This is a bug report for perl from zito@​bobekw,
generated with the help of perlbug 1.35 running under perl v5.8.8.

Hello,
i compiled perl 5.8.8 on win32 in a standard way using
MSVC6 (with service pack 6 and PSDK) on Windows XP.
All tests passed after compilation.

I found, that I can't disable lf <-> crlf translations
using layer `raw' nor using binmode on filehandle
of STDOUT or STDERR (STDIN not tested). Newly opened
files are ok.

(Tests are run on cygwin prompt, but without cygwins perl.
Native perl is on the PATH.)

  zito@​bobekw​:~$ mytest() {
  > perl -e 'print "\n";' |xxd
  > perl -e 'print join(", ", PerlIO​::get_layers(STDOUT)), "\n";'
  > }

  zito@​bobekw​:~$ mytest
  0000000​: 0d0a ..
  unix, crlf
Ok

  zito@​bobekw​:~$ PERLIO='​:raw' mytest
  0000000​: 0d0a ..
  unix
Bug?

  zito@​bobekw​:~$ PERLIO='​:stdio' mytest
  0000000​: 0d0a ..
  stdio
Bug?

  zito@​bobekw​:~$ PERLIO='​:perlio' mytest
  0000000​: 0a .
  unix, perlio
Ok?
Interesting! Layer unix alone produces crlf,
but unix+perlio behaves ok?

  zito@​bobekw​:~$ PERLIO='​:win32' mytest
  0000000​: 0a .
  win32
Ok

Layer win32 is considered experimental in PerlIO pod, so should
I workaround problem with perlio? Is it safe?

Thanks for any comments on this.
Maybe, I misuderstood something.
--
Vaclav Ovsik


Flags​:
  category=core
  severity=low


Site configuration information for perl v5.8.8​:

Configured by zito at Wed Nov 1 18​:05​:58 2006.

Summary of my perl5 (revision 5 version 8 subversion 8) configuration​:
  Platform​:
  osname=MSWin32, osvers=5.1, archname=MSWin32-x86-multi-thread
  uname=''
  config_args='undef'
  hint=recommended, useposix=true, d_sigaction=undef
  usethreads=define use5005threads=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='cl', ccflags ='-nologo -Gf -W3 -MD -Zi -DNDEBUG -O1 -DWIN32 -D_CONSOLE -DNO_STRICT -DHAVE_DES_FCRYPT -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO -DPERL_MSVCRT_READFIX',
  optimize='-MD -Zi -DNDEBUG -O1',
  cppflags='-DWIN32'
  ccversion='12.00.8168', gccversion='', gccosandvers=''
  intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
  d_longlong=undef, longlongsize=8, d_longdbl=define, longdblsize=10
  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 -libpath​:"d​:\perl\lib\CORE" -machine​:x86'
  libpth=C​:\PROGRA1\MICROS2\VC98\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 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 msvcrt.lib
  libc=msvcrt.lib, so=dll, useshrplib=yes, libperl=perl58.lib
  gnulibc_version=''
  Dynamic Linking​:
  dlsrc=dl_win32.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' '
  cccdlflags=' ', lddlflags='-dll -nologo -nodefaultlib -debug -opt​:ref,icf -libpath​:"d​:\perl\lib\CORE" -machine​:x86'

Locally applied patches​:
 


@​INC for perl v5.8.8​:
  d​:/perl/lib
  d​:/perl/site/lib
  .


Environment for perl v5.8.8​:
  CYGWIN=server ntsec
  HOME (unset)
  LANG (unset)
  LANGUAGE (unset)
  LD_LIBRARY_PATH (unset)
  LOGDIR (unset)
  PATH=C​:\WINDOWS\system32;C​:\WINDOWS;C​:\WINDOWS\System32\Wbem;C​:\Program Files\Microsoft SDK\Bin;C​:\Program Files\Microsoft SDK\Bin\WinNT;C​:\PROGRA1\MICROS2\Common\msdev98\BIN;C​:\PROGRA1\MICROS2\VC98\BIN;C​:\PROGRA1\MICROS2\Common\TOOLS\WINNT;C​:\PROGRA1\MICROS2\Common\TOOLS;d​:\apache;d​:\apache\bin;d​:\openssl\bin;d​:\perl\bin;c​:\utl;c​:\cygwin\bin
  PERLIO=win32
  PERL_BADLANG (unset)
  SHELL (unset)

1 similar comment
@p5pRT
Copy link
Author

p5pRT commented Dec 2, 2006

From vaclav.ovsik@i.cz

This is a bug report for perl from zito@​bobekw,
generated with the help of perlbug 1.35 running under perl v5.8.8.

Hello,
i compiled perl 5.8.8 on win32 in a standard way using
MSVC6 (with service pack 6 and PSDK) on Windows XP.
All tests passed after compilation.

I found, that I can't disable lf <-> crlf translations
using layer `raw' nor using binmode on filehandle
of STDOUT or STDERR (STDIN not tested). Newly opened
files are ok.

(Tests are run on cygwin prompt, but without cygwins perl.
Native perl is on the PATH.)

  zito@​bobekw​:~$ mytest() {
  > perl -e 'print "\n";' |xxd
  > perl -e 'print join(", ", PerlIO​::get_layers(STDOUT)), "\n";'
  > }

  zito@​bobekw​:~$ mytest
  0000000​: 0d0a ..
  unix, crlf
Ok

  zito@​bobekw​:~$ PERLIO='​:raw' mytest
  0000000​: 0d0a ..
  unix
Bug?

  zito@​bobekw​:~$ PERLIO='​:stdio' mytest
  0000000​: 0d0a ..
  stdio
Bug?

  zito@​bobekw​:~$ PERLIO='​:perlio' mytest
  0000000​: 0a .
  unix, perlio
Ok?
Interesting! Layer unix alone produces crlf,
but unix+perlio behaves ok?

  zito@​bobekw​:~$ PERLIO='​:win32' mytest
  0000000​: 0a .
  win32
Ok

Layer win32 is considered experimental in PerlIO pod, so should
I workaround problem with perlio? Is it safe?

Thanks for any comments on this.
Maybe, I misuderstood something.
--
Vaclav Ovsik


Flags​:
  category=core
  severity=low


Site configuration information for perl v5.8.8​:

Configured by zito at Wed Nov 1 18​:05​:58 2006.

Summary of my perl5 (revision 5 version 8 subversion 8) configuration​:
  Platform​:
  osname=MSWin32, osvers=5.1, archname=MSWin32-x86-multi-thread
  uname=''
  config_args='undef'
  hint=recommended, useposix=true, d_sigaction=undef
  usethreads=define use5005threads=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='cl', ccflags ='-nologo -Gf -W3 -MD -Zi -DNDEBUG -O1 -DWIN32 -D_CONSOLE -DNO_STRICT -DHAVE_DES_FCRYPT -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO -DPERL_MSVCRT_READFIX',
  optimize='-MD -Zi -DNDEBUG -O1',
  cppflags='-DWIN32'
  ccversion='12.00.8168', gccversion='', gccosandvers=''
  intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
  d_longlong=undef, longlongsize=8, d_longdbl=define, longdblsize=10
  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 -libpath​:"d​:\perl\lib\CORE" -machine​:x86'
  libpth=C​:\PROGRA1\MICROS2\VC98\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 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 msvcrt.lib
  libc=msvcrt.lib, so=dll, useshrplib=yes, libperl=perl58.lib
  gnulibc_version=''
  Dynamic Linking​:
  dlsrc=dl_win32.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' '
  cccdlflags=' ', lddlflags='-dll -nologo -nodefaultlib -debug -opt​:ref,icf -libpath​:"d​:\perl\lib\CORE" -machine​:x86'

Locally applied patches​:
 


@​INC for perl v5.8.8​:
  d​:/perl/lib
  d​:/perl/site/lib
  .


Environment for perl v5.8.8​:
  CYGWIN=server ntsec
  HOME (unset)
  LANG (unset)
  LANGUAGE (unset)
  LD_LIBRARY_PATH (unset)
  LOGDIR (unset)
  PATH=C​:\WINDOWS\system32;C​:\WINDOWS;C​:\WINDOWS\System32\Wbem;C​:\Program Files\Microsoft SDK\Bin;C​:\Program Files\Microsoft SDK\Bin\WinNT;C​:\PROGRA1\MICROS2\Common\msdev98\BIN;C​:\PROGRA1\MICROS2\VC98\BIN;C​:\PROGRA1\MICROS2\Common\TOOLS\WINNT;C​:\PROGRA1\MICROS2\Common\TOOLS;d​:\apache;d​:\apache\bin;d​:\openssl\bin;d​:\perl\bin;c​:\utl;c​:\cygwin\bin
  PERLIO=win32
  PERL_BADLANG (unset)
  SHELL (unset)

@p5pRT
Copy link
Author

p5pRT commented May 26, 2013

From @jkeenan

On Wed Nov 22 06​:19​:43 2006, zito wrote​:

This is a bug report for perl from zito@​bobekw,
generated with the help of perlbug 1.35 running under perl v5.8.8.

Hello,
i compiled perl 5.8.8 on win32 in a standard way using
MSVC6 (with service pack 6 and PSDK) on Windows XP.
All tests passed after compilation.

I found, that I can't disable lf <-> crlf translations
using layer `raw' nor using binmode on filehandle
of STDOUT or STDERR (STDIN not tested). Newly opened
files are ok.

(Tests are run on cygwin prompt, but without cygwins perl.
Native perl is on the PATH.)

zito@&#8203;bobekw&#8203;:\~$ mytest\(\) \{
> perl \-e 'print "\\n";' |xxd
> perl \-e 'print join\("\, "\, PerlIO&#8203;::get\_layers\(STDOUT\)\)\, "\\n";'
> \}


zito@&#8203;bobekw&#8203;:\~$ mytest
0000000&#8203;: 0d0a                                     \.\.
unix\, crlf

Ok

zito@&#8203;bobekw&#8203;:\~$ PERLIO='&#8203;:raw' mytest
0000000&#8203;: 0d0a                                     \.\.
unix

Bug?

zito@&#8203;bobekw&#8203;:\~$ PERLIO='&#8203;:stdio' mytest
0000000&#8203;: 0d0a                                     \.\.
stdio

Bug?

zito@&#8203;bobekw&#8203;:\~$ PERLIO='&#8203;:perlio' mytest
0000000&#8203;: 0a                                       \.
unix\, perlio

Ok?
Interesting! Layer unix alone produces crlf,
but unix+perlio behaves ok?

zito@&#8203;bobekw&#8203;:\~$ PERLIO='&#8203;:win32' mytest
0000000&#8203;: 0a                                       \.
win32

Ok

Layer win32 is considered experimental in PerlIO pod, so should
I workaround problem with perlio? Is it safe?

Thanks for any comments on this.
Maybe, I misuderstood something.

Is there anyone who has Perl 5.18 on Windows and who is familiar with
layers who could take a look at this older ticket?

Thank you very much.
Jim Keenan

@p5pRT
Copy link
Author

p5pRT commented May 26, 2013

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

@p5pRT
Copy link
Author

p5pRT commented May 26, 2013

From @Leont

On Wed Nov 22 06​:19​:43 2006, zito wrote​:

zito@&#8203;bobekw&#8203;:\~$ mytest
0000000&#8203;: 0d0a                                     \.\.
unix\, crlf

Ok

Correct.

zito@&#8203;bobekw&#8203;:\~$ PERLIO='&#8203;:raw' mytest
0000000&#8203;: 0d0a                                     \.\.
unix

Bug?

Part of this is a bug that has been fixed in 5.14 (open :raw used to
nuke the top layer), part of it is a very subtle issue in the way :unix
can be triggered to do *native* crlf transformation on std{in,out,err}
because the bootstrap explicitly marks them as text. Any other
filehandles should be non-crlf.

Actually, because the first bug is fixed, you should only be able to
observe this on modern perls when doing PERLIO='​:pop'.

zito@&#8203;bobekw&#8203;:\~$ PERLIO='&#8203;:stdio' mytest
0000000&#8203;: 0d0a                                     \.\.
stdio

Bug?

No, that's exactly what you should expect.

zito@&#8203;bobekw&#8203;:\~$ PERLIO='&#8203;:perlio' mytest
0000000&#8203;: 0a                                       \.
unix\, perlio

Ok?

That's correct :-)

Interesting! Layer unix alone produces crlf,
but unix+perlio behaves ok?

zito@&#8203;bobekw&#8203;:\~$ PERLIO='&#8203;:win32' mytest
0000000&#8203;: 0a                                       \.
win32

Ok

That appears to be correct, though not necessarily the most useful
course of action.

Leon

@toddr
Copy link
Member

toddr commented Feb 13, 2020

I believe @Leont 's response here is: Fixed in 5.14

@toddr toddr closed this as completed Feb 13, 2020
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

2 participants