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

fork crashes on perl 5.10.0/Win32 (when using Variable::Magic) #9757

Closed
p5pRT opened this issue May 31, 2009 · 28 comments
Closed

fork crashes on perl 5.10.0/Win32 (when using Variable::Magic) #9757

p5pRT opened this issue May 31, 2009 · 28 comments

Comments

@p5pRT
Copy link

p5pRT commented May 31, 2009

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

Searchable as RT66158$

@p5pRT
Copy link
Author

p5pRT commented May 31, 2009

From @kmx

Hi,

the following script​:

***
1​: use Variable​::Magic qw/wizard cast/;
2​: my $wiz = wizard set => sub { print "now set to ${$_[0]}!\n" };
3​:
4​: if (my $p = fork ) {
5​: print "After fork 1​: $$\n";
6​: }
7​: else {
8​: print "After fork 2​: $$\n";
9​: }
***

crashes during "fork" call on win32/strawberry perl 5.10.0.4 & 5.10.0.5
with error​: perl.exe fails with error "The instruction at address
0x6a72c777 referenced memory at address 0x00000004. The memory could not
be read". If I comment out the second line it works fine.

On Win32 Active state perl 5.10 the program (fork call) does not work
but program just silently ends (without crash).

The same script works fine on win32/strawberry perl 5.8.9.0 & 5.8.9.1 -
also no problems on UNIX perls (I have tested Linux - perl 5.8 and 5.10)
and no problems on Cygwin 5.10 perl.

To be honest I am not sure if this is a bug in Variable​::Magic or perl
core 510 for Win32 (I have reported this not only here but also to
Variable​::Magic).

Here is some debug info about the crash point​:

(gdb) run test.pl
Starting program​: D​:\strawberry\perl\bin\perl.exe test.pl
[New thread 1680.0xebc]
...
Program received signal SIGSEGV, Segmentation fault.
0x6a72c777 in perl510!Perl_ptr_table_new () from
D​:\strawberry\perl\bin\perl510.dll
(gdb) backtrace full
#0 0x6a72c777 in perl510!Perl_ptr_table_new () from
D​:\strawberry\perl\bin\perl510.dll
No symbol table info available.
#1 0x6a72c7ae in perl510!Perl_ptr_table_fetch () from
D​:\strawberry\perl\bin\perl510.dll
No symbol table info available.
#2 0x6a72cb48 in perl510!Perl_sv_dup () from
D​:\strawberry\perl\bin\perl510.dll
No symbol table info available.
#3 0x2e4f11ad in ?? () from
D​:\strawberry\perl\site\lib\auto\Variable\Magic\Magic.dll
No symbol table info available.
#4 0x009f2324 in ?? ()
No symbol table info available.
#5 0x009eb0a4 in ?? ()
No symbol table info available.
#6 0x0022f7d0 in ?? ()
No symbol table info available.
#7 0x6a76509f in perl510!Perl_safesysmalloc () from
D​:\strawberry\perl\bin\perl510.dll
No symbol table info available.
#8 0x2e4f3346 in ?? () from
D​:\strawberry\perl\site\lib\auto\Variable\Magic\Magic.dll
No symbol table info available.
#9 0x003f4764 in ?? ()
No symbol table info available.
#10 0x00a373dc in ?? ()
No symbol table info available.
#11 0x00000000 in ?? ()
No symbol table info available.
(gdb)

Perl Info

Flags:
    category=core
    severity=medium

Site configuration information for perl 5.10.0:

Configured by Adam.Kennedy at Thu Apr 30 15:18:53 2009.

Summary of my perl5 (revision 5 version 10 subversion 0) configuration:
  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
    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 -DHAVE_DES_FCRYPT 
-DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -fno-strict-aliasing
-DPERL_MSVCRT_READFIX',
    optimize='-s -O2',
    cppflags='-DWIN32'
    ccversion='', gccversion='3.4.5', 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++.exe', ldflags ='-s -L"D:\Strawberry\perl\lib\CORE"
-L"D:\Strawberry\c\lib"'
    libpth=D:\Strawberry\c\lib
    libs= -lmsvcrt -lmoldname -lkernel32 -luser32 -lgdi32 -lwinspool
-lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -lnetapi32 -luuid
-lws2_32 -lmpr -lwinmm -lversion -lodbc32 -lodbccp32
    perllibs= -lmsvcrt -lmoldname -lkernel32 -luser32 -lgdi32 -lwinspool
-lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -lnetapi32 -luuid
-lws2_32 -lmpr -lwinmm -lversion -lodbc32 -lodbccp32
    libc=-lmsvcrt, so=dll, useshrplib=true, libperl=libperl510.a
    gnulibc_version=''
  Dynamic Linking:
    dlsrc=dl_win32.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' '
    cccdlflags=' ', lddlflags='-mdll -s -L"D:\Strawberry\perl\lib\CORE"
-L"D:\Strawberry\c\lib"'

Locally applied patches:
    


@INC for perl 5.10.0:
    D:/Strawberry/perl/lib
    D:/Strawberry/perl/site/lib
    .


Environment for perl 5.10.0:
    HOME (unset)
    LANG (unset)
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
   
PATH=D:\strawberry\perl\bin;D:\strawberry\c\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem
    PERL_BADLANG (unset)
    SHELL (unset)

Complete configuration data for perl 5.10.0:

Author=''
CONFIG='true'
Date='$Date'
Header=''
Id='$Id'
Locker=''
Log='$Log'
Mcc='Mcc'
PATCHLEVEL='10'
PERL_API_REVISION='5'
PERL_API_SUBVERSION='0'
PERL_API_VERSION='10'
PERL_CONFIG_SH='true'
PERL_PATCHLEVEL=''
PERL_REVISION='5'
PERL_SUBVERSION='0'
PERL_VERSION='10'
RCSfile='$RCSfile'
Revision='$Revision'
SUBVERSION='0'
Source=''
State=''
_a='.a'
_exe='.exe'
_o='.o'
afs='false'
afsroot='/afs'
alignbytes='8'
ansi2knr=''
aphostname=''
api_revision='5'
api_subversion='0'
api_version='10'
api_versionstring='5.10.0'
ar='ar'
archlib='D:\Strawberry\perl\lib'
archlibexp='D:\Strawberry\perl\lib'
archname='MSWin32-x86-multi-thread'
archname64=''
archobjs=''
asctime_r_proto='0'
awk='awk'
baserev='5'
bash=''
bin='D:\Strawberry\perl\bin'
binexp='D:\Strawberry\perl\bin'
bison=''
byacc='byacc'
byteorder='1234'
c=''
castflags='0'
cat='type'
cc='gcc'
cccdlflags=' '
ccdlflags=' '
ccflags=' -s -O2 -DWIN32 -DHAVE_DES_FCRYPT  -DPERL_IMPLICIT_CONTEXT
-DPERL_IMPLICIT_SYS -fno-strict-aliasing -DPERL_MSVCRT_READFIX'
ccflags_nolargefiles=' -s -O2 -DWIN32 -DHAVE_DES_FCRYPT 
-DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -fno-strict-aliasing
-DPERL_MSVCRT_READFIX'
ccflags_uselargefiles=''
ccname='gcc'
ccsymbols=''
ccversion=''
cf_by='Adam.Kennedy'
cf_email='Adam.Kennedy@SYD1D28264.ce.corp'
cf_time='Thu Apr 30 15:18:53 2009'
chgrp=''
chmod=''
chown=''
clocktype='clock_t'
comm=''
compress=''
contains='grep'
cp='copy'
cpio=''
cpp='gcc -E'
cpp_stuff='42'
cppccsymbols=''
cppflags='-DWIN32'
cpplast=''
cppminus='-'
cpprun='gcc -E'
cppstdin='gcc -E'
cppsymbols=''
crypt_r_proto='0'
cryptlib=''
csh=''
ctermid_r_proto='0'
ctime_r_proto='0'
d_Gconvert='sprintf((b),"%.*g",(n),(x))'
d_PRIEUldbl=''
d_PRIFUldbl=''
d_PRIGUldbl=''
d_PRIXU64=''
d_PRId64=''
d_PRIeldbl=''
d_PRIfldbl=''
d_PRIgldbl=''
d_PRIi64=''
d_PRIo64=''
d_PRIu64=''
d_PRIx64=''
d_SCNfldbl=''
d__fwalk=''
d_access='define'
d_accessx=''
d_aintl=''
d_alarm='define'
d_archlib='define'
d_asctime_r=''
d_atolf=''
d_atoll=''
d_attribute_format=''
d_attribute_malloc=''
d_attribute_nonnull=''
d_attribute_noreturn=''
d_attribute_pure=''
d_attribute_unused=''
d_attribute_warn_unused_result=''
d_bcmp=''
d_bcopy=''
d_bsd='define'
d_bsdgetpgrp=''
d_bsdsetpgrp=''
d_builtin_choose_expr=''
d_builtin_expect=''
d_bzero=''
d_c99_variadic_macros=''
d_casti32='define'
d_castneg='define'
d_charvspr=''
d_chown=''
d_chroot=''
d_chsize='define'
d_class=''
d_clearenv=''
d_closedir='define'
d_cmsghdr_s=''
d_const='define'
d_copysignl=''
d_cplusplus=''
d_crypt='define'
d_crypt_r=''
d_csh=''
d_ctermid=''
d_ctermid_r=''
d_ctime_r=''
d_cuserid=''
d_dbl_dig='define'
d_dbminitproto=''
d_difftime='define'
d_dir_dd_fd=''
d_dirfd=''
d_dirnamlen='define'
d_dlerror='define'
d_dlopen='define'
d_dlsymun=''
d_dosuid=''
d_drand48_r=''
d_drand48proto=''
d_dup2='define'
d_eaccess=''
d_endgrent=''
d_endgrent_r=''
d_endhent=''
d_endhostent_r=''
d_endnent=''
d_endnetent_r=''
d_endpent=''
d_endprotoent_r=''
d_endpwent=''
d_endpwent_r=''
d_endsent=''
d_endservent_r=''
d_eofnblk='define'
d_eunice=''
d_faststdio='define'
d_fchdir=''
d_fchmod=''
d_fchown=''
d_fcntl=''
d_fcntl_can_lock=''
d_fd_macros='define'
d_fd_set='define'
d_fds_bits='define'
d_fgetpos='define'
d_finite=''
d_finitel=''
d_flexfnam='define'
d_flock='define'
d_flockproto='define'
d_fork=''
d_fp_class=''
d_fpathconf=''
d_fpclass=''
d_fpclassify=''
d_fpclassl=''
d_fpos64_t=''
d_frexpl=''
d_fs_data_s=''
d_fseeko=''
d_fsetpos='define'
d_fstatfs=''
d_fstatvfs=''
d_fsync=''
d_ftello=''
d_ftime='define'
d_futimes=''
d_getcwd='define'
d_getespwnam=''
d_getfsstat=''
d_getgrent=''
d_getgrent_r=''
d_getgrgid_r=''
d_getgrnam_r=''
d_getgrps=''
d_gethbyaddr='define'
d_gethbyname='define'
d_gethent=''
d_gethname='define'
d_gethostbyaddr_r=''
d_gethostbyname_r=''
d_gethostent_r=''
d_gethostprotos='define'
d_getitimer=''
d_getlogin='define'
d_getlogin_r=''
d_getmnt=''
d_getmntent=''
d_getnbyaddr=''
d_getnbyname=''
d_getnent=''
d_getnetbyaddr_r=''
d_getnetbyname_r=''
d_getnetent_r=''
d_getnetprotos=''
d_getpagsz=''
d_getpbyname='define'
d_getpbynumber='define'
d_getpent=''
d_getpgid=''
d_getpgrp=''
d_getpgrp2=''
d_getppid=''
d_getprior=''
d_getprotobyname_r=''
d_getprotobynumber_r=''
d_getprotoent_r=''
d_getprotoprotos='define'
d_getprpwnam=''
d_getpwent=''
d_getpwent_r=''
d_getpwnam_r=''
d_getpwuid_r=''
d_getsbyname='define'
d_getsbyport='define'
d_getsent=''
d_getservbyname_r=''
d_getservbyport_r=''
d_getservent_r=''
d_getservprotos='define'
d_getspnam=''
d_getspnam_r=''
d_gettimeod='define'
d_gmtime_r=''
d_gnulibc=''
d_grpasswd=''
d_hasmntopt=''
d_htonl='define'
d_ilogbl=''
d_inc_version_list=''
d_index=''
d_inetaton=''
d_int64_t=''
d_isascii='define'
d_isfinite=''
d_isinf=''
d_isnan='define'
d_isnanl=''
d_killpg='define'
d_lchown=''
d_ldbl_dig='define'
d_libm_lib_version=''
d_link='define'
d_localtime_r=''
d_localtime_r_needs_tzset=''
d_locconv='define'
d_lockf=''
d_longdbl='define'
d_longlong=''
d_lseekproto='define'
d_lstat=''
d_madvise=''
d_malloc_good_size=''
d_malloc_size=''
d_mblen='define'
d_mbstowcs='define'
d_mbtowc='define'
d_memchr='define'
d_memcmp='define'
d_memcpy='define'
d_memmove='define'
d_memset='define'
d_mkdir='define'
d_mkdtemp=''
d_mkfifo=''
d_mkstemp=''
d_mkstemps=''
d_mktime='define'
d_mmap=''
d_modfl=''
d_modfl_pow32_bug=''
d_modflproto=''
d_mprotect=''
d_msg=''
d_msg_ctrunc=''
d_msg_dontroute=''
d_msg_oob=''
d_msg_peek=''
d_msg_proxy=''
d_msgctl=''
d_msgget=''
d_msghdr_s=''
d_msgrcv=''
d_msgsnd=''
d_msync=''
d_munmap=''
d_mymalloc=''
d_nice=''
d_nl_langinfo=''
d_nv_preserves_uv='define'
d_nv_zero_is_allbits_zero='define'
d_off64_t=''
d_old_pthread_create_joinable=''
d_oldpthreads=''
d_oldsock=''
d_open3=''
d_pathconf=''
d_pause='define'
d_perl_otherlibdirs=''
d_phostname=''
d_pipe='define'
d_poll=''
d_portable='define'
d_printf_format_null=''
d_procselfexe=''
d_pseudofork='define'
d_pthread_atfork=''
d_pthread_attr_setscope=''
d_pthread_yield=''
d_pwage=''
d_pwchange=''
d_pwclass=''
d_pwcomment=''
d_pwexpire=''
d_pwgecos=''
d_pwpasswd=''
d_pwquota=''
d_qgcvt=''
d_quad=''
d_random_r=''
d_readdir='define'
d_readdir64_r=''
d_readdir_r=''
d_readlink=''
d_readv=''
d_recvmsg=''
d_rename='define'
d_rewinddir='define'
d_rmdir='define'
d_safebcpy=''
d_safemcpy=''
d_sanemcmp='define'
d_sbrkproto=''
d_scalbnl=''
d_sched_yield=''
d_scm_rights=''
d_seekdir='define'
d_select='define'
d_sem=''
d_semctl=''
d_semctl_semid_ds=''
d_semctl_semun=''
d_semget=''
d_semop=''
d_sendmsg=''
d_setegid=''
d_seteuid=''
d_setgrent=''
d_setgrent_r=''
d_setgrps=''
d_sethent=''
d_sethostent_r=''
d_setitimer=''
d_setlinebuf=''
d_setlocale='define'
d_setlocale_r=''
d_setnent=''
d_setnetent_r=''
d_setpent=''
d_setpgid=''
d_setpgrp=''
d_setpgrp2=''
d_setprior=''
d_setproctitle=''
d_setprotoent_r=''
d_setpwent=''
d_setpwent_r=''
d_setregid=''
d_setresgid=''
d_setresuid=''
d_setreuid=''
d_setrgid=''
d_setruid=''
d_setsent=''
d_setservent_r=''
d_setsid=''
d_setvbuf='define'
d_sfio=''
d_shm=''
d_shmat=''
d_shmatprototype=''
d_shmctl=''
d_shmdt=''
d_shmget=''
d_sigaction=''
d_signbit=''
d_sigprocmask=''
d_sigsetjmp=''
d_sitearch='define'
d_snprintf='define'
d_sockatmark=''
d_sockatmarkproto=''
d_socket='define'
d_socklen_t=''
d_sockpair=''
d_socks5_init=''
d_sprintf_returns_strlen='define'
d_sqrtl=''
d_srand48_r=''
d_srandom_r=''
d_sresgproto=''
d_sresuproto=''
d_statblks=''
d_statfs_f_flags=''
d_statfs_s=''
d_statvfs=''
d_stdio_cnt_lval='define'
d_stdio_ptr_lval='define'
d_stdio_ptr_lval_nochange_cnt='define'
d_stdio_ptr_lval_sets_cnt=''
d_stdio_stream_array=''
d_stdiobase='define'
d_stdstdio='define'
d_strchr='define'
d_strcoll='define'
d_strctcpy='define'
d_strerrm='strerror(e)'
d_strerror='define'
d_strerror_r=''
d_strftime='define'
d_strlcat=''
d_strlcpy=''
d_strtod='define'
d_strtol='define'
d_strtold=''
d_strtoll=''
d_strtoq=''
d_strtoul='define'
d_strtoull=''
d_strtouq=''
d_strxfrm='define'
d_suidsafe=''
d_symlink=''
d_syscall=''
d_syscallproto=''
d_sysconf=''
d_sysernlst=''
d_syserrlst='define'
d_system='define'
d_tcgetpgrp=''
d_tcsetpgrp=''
d_telldir='define'
d_telldirproto='define'
d_time='define'
d_times='define'
d_tm_tm_gmtoff=''
d_tm_tm_zone=''
d_tmpnam_r=''
d_truncate=''
d_ttyname_r=''
d_tzname='define'
d_u32align='define'
d_ualarm=''
d_umask='define'
d_uname='define'
d_union_semun='define'
d_unordered=''
d_unsetenv=''
d_usleep=''
d_usleepproto=''
d_ustat=''
d_vendorarch=''
d_vendorbin=''
d_vendorlib=''
d_vendorscript=''
d_vfork=''
d_void_closedir=''
d_voidsig='define'
d_voidtty=''
d_volatile='define'
d_vprintf='define'
d_vsnprintf='define'
d_wait4=''
d_waitpid='define'
d_wcstombs='define'
d_wctomb='define'
d_writev=''
d_xenix=''
date='date'
db_hashtype='int'
db_prefixtype='int'
db_version_major='0'
db_version_minor='0'
db_version_patch='0'
defvoidused='15'
direntrytype='struct direct'
dlext='dll'
dlsrc='dl_win32.xs'
doublesize='8'
drand01='(rand()/(double)((unsigned)1<<RANDBITS))'
drand48_r_proto='0'
dynamic_ext='B Compress/Raw/Zlib Cwd Data/Dumper Devel/DProf
Devel/PPPort Devel/Peek Digest/MD5 Digest/SHA Encode Fcntl File/Glob
Filter/Util/Call Hash/Util Hash/Util/FieldHash IO List/Util MIME/Base64
Math/BigInt/FastCalc Opcode POSIX PerlIO/encoding PerlIO/scalar
PerlIO/via SDBM_File Socket Storable Sys/Hostname Text/Soundex
Time/HiRes Time/Piece Unicode/Normalize Win32 Win32API/File XS/APItest
XS/Typemap attrs re threads threads/shared'
eagain='EAGAIN'
ebcdic=''
echo='echo'
egrep='egrep'
emacs=''
endgrent_r_proto='0'
endhostent_r_proto='0'
endnetent_r_proto='0'
endprotoent_r_proto='0'
endpwent_r_proto='0'
endservent_r_proto='0'
eunicefix=':'
exe_ext='.exe'
expr='expr'
extensions='B Compress/Raw/Zlib Compress/Zlib Cwd Data/Dumper
Devel/DProf Devel/PPPort Devel/Peek Digest/MD5 Digest/SHA Encode Errno
Fcntl File/Glob Filter/Util/Call Hash/Util Hash/Util/FieldHash IO
IO_Compress_Base IO_Compress_Zlib List/Util MIME/Base64
Math/BigInt/FastCalc Opcode POSIX PerlIO/encoding PerlIO/scalar
PerlIO/via SDBM_File Socket Storable Sys/Hostname Text/Soundex
Time/HiRes Time/Piece Unicode/Normalize Win32 Win32API/File Win32CORE
XS/APItest XS/Typemap attrs re threads threads/shared'
extras=''
fflushNULL='define'
fflushall=''
find='find'
firstmakefile='makefile'
flex=''
fpossize='8'
fpostype='fpos_t'
freetype='void'
from=':'
full_ar=''
full_csh=''
full_sed=''
gccansipedantic=''
gccosandvers=''
gccversion='3.4.5'
getgrent_r_proto='0'
getgrgid_r_proto='0'
getgrnam_r_proto='0'
gethostbyaddr_r_proto='0'
gethostbyname_r_proto='0'
gethostent_r_proto='0'
getlogin_r_proto='0'
getnetbyaddr_r_proto='0'
getnetbyname_r_proto='0'
getnetent_r_proto='0'
getprotobyname_r_proto='0'
getprotobynumber_r_proto='0'
getprotoent_r_proto='0'
getpwent_r_proto='0'
getpwnam_r_proto='0'
getpwuid_r_proto='0'
getservbyname_r_proto='0'
getservbyport_r_proto='0'
getservent_r_proto='0'
getspnam_r_proto='0'
gidformat='"ld"'
gidsign='-1'
gidsize='4'
gidtype='gid_t'
glibpth='/usr/shlib  /lib/pa1.1 /usr/lib/large /lib /usr/lib
/usr/lib/386 /lib/386 /lib/large /usr/lib/small /lib/small /usr/ccs/lib
/usr/ucblib /usr/shlib '
gmake='gmake'
gmtime_r_proto='0'
gnulibc_version=''
grep='grep'
groupcat=''
groupstype='gid_t'
gzip='gzip'
h_fcntl='false'
h_sysfile='true'
hint='recommended'
hostcat='ypcat hosts'
html1dir=''
html1direxp=''
html3dir=''
html3direxp=''
i16size='2'
i16type='short'
i32size='4'
i32type='long'
i64size='8'
i64type='long long'
i8size='1'
i8type='char'
i_arpainet='define'
i_bsdioctl=''
i_crypt=''
i_db=''
i_dbm=''
i_dirent='define'
i_dld=''
i_dlfcn='define'
i_fcntl='define'
i_float='define'
i_fp=''
i_fp_class=''
i_gdbm=''
i_grp=''
i_ieeefp=''
i_inttypes=''
i_langinfo=''
i_libutil=''
i_limits='define'
i_locale='define'
i_machcthr=''
i_malloc='define'
i_math='define'
i_memory=''
i_mntent=''
i_ndbm=''
i_netdb=''
i_neterrno=''
i_netinettcp=''
i_niin=''
i_poll=''
i_prot=''
i_pthread=''
i_pwd=''
i_rpcsvcdbm='define'
i_sfio=''
i_sgtty=''
i_shadow=''
i_socks=''
i_stdarg='define'
i_stddef='define'
i_stdlib='define'
i_string='define'
i_sunmath=''
i_sysaccess=''
i_sysdir=''
i_sysfile=''
i_sysfilio='define'
i_sysin=''
i_sysioctl=''
i_syslog=''
i_sysmman=''
i_sysmode=''
i_sysmount=''
i_sysndir=''
i_sysparam=''
i_sysresrc=''
i_syssecrt=''
i_sysselct=''
i_syssockio=''
i_sysstat='define'
i_sysstatfs=''
i_sysstatvfs=''
i_systime=''
i_systimek=''
i_systimes=''
i_systypes='define'
i_sysuio=''
i_sysun=''
i_sysutsname=''
i_sysvfs=''
i_syswait=''
i_termio=''
i_termios=''
i_time='define'
i_unistd=''
i_ustat=''
i_utime='define'
i_values=''
i_varargs=''
i_varhdr='varargs.h'
i_vfork=''
ignore_versioned_solibs=''
inc_version_list=''
inc_version_list_init='0'
incpath='D:\Strawberry\c\include'
inews=''
initialinstalllocation=''
installarchlib='D:\Strawberry\perl\lib'
installbin='D:\Strawberry\perl\bin'
installhtml1dir=''
installhtml3dir=''
installhtmldir=''
installhtmlhelpdir=''
installman1dir=''
installman3dir=''
installprefix='D:\Strawberry\perl'
installprefixexp='D:\Strawberry\perl'
installprivlib='D:\Strawberry\perl\lib'
installscript='D:\Strawberry\perl\bin'
installsitearch='D:\Strawberry\perl\site\lib'
installsitebin='D:\Strawberry\perl\bin'
installsitehtml1dir=''
installsitehtml3dir=''
installsitelib='D:\Strawberry\perl\site\lib'
installsiteman1dir=''
installsiteman3dir=''
installsitescript=''
installstyle='D:\Strawberry\perl\lib'
installusrbinperl=''
installvendorarch=''
installvendorbin=''
installvendorhtml1dir=''
installvendorhtml3dir=''
installvendorlib=''
installvendorman1dir=''
installvendorman3dir=''
installvendorscript=''
intsize='4'
issymlink=''
ivdformat='"ld"'
ivsize='4'
ivtype='long'
known_extensions='B Compress/Raw/Zlib Cwd DB_File Data/Dumper
Devel/DProf Devel/PPPort Devel/Peek Digest/MD5 Digest/SHA Encode Fcntl
File/Glob Filter/Util/Call GDBM_File Hash/Util Hash/Util/FieldHash
I18N/Langinfo IO IPC/SysV List/Util MIME/Base64 Math/BigInt/FastCalc
NDBM_File ODBM_File Opcode POSIX PerlIO/encoding PerlIO/scalar
PerlIO/via SDBM_File Socket Storable Sys/Hostname Sys/Syslog
Text/Soundex Time/HiRes Time/Piece Unicode/Normalize Win32 Win32API/File
Win32CORE XS/APItest XS/Typemap attrs re threads threads/shared'
ksh=''
ld='g++.exe'
lddlflags='-mdll -s -L"D:\Strawberry\perl\lib\CORE" -L"D:\Strawberry\c\lib"'
ldflags='-s -L"D:\Strawberry\perl\lib\CORE" -L"D:\Strawberry\c\lib"'
ldflags_nolargefiles='-s -L"D:\Strawberry\perl\lib\CORE"
-L"D:\Strawberry\c\lib"'
ldflags_uselargefiles=''
ldlibpthname=''
less='less'
lib_ext='.a'
libc='-lmsvcrt'
libperl='libperl510.a'
libpth='D:\Strawberry\c\lib'
libs=' -lmsvcrt -lmoldname -lkernel32 -luser32 -lgdi32 -lwinspool
-lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -lnetapi32 -luuid
-lws2_32 -lmpr -lwinmm -lversion -lodbc32 -lodbccp32'
libs_nolargefiles='-lmsvcrt -lmoldname -lkernel32 -luser32 -lgdi32
-lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -lnetapi32
-luuid -lws2_32 -lmpr -lwinmm -lversion -lodbc32 -lodbccp32'
libsdirs=''
libsfiles=''
libsfound=''
libspath=''
libswanted='net socket inet nsl nm ndbm gdbm dbm db malloc dl dld ld sun
m c cposix posix ndir dir crypt ucb bsd BSD PW x'
libswanted_nolargefiles=''
libswanted_uselargefiles='net socket inet nsl nm ndbm gdbm dbm db malloc
dl dld ld sun m c cposix posix ndir dir crypt ucb bsd BSD PW x'
line='line'
lint=''
lkflags=''
ln=''
lns='copy'
localtime_r_proto='0'
locincpth='/usr/local/include /opt/local/include /usr/gnu/include
/opt/gnu/include /usr/GNU/include /opt/GNU/include'
loclibpth='/usr/local/lib /opt/local/lib /usr/gnu/lib /opt/gnu/lib
/usr/GNU/lib /opt/GNU/lib'
longdblsize='12'
longlongsize='8'
longsize='4'
lp=''
lpr=''
ls='dir'
lseeksize='8'
lseektype='long long'
mad=''
madlyh=''
madlyobj=''
madlysrc=''
mail=''
mailx=''
make='dmake'
make_set_make='#'
mallocobj='malloc.o'
mallocsrc='malloc.c'
malloctype='void *'
man1dir=''
man1direxp=''
man1ext='1'
man3dir=''
man3direxp=''
man3ext='3'
mips_type=''
mistrustnm=''
mkdir='mkdir'
mmaptype='void *'
modetype='mode_t'
more='more /e'
multiarch=''
mv=''
myarchname='MSWin32'
mydomain=''
myhostname=''
myuname=''
n='-n'
need_va_copy=''
netdb_hlen_type='int'
netdb_host_type='char *'
netdb_name_type='char *'
netdb_net_type='long'
nm='nm'
nm_opt=''
nm_so_opt=''
nonxs_ext='Compress/Zlib Errno IO_Compress_Base IO_Compress_Zlib'
nroff=''
nvEUformat='"E"'
nvFUformat='"F"'
nvGUformat='"G"'
nv_preserves_uv_bits='32'
nveformat='"e"'
nvfformat='"f"'
nvgformat='"g"'
nvsize='8'
nvtype='double'
o_nonblock='O_NONBLOCK'
obj_ext='.o'
old_pthread_create_joinable=''
optimize='-s -O2'
orderlib='false'
osname='MSWin32'
osvers='5.1'
otherlibdirs=''
package='perl5'
pager='more /e'
passcat=''
patchlevel='10'
path_sep=';'
perl='perl'
perl5=''
perl_patchlevel=''
perladmin=''
perllibs=' -lmsvcrt -lmoldname -lkernel32 -luser32 -lgdi32 -lwinspool
-lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -lnetapi32 -luuid
-lws2_32 -lmpr -lwinmm -lversion -lodbc32 -lodbccp32'
perlpath='D:\Strawberry\perl\bin\perl.exe'
pg=''
phostname='hostname'
pidtype='int'
plibpth=''
pmake=''
pr=''
prefix='D:\Strawberry\perl'
prefixexp='D:\Strawberry\perl'
privlib='D:\Strawberry\perl\lib'
privlibexp='D:\Strawberry\perl\lib'
procselfexe=''
prototype='define'
ptrsize='4'
quadkind='5'
quadtype='long long'
randbits='15'
randfunc='rand'
random_r_proto='0'
randseedtype='unsigned'
ranlib='rem'
rd_nodata='-1'
readdir64_r_proto='0'
readdir_r_proto='0'
revision='5'
rm='del'
rmail=''
run=''
runnm='true'
sPRIEUldbl='"E"'
sPRIFUldbl='"F"'
sPRIGUldbl='"G"'
sPRIXU64='"lX"'
sPRId64='"ld"'
sPRIeldbl='"e"'
sPRIfldbl='"f"'
sPRIgldbl='"g"'
sPRIi64='"li"'
sPRIo64='"lo"'
sPRIu64='"lu"'
sPRIx64='"lx"'
sSCNfldbl='"f"'
sched_yield=''
scriptdir='D:\Strawberry\perl\bin'
scriptdirexp='D:\Strawberry\perl\bin'
sed='sed'
seedfunc='srand'
selectminbits='32'
selecttype='Perl_fd_set *'
sendmail='blat'
setgrent_r_proto='0'
sethostent_r_proto='0'
setlocale_r_proto='0'
setnetent_r_proto='0'
setprotoent_r_proto='0'
setpwent_r_proto='0'
setservent_r_proto='0'
sh='cmd /x /c'
shar=''
sharpbang='#!'
shmattype='void *'
shortsize='2'
shrpenv=''
shsharp='true'
sig_count='26'
sig_name='ZERO HUP INT QUIT ILL NUM05 NUM06 NUM07 FPE KILL NUM10 SEGV
NUM12 PIPE ALRM TERM NUM16 NUM17 NUM18 NUM19 CHLD BREAK ABRT STOP NUM24
CONT CLD'
sig_name_init='"ZERO", "HUP", "INT", "QUIT", "ILL", "NUM05", "NUM06",
"NUM07", "FPE", "KILL", "NUM10", "SEGV", "NUM12", "PIPE", "ALRM",
"TERM", "NUM16", "NUM17", "NUM18", "NUM19", "CHLD", "BREAK", "ABRT",
"STOP", "NUM24", "CONT", "CLD", 0'
sig_num='0 1 2 21 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
24 25 20'
sig_num_init='0, 1, 2, 21, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
17, 18, 19, 20, 21, 22, 23, 24, 25, 20, 0'
sig_size='27'
signal_t='void'
sitearch='D:\Strawberry\perl\site\lib'
sitearchexp='D:\Strawberry\perl\site\lib'
sitebin='D:\Strawberry\perl\bin'
sitebinexp='D:\Strawberry\perl\bin'
sitehtml1dir=''
sitehtml1direxp=''
sitehtml3dir=''
sitehtml3direxp=''
sitelib='D:\Strawberry\perl\site\lib'
sitelib_stem=''
sitelibexp='D:\Strawberry\perl\site\lib'
siteman1dir=''
siteman1direxp=''
siteman3dir=''
siteman3direxp=''
siteprefix='D:\Strawberry\perl\site'
siteprefixexp='D:\Strawberry\perl\site'
sitescript=''
sitescriptexp=''
sizesize='4'
sizetype='size_t'
sleep=''
smail=''
so='dll'
sockethdr=''
socketlib=''
socksizetype='int'
sort='sort'
spackage='Perl5'
spitshell=''
srand48_r_proto='0'
srandom_r_proto='0'
src=''
ssizetype='int'
startperl='#!perl'
startsh='#!/bin/sh'
static_ext='Win32CORE'
stdchar='char'
stdio_base='((fp)->_base)'
stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)'
stdio_cnt='((fp)->_cnt)'
stdio_filbuf=''
stdio_ptr='((fp)->_ptr)'
stdio_stream_array=''
strerror_r_proto='0'
strings='/usr/include/string.h'
submit=''
subversion=''
sysman=''
tail=''
tar=''
targetarch=''
tbl=''
tee=''
test=''
timeincl='/usr/include/sys/time.h '
timetype='time_t'
tmpnam_r_proto='0'
to=':'
touch='touch'
tr=''
trnl='\012'
troff=''
ttyname_r_proto='0'
u16size='2'
u16type='unsigned short'
u32size='4'
u32type='unsigned long'
u64size='8'
u64type='unsigned long long'
u8size='1'
u8type='unsigned char'
uidformat='"ld"'
uidsign='-1'
uidsize='4'
uidtype='uid_t'
uname='uname'
uniq='uniq'
uquadtype='unsigned long long'
use5005threads=''
use64bitall=''
use64bitint=''
usecrosscompile=''
usedl='define'
usefaststdio=''
useithreads='define'
uselargefiles='define'
uselongdouble=''
usemallocwrap='define'
usemorebits=''
usemultiplicity='define'
usemymalloc='n'
usenm='false'
useopcode='true'
useperlio='define'
useposix='true'
usereentrant=''
userelocatableinc=''
usesfio='false'
useshrplib='true'
usesitecustomize=''
usesocks=''
usethreads='define'
usevendorprefix=''
usevfork='false'
usrinc='/usr/include'
uuname=''
uvXUformat='"lX"'
uvoformat='"lo"'
uvsize='4'
uvtype='unsigned long'
uvuformat='"lu"'
uvxformat='"lx"'
vendorarch=''
vendorarchexp=''
vendorbin=''
vendorbinexp=''
vendorhtml1dir=''
vendorhtml1direxp=''
vendorhtml3dir=''
vendorhtml3direxp=''
vendorlib=''
vendorlib_stem=''
vendorlibexp=''
vendorman1dir=''
vendorman1direxp=''
vendorman3dir=''
vendorman3direxp=''
vendorprefix=''
vendorprefixexp=''
vendorscript=''
vendorscriptexp=''
version='5.10.0'
version_patchlevel_string='version 10 subversion 0'
versiononly=''
vi=''
voidflags='15'
xlibpth='/usr/lib/386 /lib/386'
yacc='yacc'
yaccflags=''
zcat=''
zip='zip'


@p5pRT
Copy link
Author

p5pRT commented Jun 14, 2009

From bitcard@profvince.com

Hi,

the following script​:

***
1​: use Variable​::Magic qw/wizard cast/;
2​: my $wiz = wizard set =&gt; sub { print "now set to ${$_[0]}!\n" };
3​:
4​: if (my $p = fork ) {
5​: print "After fork 1​: $$\n";
6​: }
7​: else {
8​: print "After fork 2​: $$\n";
9​: }
***

For kmx​: cc'ing the progress to the p5p list.

For p5p​: This is a cross report of
https://rt.cpan.org/Ticket/History.html?id=46546

I think this can be fixed by making PerlProcFork() call
perl_clone_using() with the CLONEf_KEEP_PTR_TABLE flag set (like what
thread.pm do). This would allow extensions to be able to relink internal
SVs in a CLONE subroutine.

Does someone know why perl_clone_using() is called here without this
flag set?

Vincent.

@p5pRT
Copy link
Author

p5pRT commented Jun 14, 2009

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

@p5pRT
Copy link
Author

p5pRT commented Jul 28, 2009

From @kmx

Hi,

could you please confirm or reject this issue as a bug in fork
implementation in Win32 perl 5.10.0?

I would appreciate if somebody could test whether the same behaviour
occurs with 5.10.1 candidate for Win32.

This simple script kills Win32 perl 5.10.0


use Variable​::Magic 'wizard';
my $w = wizard set => sub{};
fork;


--
kmx

@p5pRT
Copy link
Author

p5pRT commented Aug 3, 2009

From @kmx

Hi,

I have investigated this issue further and found out that it is present
also in the latest perl5 blead.

Based on Vicent's post above I have tried this patch to win32/perlhost.h

- PerlInterpreter *new_perl = perl_clone_using((PerlInterpreter*)aTHX, 1,
+ PerlInterpreter *new_perl = perl_clone_using((PerlInterpreter*)aTHX, 1
| CLONEf_KEEP_PTR_TABLE,

and IT SOLVES the described fork issue but I am not able to say that
this is the right way for fixing it.

I would appreciate any feedback.

--
kmx

@p5pRT
Copy link
Author

p5pRT commented Aug 4, 2009

From @csjewell

Can I request that this fix (or a better-implemented fix for this bug)
go in, if not before 5.10.1-RC1, soon afterwards, please?

I'm given to understand (talk to kmx about that to be sure) that this
affects dependencies of Catalyst​::Runtime (among others) on Win32. [
http​://cpants.perl.org/dist/used_by/namespace-clean and
http​://cpants.perl.org/dist/used_by/Variable-Magic ]

--Curtis Jewell

Mon, 03 Aug 2009 07​:03 -0700, "kmx via RT" <perlbug-followup@​perl.org>
wrote​:

Hi,

I have investigated this issue further and found out that it is present
also in the latest perl5 blead.

Based on Vicent's post above I have tried this patch to win32/perlhost.h

- PerlInterpreter *new_perl = perl_clone_using((PerlInterpreter*)aTHX, 1,
+ PerlInterpreter *new_perl = perl_clone_using((PerlInterpreter*)aTHX, 1
| CLONEf_KEEP_PTR_TABLE,

and IT SOLVES the described fork issue but I am not able to say that
this is the right way for fixing it.

I would appreciate any feedback.

--
kmx
--
Curtis Jewell
swordsman@​csjewell.fastmail.us

%DCL-E-MEM-BAD, bad memory
-VMS-F-PDGERS, pudding between the ears

[I use PC-Alpine, which deliberately does not display colors and pictures in HTML mail]

@p5pRT
Copy link
Author

p5pRT commented Aug 4, 2009

From @iabyn

On Tue, Aug 04, 2009 at 03​:49​:29PM -0600, Curtis Jewell wrote​:

Can I request that this fix (or a better-implemented fix for this bug)
go in, if not before 5.10.1-RC1, soon afterwards, please?

I would be extremely reluctant to put this in RC1, and if it's not in RC1,
it's not going to be in 5.10.1.

I'm given to understand (talk to kmx about that to be sure) that this
affects dependencies of Catalyst​::Runtime (among others) on Win32. [
http​://cpants.perl.org/dist/used_by/namespace-clean and
http​://cpants.perl.org/dist/used_by/Variable-Magic ]

--Curtis Jewell

Mon, 03 Aug 2009 07​:03 -0700, "kmx via RT" <perlbug-followup@​perl.org>
wrote​:

Hi,

I have investigated this issue further and found out that it is present
also in the latest perl5 blead.

Based on Vicent's post above I have tried this patch to win32/perlhost.h

- PerlInterpreter *new_perl = perl_clone_using((PerlInterpreter*)aTHX, 1,
+ PerlInterpreter *new_perl = perl_clone_using((PerlInterpreter*)aTHX, 1
| CLONEf_KEEP_PTR_TABLE,

and IT SOLVES the described fork issue but I am not able to say that
this is the right way for fixing it.

So if I understand it correctly, Variable​::Magic has been made to work
under threads by making use of the thread's ptr_table, which is kept
around after a new thread is created. However, fork() under windows is
emulated by using the same threading mechanism that threads.pm uses
but it doesn't keep the ptr_table around (and never has). Variable​::Magic
can't distinguish between a thread clone and a fork clone, and assumes that
the ptr_table is always around, and thus explodes.

The thing that puzzles me is that is doesn't explode on 5.8.x.

--
Never work with children, animals, or actors.

@p5pRT
Copy link
Author

p5pRT commented Aug 5, 2009

From @kmx

I would be extremely reluctant to put this in RC1, and if it's not in
RC1, it's not going to be in 5.10.1.
Oh, it is a really, really bad news at least for Catalyst​::Runtime users
on Win32 as Catalyst quite heavily uses namespace​::clean (based on
Variable-Magic) and any fork - tat is not so rare - is gonna kill
perl.exe. I should probably report this earlier :(

So if I understand it correctly, Variable​::Magic has been made to work
under threads by making use of the thread's ptr_table, which is kept
around after a new thread is created. However, fork() under windows is
emulated by using the same threading mechanism that threads.pm uses
but it doesn't keep the ptr_table around (and never has).
Variable​::Magic can't distinguish between a thread clone and a fork
clone, and assumes that the ptr_table is always around, and thus
explodes.
It is more a question on Vincent (putting him into cc​:) but I understand
it exactly as you have said.

The thing that puzzles me is that is doesn't explode on 5.8.x.
Yes also a mystery for me, the patched line in win32/perlhost.h seems to
be the same in 5.8.x - that is why I am not sure whether this is the
right place for the patch.

--
kmx

@p5pRT
Copy link
Author

p5pRT commented Aug 5, 2009

From @csjewell

On Tue, 04 Aug 2009 23​:46 +0100, "Dave Mitchell" <davem@​iabyn.com>
wrote​:

On Tue, Aug 04, 2009 at 03​:49​:29PM -0600, Curtis Jewell wrote​:

Can I request that this fix (or a better-implemented fix for this bug)
go in, if not before 5.10.1-RC1, soon afterwards, please?

I would be extremely reluctant to put this in RC1, and if it's not in
RC1,
it's not going to be in 5.10.1.

I can understand that. I wouldn't want to take a patch that low-level in
Strawberry this close to an RC. But I was requested to ask - he figured
I might have more of an "in" with p5p than I really do.

And I have to admit that I would prefer that Catalyst not have the
possibility of crashing on 5.10.1 on Win32! [I personally like
Perldoc​::Server.]

Would it help if I ran a smoker over perl with that patch, and if so,
what would I need to set up, with what settings, and where is the fine
manual in question? I've got a moderately fast (it builds/tests/installs
perl when I do Strawberry builds in 1 1/2 hours or so, iirc) Win32
machine I can temporarily dedicate to the purpose tomorrow (probably
starting 15 hours from now). My family would just have to live without
their games for 24 hours or however long it took.

--Curtis
--
Curtis Jewell
swordsman@​csjewell.fastmail.us

%DCL-E-MEM-BAD, bad memory
-VMS-F-PDGERS, pudding between the ears

[I use PC-Alpine, which deliberately does not display colors and pictures in HTML mail]

@p5pRT
Copy link
Author

p5pRT commented Aug 5, 2009

From @csjewell

(forgot to use my outbound to-list address when sending it out
earlier... doing so now.)

----- Original message -----
From​: "Curtis Jewell" <perl@​csjewell.fastmail.us>
To​: "Dave Mitchell" <davem@​iabyn.com>, perl5-porters@​perl.org
Date​: Tue, 04 Aug 2009 18​:58​:50 -0600
Subject​: Re​: [perl #66158] fork crashes on perl 5.10.0/Win32 [PATCH
proposal]

On Tue, 04 Aug 2009 23​:46 +0100, "Dave Mitchell" <davem@​iabyn.com>
wrote​:

On Tue, Aug 04, 2009 at 03​:49​:29PM -0600, Curtis Jewell wrote​:

Can I request that this fix (or a better-implemented fix for this bug)
go in, if not before 5.10.1-RC1, soon afterwards, please?

I would be extremely reluctant to put this in RC1, and if it's not in
RC1,
it's not going to be in 5.10.1.

I can understand that. I wouldn't want to take a patch that low-level in
Strawberry this close to an RC. But I was requested to ask ...

And I have to admit that I would prefer that Catalyst not have the
possibility of crashing on 5.10.1 on Win32! [I personally like
Perldoc​::Server.]

Would it help if I ran a smoker over perl with that patch, and if so,
what would I need to set up, with what settings, and where is the fine
manual in question? I've got a moderately fast (it builds/tests/installs
perl when I do Strawberry builds in 1 1/2 hours or so, iirc) Win32
machine I can temporarily dedicate to the purpose tomorrow (probably
starting 15 hours from now). My family would just have to live without
their games for 24 hours or however long it took.

--Curtis
--
Curtis Jewell
swordsman@​csjewell.fastmail.us

%DCL-E-MEM-BAD, bad memory
-VMS-F-PDGERS, pudding between the ears

[I use PC-Alpine, which deliberately does not display colors and
pictures in HTML mail]

--
Curtis Jewell
swordsman@​csjewell.fastmail.us

%DCL-E-MEM-BAD, bad memory
-VMS-F-PDGERS, pudding between the ears

[I use PC-Alpine, which deliberately does not display colors and pictures in HTML mail]

@p5pRT
Copy link
Author

p5pRT commented Aug 5, 2009

From perl@profvince.com

So if I understand it correctly, Variable​::Magic has been made to work
under threads by making use of the thread's ptr_table, which is kept
around after a new thread is created. However, fork() under windows is
emulated by using the same threading mechanism that threads.pm uses
but it doesn't keep the ptr_table around (and never has). Variable​::Magic
can't distinguish between a thread clone and a fork clone, and assumes
that the ptr_table is always around, and thus explodes.

Yes, exactly. Variable​::Magic stores coderefs in a thread local context.
When a new interpreter is cloned, it needs to relink the old pointers to
their cloned counterparts. Hence it relies on hitting the pointer table in
CLONE.

The thing that puzzles me is that is doesn't explode on 5.8.x.

I've no idea about why it works with 5.8, nor why the pointer table is
flushed for the fork emulation but not for threads.

Vincent.

@p5pRT
Copy link
Author

p5pRT commented Aug 5, 2009

From perl@profvince.com

CC-ing the list.

So if I understand it correctly, Variable​::Magic has been made to work
under threads by making use of the thread's ptr_table, which is kept
around after a new thread is created. However, fork() under windows is
emulated by using the same threading mechanism that threads.pm uses but
it doesn't keep the ptr_table around (and never has). Variable​::Magic
can't distinguish between a thread clone and a fork clone, and assumes
that the ptr_table is always around, and thus explodes.

Yes, exactly. Variable​::Magic stores coderefs in a thread local context.
When a new interpreter is cloned, it needs to relink the old pointers to
their cloned counterparts. Hence it relies on hitting the pointer table in
CLONE.

The thing that puzzles me is that is doesn't explode on 5.8.x.

I've no idea about why it works with 5.8, nor why the pointer table is
flushed for the fork emulation but not for threads.

Vincent.

@p5pRT
Copy link
Author

p5pRT commented Aug 5, 2009

From @iabyn

On Wed, Aug 05, 2009 at 03​:16​:05PM +0200, Vincent Pit wrote​:

The thing that puzzles me is that is doesn't explode on 5.8.x.

I've no idea about why it works with 5.8, nor why the pointer table is
flushed for the fork emulation but not for threads.

That was a change to threads.xs a while ago. Originally neither kept the
table around - its an expensive use of memory (at least 12 bytes per SV
etc per thread). MY_CXT_CLONE was only introduced in 5.8.6, so before that
VMG_THREADSAFE would be 0.

Anyway, I've caved in and applied the following to commits (the first is
cosmetic). Since I haven't got windows they've been applied blindly, so
Curtis, if you can test on then on windows ASAP that would be good.

commit 46a76da
Author​: David Mitchell <davem@​iabyn.com>
AuthorDate​: Wed Aug 5 14​:18​:37 2009 +0100
Commit​: David Mitchell <davem@​iabyn.com>
CommitDate​: Wed Aug 5 14​:18​:37 2009 +0100

  win32/perlhost.h​: use symbolic constant
  CLONEf_COPY_STACKS rather than 1

Affected files ...
 
  M win32/perlhost.h

Differences ...

Inline Patch
diff --git a/win32/perlhost.h b/win32/perlhost.h
index 6e3fcd2..c2473c9 100644
--- a/win32/perlhost.h
+++ b/win32/perlhost.h
@@ -1835,7 +1835,8 @@ PerlProcFork(struct IPerlProc* piPerl)
 	return -1;
     }
     h = new CPerlHost(*(CPerlHost*)w32_internal_host);
-    PerlInterpreter *new_perl = perl_clone_using((PerlInterpreter*)aTHX, 1,
+    PerlInterpreter *new_perl = perl_clone_using((PerlInterpreter*)aTHX,
+						 CLONEf_COPY_STACKS,
 						 h->m_pHostperlMem,
 						 h->m_pHostperlMemShared,
 						 h->m_pHostperlMemParse,



commit 240bfeb Author​: David Mitchell \ AuthorDate​: Wed Aug 5 14​:20​:29 2009 \+0100 Commit​: David Mitchell \ CommitDate​: Wed Aug 5 14​:20​:29 2009 \+0100

  add CLONEf_KEEP_PTR_TABLE to win fork emulation.
  This keeps the ptr-table table around after the thread has been created.
  This has been on for user threads for a while now, but not for
  Windows forks. Turns out that Variable​::Magic relies on the table still
  being there, so crashes under windows forks. This increases memory usage
  per fork, but stops things crashing. Sigh.
  [perl #66158]

Affected files ...
 
  M win32/perlhost.h

Differences ...

Inline Patch
diff --git a/win32/perlhost.h b/win32/perlhost.h
index c2473c9..c02d409 100644
--- a/win32/perlhost.h
+++ b/win32/perlhost.h
@@ -1836,7 +1836,8 @@ PerlProcFork(struct IPerlProc* piPerl)
     }
     h = new CPerlHost(*(CPerlHost*)w32_internal_host);
     PerlInterpreter *new_perl = perl_clone_using((PerlInterpreter*)aTHX,
-						 CLONEf_COPY_STACKS,
+						   CLONEf_COPY_STACKS
+						 | CLONEf_KEEP_PTR_TABLE,
 						 h->m_pHostperlMem,
 						 h->m_pHostperlMemShared,
 						 h->m_pHostperlMemParse,


-- 

Now is the discount of our winter tent
  -- sign seen outside camping shop

@p5pRT
Copy link
Author

p5pRT commented Aug 5, 2009

From perl@profvince.com

Thanks for this.

On Wed, Aug 05, 2009 at 03​:16​:05PM +0200, Vincent Pit wrote​:

The thing that puzzles me is that is doesn't explode on 5.8.x.

I've no idea about why it works with 5.8, nor why the pointer table is
flushed for the fork emulation but not for threads.

Now I know why it doesn't crash on 5.8 : I explicitely disabled
Variable​::Magic thread safety for those.

That was a change to threads.xs a while ago. Originally neither kept the
table around - its an expensive use of memory (at least 12 bytes per SV
etc per thread).

threads.pm manually destroys the pointer table after the new interpreter
is created. It should theorically be fine to just shove a
ptr_table_free(PL_ptr_table) right after the call to perl_clone_using() in
PerlProcFork(). The pointer table has to be alive when CLONE is called,
not after.

Vincent.

@p5pRT
Copy link
Author

p5pRT commented Aug 5, 2009

From @iabyn

On Wed, Aug 05, 2009 at 04​:02​:54PM +0200, Vincent Pit wrote​:

Thanks for this.

On Wed, Aug 05, 2009 at 03​:16​:05PM +0200, Vincent Pit wrote​:

The thing that puzzles me is that is doesn't explode on 5.8.x.

I've no idea about why it works with 5.8, nor why the pointer table is
flushed for the fork emulation but not for threads.

Now I know why it doesn't crash on 5.8 : I explicitely disabled
Variable​::Magic thread safety for those.

That was a change to threads.xs a while ago. Originally neither kept the
table around - its an expensive use of memory (at least 12 bytes per SV
etc per thread).

threads.pm manually destroys the pointer table after the new interpreter
is created. It should theorically be fine to just shove a
ptr_table_free(PL_ptr_table) right after the call to perl_clone_using() in
PerlProcFork(). The pointer table has to be alive when CLONE is called,
not after.

Ah, the penny drops!

The real issue is that in perl_clone_using(), it frees the ptr_table
*before* calling the CLONE methods.

With b0b93b3, I've fixed
perl_clone_using() to free it afterwards; then I've backed out the
win32/perlhost.h change.

I'll be pushing this into maint in a moment.

I wonder​: for existing 5.10.0 users, whether Variable​::Magic could
test for a null PL_ptr_table before calling sv_dup? I don't know whether
that would ameliorate the problem, or whether you're already going to
crash and burn due to skipping the dup???

--
In England there is a special word which means the last sunshine
of the summer. That word is "spring".

@p5pRT
Copy link
Author

p5pRT commented Aug 5, 2009

From @kmx

Hi,

The real issue is that in perl_clone_using(), it frees the ptr_table
*before* calling the CLONE methods.

With b0b93b3, I've fixed
perl_clone_using() to free it afterwards; then I've backed out the
win32/perlhost.h change.

I have build perl/Win32 (using mingw) from blead with the
above-mentioned patch and all crashing cases I knew about work fine now.

Many thanks to all of you involved in solving this issues.

I'll be pushing this into maint in a moment.
Does it mean there is a chance to see this fix in 5.10.1?

--
kmx

@p5pRT
Copy link
Author

p5pRT commented Aug 5, 2009

From @iabyn

On Wed, Aug 05, 2009 at 03​:33​:34PM +0100, Dave Mitchell wrote​:

On Wed, Aug 05, 2009 at 04​:02​:54PM +0200, Vincent Pit wrote​:

Thanks for this.

On Wed, Aug 05, 2009 at 03​:16​:05PM +0200, Vincent Pit wrote​:

The thing that puzzles me is that is doesn't explode on 5.8.x.

I've no idea about why it works with 5.8, nor why the pointer table is
flushed for the fork emulation but not for threads.

Now I know why it doesn't crash on 5.8 : I explicitely disabled
Variable​::Magic thread safety for those.

That was a change to threads.xs a while ago. Originally neither kept the
table around - its an expensive use of memory (at least 12 bytes per SV
etc per thread).

threads.pm manually destroys the pointer table after the new interpreter
is created. It should theorically be fine to just shove a
ptr_table_free(PL_ptr_table) right after the call to perl_clone_using() in
PerlProcFork(). The pointer table has to be alive when CLONE is called,
not after.

Ah, the penny drops!

The real issue is that in perl_clone_using(), it frees the ptr_table
*before* calling the CLONE methods.

With b0b93b3, I've fixed
perl_clone_using() to free it afterwards; then I've backed out the
win32/perlhost.h change.

I'll be pushing this into maint in a moment.

I wonder​: for existing 5.10.0 users, whether Variable​::Magic could
test for a null PL_ptr_table before calling sv_dup? I don't know whether
that would ameliorate the problem, or whether you're already going to
crash and burn due to skipping the dup???

PS can someone confirm ASAP that GitLive-maint-5.10-1727-g02784d7 or later
fixes the V​::M fork issue on windows?

Thanks.

--
The Enterprise's efficient long-range scanners detect a temporal vortex
distortion in good time, allowing it to be safely avoided via a minor
course correction.
  -- Things That Never Happen in "Star Trek" #21

@p5pRT
Copy link
Author

p5pRT commented Aug 6, 2009

From @csjewell

On Wed Aug 05 14​:01​:26 2009, davem wrote​:

PS can someone confirm ASAP that GitLive-maint-5.10-1727-g02784d7 or
later
fixes the V​::M fork issue on windows?

Thanks.

Can you live with ASAP == between 12 and 24 hours? I'm not at the
machine where I can check it right now... If anybody can do it sooner,
that'll be fantastic, but if not, I'll do it and report back.

(speaking of which, I ran a 4-build gcc smoker (-DDEBUGGING and
-Duseithreads were the 2 options), and it passed all 4 times earlier
today. So that isn't an issue, although I'm running an 8-build one
tonight to be sure against the change
d792035 snapshot)

--Curtis

@p5pRT
Copy link
Author

p5pRT commented Aug 6, 2009

From @iabyn

On Wed, Aug 05, 2009 at 12​:42​:12PM -0700, kmx via RT wrote​:

Hi,

The real issue is that in perl_clone_using(), it frees the ptr_table
*before* calling the CLONE methods.

With b0b93b3, I've fixed
perl_clone_using() to free it afterwards; then I've backed out the
win32/perlhost.h change.

I have build perl/Win32 (using mingw) from blead with the
above-mentioned patch and all crashing cases I knew about work fine now.

Many thanks to all of you involved in solving this issues.

I'll be pushing this into maint in a moment.
Does it mean there is a chance to see this fix in 5.10.1?

Yes, it'll be in 5.10.1

--
Dave's first rule of Opera​:
If something needs saying, say it​: don't warble it.

@p5pRT
Copy link
Author

p5pRT commented Aug 6, 2009

From @csjewell

On Thu, 06 Aug 2009 16​:48 +0100, "Dave Mitchell" <davem@​iabyn.com>
wrote​:

On Wed, Aug 05, 2009 at 12​:42​:12PM -0700, kmx via RT wrote​:

Hi,

The real issue is that in perl_clone_using(), it frees the ptr_table
*before* calling the CLONE methods.

With b0b93b3, I've fixed
perl_clone_using() to free it afterwards; then I've backed out the
win32/perlhost.h change.

I have build perl/Win32 (using mingw) from blead with the
above-mentioned patch and all crashing cases I knew about work fine now.

Many thanks to all of you involved in solving this issues.

I'll be pushing this into maint in a moment.
Does it mean there is a chance to see this fix in 5.10.1?

Yes, it'll be in 5.10.1

and it works in the Perl that was tagged 5.10.1 RC1​:

C​:\NewFolder>\perl\bin\perl.exe -e "use namespace​::clean; fork; print
qq{1\n}";"
1
1

(test.pl being the script used in perl rt# 66158)

C​:\NewFolder>\perl\bin\perl test.pl
After fork 1​: 5524
After fork 2​: -6120

The Perl in question?

(I just compiled this from
http​://perl5.git.perl.org/perl.git/snapshot/d79203520c4254550b36937dae4d767b6a21d93d.tar.gz,
which was gotten from
http​://perl5.git.perl.org/perl.git/shortlog/refs/heads/maint-5.10, which
means whatever I got from the snapshot link is just a little "off" in
the reporting on the first line below. But it DID work! I also attached
my (passing) smoke report [which is warped the same way], since I don't
have a mailer set up for Test​::Smoke - my smtp server is
TLS-highly-preferred and authenticated-use-only. [There are other
receiving smtp servers.])

Summary of my perl5 (revision 5 version 10 subversion 1 patch maint-5.10
2009-08-06.00​:19​:12 d792035
GitLive-blead-1787-ga0db33f) configuration​:
  Snapshot of​: d792035
  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
  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 -DHAVE_DES_FCRYPT
  -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -fno-strict-aliasing
  -DPERL_MSVCRT_READFIX',
  optimize='-s -O2',
  cppflags='-DWIN32'
  ccversion='', gccversion='3.4.5', 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​:\perl\lib\CORE" -L"C​:\MinGW\lib"'
  libpth=C​:\MinGW\lib
  libs= -lmsvcrt -lmoldname -lkernel32 -luser32 -lgdi32 -lwinspool
  -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -lnetapi32 -luuid
  -lws2_32 -lmpr -lwinmm -lversion -lodbc32 -lodbccp32
  perllibs= -lmsvcrt -lmoldname -lkernel32 -luser32 -lgdi32 -lwinspool
  -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -lnetapi32 -luuid
  -lws2_32 -lmpr -lwinmm -lversion -lodbc32 -lodbccp32
  libc=-lmsvcrt, so=dll, useshrplib=true, libperl=libperl510.a
  gnulibc_version=''
  Dynamic Linking​:
  dlsrc=dl_win32.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' '
  cccdlflags=' ', lddlflags='-mdll -s -L"c​:\perl\lib\CORE"
  -L"C​:\MinGW\lib"'

Characteristics of this binary (from libperl)​:
  Compile-time options​: MULTIPLICITY PERL_DONT_CREATE_GVSV
  PERL_IMPLICIT_CONTEXT PERL_IMPLICIT_SYS
  PERL_MALLOC_WRAP PL_OP_SLAB_ALLOC USE_ITHREADS
  USE_LARGE_FILES USE_PERLIO
  Locally applied patches​:
  RC1
  Built under MSWin32
  Compiled at Aug 6 2009 09​:37​:08
  @​INC​:
  C​:/perl/lib
  C​:/perl/site/lib
  .

Automated smoke report for 5.10.1 patch
d792035 blead-1787-ga0db33f
NEWGUY​: Intel(R) Pentium(R) D CPU 2.66GHz(~2660 MHz) (x86/2 cpu)
  on MSWin32 - WinXP/.Net SP3
  using gcc version 3.4.5
  smoketime 6 hours 32 minutes (average 49 minutes 4 seconds)

Summary​: PASS

O = OK F = Failure(s), extended report at the bottom
X = Failure(s) under TEST but not under harness
? = still running or test results not (yet) available
Build failures during​: - = unknown or N/A
c = Configure, m = make, M = make (after miniperl), t = make test-prep

blead-1787-ga0db33f Configuration (common) none
----------- ---------------------------------------------------------
O O
O O -Duselargefiles
O O -Duseithreads
O O -Duseithreads -Duselargefiles
| +--------- -DDEBUGGING
+----------- no debugging

Locally applied patches​:
  RC1
  SMOKEd79203520c4254550b36937dae4d767b6a21d93d

Compiler messages(gcc)​:
Bzip2.xs​: In function `GetErrorString'​:
Bzip2.xs​:136​: warning​: unused variable `Perl___notused'
Bzip2.xs​: In function `deRef'​:
Bzip2.xs​:266​: warning​: unused variable `Perl___notused'
Bzip2.xs​: In function `deRef_l'​:
Bzip2.xs​:300​: warning​: unused variable `Perl___notused'
Bzip2.c​: In function `XS_Compress__Raw__Bzip2_constant'​:
Bzip2.c​:401​: warning​: unused variable `Perl___notused'
Bzip2.c​: In function `XS_Compress__Raw__Bzip2_bzlibversion'​:
Bzip2.c​:513​: warning​: unused variable `Perl___notused'
Bzip2.c​: In function `XS_Compress__Raw__Bzip2_new'​:
Bzip2.c​:534​: warning​: unused variable `Perl___notused'
Bzip2.c​: In function `XS_Compress__Raw__Bunzip2_new'​:
Bzip2.c​:633​: warning​: unused variable `Perl___notused'
Bzip2.c​: In function `XS_Compress__Raw__Bzip2_DispStream'​:
Bzip2.c​:739​: warning​: unused variable `Perl___notused'
Bzip2.c​: In function `XS_Compress__Raw__Bzip2_bzdeflate'​:
Bzip2.c​:777​: warning​: unused variable `Perl___notused'
Bzip2.c​: In function `XS_Compress__Raw__Bzip2_DESTROY'​:
Bzip2.c​:869​: warning​: unused variable `Perl___notused'
Bzip2.c​: In function `XS_Compress__Raw__Bzip2_bzclose'​:
Bzip2.c​:899​: warning​: unused variable `Perl___notused'
Bzip2.c​: In function `XS_Compress__Raw__Bzip2_bzflush'​:
Bzip2.c​:985​: warning​: unused variable `Perl___notused'
Bzip2.c​: In function `XS_Compress__Raw__Bzip2_total_in_lo32'​:
Bzip2.c​:1073​: warning​: unused variable `Perl___notused'
Bzip2.c​: In function `XS_Compress__Raw__Bzip2_total_out_lo32'​:
Bzip2.c​:1105​: warning​: unused variable `Perl___notused'
Bzip2.c​: In function `XS_Compress__Raw__Bzip2_compressedBytes'​:
Bzip2.c​:1137​: warning​: unused variable `Perl___notused'
Bzip2.c​: In function `XS_Compress__Raw__Bzip2_uncompressedBytes'​:
Bzip2.c​:1169​: warning​: unused variable `Perl___notused'
Bzip2.c​: In function `XS_Compress__Raw__Bunzip2_DispStream'​:
Bzip2.c​:1201​: warning​: unused variable `Perl___notused'
Bzip2.c​: In function `XS_Compress__Raw__Bunzip2_bzinflate'​:
Bzip2.c​:1239​: warning​: unused variable `Perl___notused'
Bzip2.c​: In function `XS_Compress__Raw__Bunzip2_inflateCount'​:
Bzip2.c​:1393​: warning​: unused variable `Perl___notused'
Bzip2.c​: In function `XS_Compress__Raw__Bunzip2_DESTROY'​:
Bzip2.c​:1425​: warning​: unused variable `Perl___notused'
Bzip2.c​: In function `XS_Compress__Raw__Bunzip2_status'​:
Bzip2.c​:1455​: warning​: unused variable `Perl___notused'
Bzip2.c​: In function `XS_Compress__Raw__Bunzip2_total_in_lo32'​:
Bzip2.c​:1487​: warning​: unused variable `Perl___notused'
Bzip2.c​: In function `XS_Compress__Raw__Bunzip2_total_out_lo32'​:
Bzip2.c​:1519​: warning​: unused variable `Perl___notused'
Bzip2.c​: In function `XS_Compress__Raw__Bunzip2_compressedBytes'​:
Bzip2.c​:1551​: warning​: unused variable `Perl___notused'
Bzip2.c​: In function `XS_Compress__Raw__Bunzip2_uncompressedBytes'​:
Bzip2.c​:1583​: warning​: unused variable `Perl___notused'
Bzip2.c​: In function `boot_Compress__Raw__Bzip2'​:
Bzip2.c​:1617​: warning​: unused variable `Perl___notused'
perlhost.h​: In function `CPerlHost* IPerlMem2Host(IPerlMem*)'​:
perlhost.h​:247​: warning​: invalid access to non-static data member
`CPerlHost​::m_hostperlMem' of NULL object
perlhost.h​:247​: warning​: (perhaps the `offsetof' macro was used
incorrectly)
perlhost.h​: In function `CPerlHost* IPerlMemShared2Host(IPerlMem*)'​:
perlhost.h​:252​: warning​: invalid access to non-static data member
`CPerlHost​::m_hostperlMemShared' of NULL object
perlhost.h​:252​: warning​: (perhaps the `offsetof' macro was used
incorrectly)
perlhost.h​: In function `CPerlHost* IPerlMemParse2Host(IPerlMem*)'​:
perlhost.h​:257​: warning​: invalid access to non-static data member
`CPerlHost​::m_hostperlMemParse' of NULL object
perlhost.h​:257​: warning​: (perhaps the `offsetof' macro was used
incorrectly)
perlhost.h​: In function `CPerlHost* IPerlEnv2Host(IPerlEnv*)'​:
perlhost.h​:262​: warning​: invalid access to non-static data member
`CPerlHost​::m_hostperlEnv' of NULL object
perlhost.h​:262​: warning​: (perhaps the `offsetof' macro was used
incorrectly)
perlhost.h​: In function `CPerlHost* IPerlStdIO2Host(IPerlStdIO*)'​:
perlhost.h​:267​: warning​: invalid access to non-static data member
`CPerlHost​::m_hostperlStdIO' of NULL object
perlhost.h​:267​: warning​: (perhaps the `offsetof' macro was used
incorrectly)
perlhost.h​: In function `CPerlHost* IPerlLIO2Host(IPerlLIO*)'​:
perlhost.h​:272​: warning​: invalid access to non-static data member
`CPerlHost​::m_hostperlLIO' of NULL object
perlhost.h​:272​: warning​: (perhaps the `offsetof' macro was used
incorrectly)
perlhost.h​: In function `CPerlHost* IPerlDir2Host(IPerlDir*)'​:
perlhost.h​:277​: warning​: invalid access to non-static data member
`CPerlHost​::m_hostperlDir' of NULL object
perlhost.h​:277​: warning​: (perhaps the `offsetof' macro was used
incorrectly)
perlhost.h​: In function `CPerlHost* IPerlSock2Host(IPerlSock*)'​:
perlhost.h​:282​: warning​: invalid access to non-static data member
`CPerlHost​::m_hostperlSock' of NULL object
perlhost.h​:282​: warning​: (perhaps the `offsetof' macro was used
incorrectly)
perlhost.h​: In function `CPerlHost* IPerlProc2Host(IPerlProc*)'​:
perlhost.h​:287​: warning​: invalid access to non-static data member
`CPerlHost​::m_hostperlProc' of NULL object
perlhost.h​:287​: warning​: (perhaps the `offsetof' macro was used
incorrectly)
Bzip2.xs​:136​: warning​: unused variable `my_perl'
Bzip2.xs​:266​: warning​: unused variable `my_perl'
Bzip2.xs​:300​: warning​: unused variable `my_perl'

--
Report by Test​::Smoke v1.39 build 1235 running on perl 5.10.0
(Reporter v0.035 / Smoker v0.044)
--
Curtis Jewell
swordsman@​csjewell.fastmail.us

%DCL-E-MEM-BAD, bad memory
-VMS-F-PDGERS, pudding between the ears

[I use PC-Alpine, which deliberately does not display colors and pictures in HTML mail]

@p5pRT
Copy link
Author

p5pRT commented Aug 6, 2009

From @csjewell

If I didn't say so earlier, thanks for getting this fix into 5.10.1 to
everyone involved!
--
Curtis Jewell
swordsman@​csjewell.fastmail.us

%DCL-E-MEM-BAD, bad memory
-VMS-F-PDGERS, pudding between the ears

[I use PC-Alpine, which deliberately does not display colors and pictures in HTML mail]

@p5pRT
Copy link
Author

p5pRT commented Aug 6, 2009

From @demerphq

2009/8/6 Curtis Jewell <lists.perl.perl5-porters@​csjewell.fastmail.us>​:

On Thu, 06 Aug 2009 16​:48 +0100, "Dave Mitchell" <davem@​iabyn.com>
wrote​:

On Wed, Aug 05, 2009 at 12​:42​:12PM -0700, kmx via RT wrote​:

Hi,

The real issue is that in perl_clone_using(), it frees the ptr_table
*before* calling the CLONE methods.

With b0b93b3, I've fixed
perl_clone_using() to free it afterwards; then I've backed out the
win32/perlhost.h change.

I have build perl/Win32 (using mingw) from blead with the
above-mentioned patch and all crashing cases I knew about work fine now.

Many thanks to all of you involved in solving this issues.

I'll be pushing this into maint in a moment.
Does it mean there is a chance to see this fix in 5.10.1?

Yes, it'll be in 5.10.1

and it works in the Perl that was tagged 5.10.1 RC1​:

C​:\NewFolder>\perl\bin\perl.exe -e "use namespace​::clean; fork; print
qq{1\n}";"
1
1

(test.pl being the script used in perl rt# 66158)

C​:\NewFolder>\perl\bin\perl test.pl
After fork 1​: 5524
After fork 2​: -6120

The Perl in question?

(I just compiled this from
http​://perl5.git.perl.org/perl.git/snapshot/d79203520c4254550b36937dae4d767b6a21d93d.tar.gz,
which was gotten from
http​://perl5.git.perl.org/perl.git/shortlog/refs/heads/maint-5.10, which
means whatever I got from the snapshot link is just a little "off" in
the reporting on the first line below. But it DID work! I also attached
my (passing) smoke report [which is warped the same way], since I don't
have a mailer set up for Test​::Smoke - my smtp server is
TLS-highly-preferred and authenticated-use-only. [There are other
receiving smtp servers.])

Summary of my perl5 (revision 5 version 10 subversion 1 patch maint-5.10
2009-08-06.00​:19​:12 d792035
GitLive-blead-1787-ga0db33f) configuration​:

Hrm, this is a bug by me. I have to fix that. (Note the tag doesnt
match the sha1)

Yves

--
perl -Mre=debug -e "/just|another|perl|hacker/"

@p5pRT
Copy link
Author

p5pRT commented Aug 6, 2009

From @demerphq

2009/8/6 demerphq <demerphq@​gmail.com>​:

Summary of my perl5 (revision 5 version 10 subversion 1 patch maint-5.10
2009-08-06.00​:19​:12 d792035
GitLive-blead-1787-ga0db33f) configuration​:

Hrm, this is a bug by me. I have to fix that. (Note the tag doesnt
match the sha1)

Fixed. It should have said​:

maint-5.10 2009-08-06.00​:19​:12
d792035 perl-5.10.1-RC1

Yves

--
perl -Mre=debug -e "/just|another|perl|hacker/"

@p5pRT
Copy link
Author

p5pRT commented Aug 6, 2009

From @csjewell

On Thu, 06 Aug 2009 19​:04 +0200, "demerphq" <demerphq@​gmail.com> wrote​:

2009/8/6 demerphq <demerphq@​gmail.com>​:

Summary of my perl5 (revision 5 version 10 subversion 1 patch maint-5.10
2009-08-06.00​:19​:12 d792035
GitLive-blead-1787-ga0db33f) configuration​:

Hrm, this is a bug by me. I have to fix that. (Note the tag doesnt
match the sha1)

Fixed. It should have said​:

maint-5.10 2009-08-06.00​:19​:12
d792035 perl-5.10.1-RC1

Yves

I thought the tag at the end looked funny. (I did download it BEFORE it
got tagged, but it still should have given a describetag based on
maint-5.10, not on blead.)

--Curtis
--
Curtis Jewell
swordsman@​csjewell.fastmail.us

%DCL-E-MEM-BAD, bad memory
-VMS-F-PDGERS, pudding between the ears

[I use PC-Alpine, which deliberately does not display colors and pictures in HTML mail]

@p5pRT
Copy link
Author

p5pRT commented Aug 6, 2009

From @kmx

Yes, it'll be in 5.10.1
That is great.

Once again many thanks for this "last-minute-before-5.10.1-patch" to all
contributors.

--
kmx

@p5pRT
Copy link
Author

p5pRT commented Aug 6, 2009

From @demerphq

2009/8/6 Curtis Jewell <lists.perl.perl5-porters@​csjewell.fastmail.us>​:

On Thu, 06 Aug 2009 19​:04 +0200, "demerphq" <demerphq@​gmail.com> wrote​:

2009/8/6 demerphq <demerphq@​gmail.com>​:

Summary of my perl5 (revision 5 version 10 subversion 1 patch maint-5.10
2009-08-06.00​:19​:12 d792035
GitLive-blead-1787-ga0db33f) configuration​:

Hrm, this is a bug by me. I have to fix that. (Note the tag doesnt
match the sha1)

Fixed. It should have said​:

maint-5.10 2009-08-06.00​:19​:12
d792035 perl-5.10.1-RC1

Yves

I thought the tag at the end looked funny. (I did download it BEFORE it
got tagged, but it still should have given a describetag based on
maint-5.10, not on blead.)

Yes right, that was the bug.

Yves

--
perl -Mre=debug -e "/just|another|perl|hacker/"

@p5pRT
Copy link
Author

p5pRT commented Aug 6, 2009

From @iabyn

Now fixed in 5.10.1

@p5pRT
Copy link
Author

p5pRT commented Aug 6, 2009

@iabyn - Status changed from 'open' to 'resolved'

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

No branches or pull requests

1 participant