develooper Front page | perl.perl5.porters | Postings from March 2011

[perl #85366] fork and encoding simultaneous usage error

From:
S B
Date:
March 4, 2011 21:14
Subject:
[perl #85366] fork and encoding simultaneous usage error
Message ID:
rt-3.6.HEAD-28241-1299166141-765.85366-75-0@perl.org
# New Ticket Created by  S B 
# Please include the string:  [perl #85366]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=85366 >


This is a bug report for perl from whylivealife@gmail.com,
generated with the help of perlbug 1.39 running under perl v5.8.9.


-----------------------------------------------------------------
Perl crashes if script simultaneously uses encoding pragma and fork.

use strict;
use warnings;
use encoding 'utf-8';
my $pid = fork;
unless($pid)
{
  while(1)
  {
    print 1;
    sleep 1;
  }
}

I think it crashes on macro
PUSHSTACKi(PERLSI_MAGIC);

from method
SV *
PerlIOEncode_getarg(pTHX_ PerlIO * f, CLONE_PARAMS * param, int flags)

at
encoding.xs

However, it doesn't crash if i close STDIN and STDOUT before calling fork.
-----------------------------------------------------------------
---
Flags:
    category=library
    severity=medium
    module=encoding
---
Site configuration information for perl v5.8.9:

Configured by sshd_server at Wed Jan 27 16:09:40 2010.

Summary of my perl5 (revision 5 version 8 subversion 9) configuration:
  Platform:
    osname=MSWin32, osvers=5.2, archname=MSWin32-x64-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=define use64bitall=undef uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
  Compiler:
    cc='cl', ccflags ='-nologo -GF -W3 -MD -Zi -DNDEBUG -Ox -GL -Wp64
-fp:precise -DWIN32 -D_CONSOLE -DNO_STRICT -DHAVE_DES_FCRYPT -DWIN64
-DCONSERVATIVE -DNO_HASH_SEED -DUSE_SITECUSTOMIZE -DPRIVLIB_LAST_IN_INC
-DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO
-DPERL_MSVCRT_READFIX',
    optimize='-MD -Zi -DNDEBUG -Ox -GL -Wp64 -fp:precise',
    cppflags='-DWIN32'
    ccversion='14.00.40310.41', gccversion='', gccosandvers=''
    intsize=4, longsize=4, ptrsize=8, doublesize=8, byteorder=12345678
    d_longlong=undef, longlongsize=8, d_longdbl=define, longdblsize=8
    ivtype='__int64', ivsize=8, 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:"D:\Perl64\lib\CORE"  -machine:AMD64'
    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
bufferoverflowU.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
bufferoverflowU.lib msvcrt.lib
    libc=msvcrt.lib, so=dll, useshrplib=true, 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 -ltcg  -libpath:"D:\Perl64\lib\CORE"  -machine:AMD64'

Locally applied patches:
    ACTIVEPERL_LOCAL_PATCHES_ENTRY
    f7bbab select() generates 'Invalid parameter' messages on Windows Vista.
    36f064 do/require don't treat '.\foo' or '..\foo' as absolute paths on
Windows
    287a96 Fix -p function and Fcntl::S_IFIFO constant under Microsoft VC
compiler
    Iin_load_module moved for compatibility with build 806
    Avoid signal flag SA_RESTART for older versions of HP-UX
    Less verbose ExtUtils::Install and Pod::Find
    Rearrange @INC so that 'site' is searched before 'perl'
    Partly reverted #dafda6 to preserve binary compatibility
    5e162c Problem killing a pseudo-forked child on Win32
    3e5d88 ANSIfy the PATH environment variable on Windows
    c71e9b,29e136 win32_async_check() can loop indefinitely
    aeecf6 Fix alarm() for Windows 2003

---
@INC for perl v5.8.9:
    D:/Perl64/site/lib
    D:/Perl64/lib
    .

---
Environment for perl v5.8.9:
    CYGWIN=tty
    HOME (unset)
    LANG (unset)
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=C:\Program Files\Common Files\Microsoft Shared\Windows
Live;D:\Program Files (x86)\ImageMagick-6.6.6-Q8;C:\Program Files
(x86)\NVIDIA
Corporation\PhysX\Common;D:\Perl64\site\bin;D:\Perl64\bin;C:\Program Files
(x86)\ATI Stream\bin\x86_64;C:\Program Files (x86)\ATI
Stream\bin\x86;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program
Files\Broadcom\Broadcom 802.11 Network Adapter\Driver;C:\Program Files
(x86)\Toshiba\Bluetooth Toshiba Stack\sys\;C:\Program Files
(x86)\Toshiba\Bluetooth Toshiba Stack\sys\x64\;C:\Program Files (x86)\ATI
Technologies\ATI.ACE\Core-Static;D:\masm32\bin;D:\Program
Files\MATLAB\R2010b\runtime\win64;D:\Program
Files\MATLAB\R2010b\bin;D:\Tools;D:\Program Files
(x86)\Mono-2.6.7\bin;D:\Program Files\TortoiseSVN\bin;D:\Program
Files\Java\jre6\bin;C:\Program Files (x86)\Common Files\Autodesk
Shared\;C:\Program Files (x86)\QuickTime\QTSystem\;C:\Program Files\Common
Files\Microsoft Shared\Windows Live;D:\Program Files (x86)\CMake
2.8\bin;D:\Program Files (x86)\Nmap;D:\Program Files (x86)\OpenVPN\bin
    PERL_BADLANG (unset)
    SHELL (unset)



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About