Perl / perl5

🐪 The Perl programming language
https://dev.perl.org/perl5/
Other
1.99k stars 559 forks source link

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

Closed p5pRT closed 15 years ago

p5pRT commented 15 years ago

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

Searchable as RT66158$

p5pRT commented 15 years ago

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<
p5pRT commented 15 years ago

From bitcard@profvince.com

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​: } ***

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 commented 15 years ago

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

p5pRT commented 15 years ago

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 commented 15 years ago

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 commented 15 years ago

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@&#8203;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 commented 15 years ago

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@&#8203;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 commented 15 years ago

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 commented 15 years ago

From @csjewell

On Tue\, 04 Aug 2009 23​:46 +0100\, "Dave Mitchell" \davem@&#8203;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 commented 15 years ago

From @csjewell

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

----- Original message ----- From​: "Curtis Jewell" \perl@&#8203;csjewell\.fastmail\.us To​: "Dave Mitchell" \davem@&#8203;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@&#8203;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 commented 15 years ago

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 commented 15 years ago

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 commented 15 years ago

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 46a76da79aa70ae5c77ffe23d8c6e303c7c67ce2 Author​: David Mitchell \davem@&#8203;iabyn\.com AuthorDate​: Wed Aug 5 14​:18​:37 2009 +0100 Commit​: David Mitchell \davem@&#8203;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 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 240bfeb992996de28603a7f9e3ee34ecc6e3f286 Author​: David Mitchell \davem@&#8203;iabyn\.com AuthorDate​: Wed Aug 5 14​:20​:29 2009 +0100 Commit​: David Mitchell \davem@&#8203;iabyn\.com 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 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 commented 15 years ago

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 commented 15 years ago

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 b0b93b3c773176a99136baa97661d11503277415\, 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 commented 15 years ago

From @kmx

Hi\,

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

With b0b93b3c773176a99136baa97661d11503277415\, 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 commented 15 years ago

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 b0b93b3c773176a99136baa97661d11503277415\, 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 commented 15 years ago

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 d79203520c4254550b36937dae4d767b6a21d93d snapshot)

--Curtis

p5pRT commented 15 years ago

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 b0b93b3c773176a99136baa97661d11503277415\, 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 commented 15 years ago

From @csjewell

On Thu\, 06 Aug 2009 16​:48 +0100\, "Dave Mitchell" \davem@&#8203;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 b0b93b3c773176a99136baa97661d11503277415\, 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 d79203520c4254550b36937dae4d767b6a21d93d GitLive-blead-1787-ga0db33f) configuration​:   Snapshot of​: d79203520c4254550b36937dae4d767b6a21d93d   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 d79203520c4254550b36937dae4d767b6a21d93d 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 commented 15 years ago

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 commented 15 years ago

From @demerphq

2009/8/6 Curtis Jewell \lists\.perl\.perl5\-porters@&#8203;csjewell\.fastmail\.us​:

On Thu\, 06 Aug 2009 16​:48 +0100\, "Dave Mitchell" \davem@&#8203;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 b0b93b3c773176a99136baa97661d11503277415\, 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 d79203520c4254550b36937dae4d767b6a21d93d 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 commented 15 years ago

From @demerphq

2009/8/6 demerphq \demerphq@&#8203;gmail\.com​:

Summary of my perl5 (revision 5 version 10 subversion 1 patch maint-5.10 2009-08-06.00​:19​:12 d79203520c4254550b36937dae4d767b6a21d93d 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 d79203520c4254550b36937dae4d767b6a21d93d perl-5.10.1-RC1

Yves

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

p5pRT commented 15 years ago

From @csjewell

On Thu\, 06 Aug 2009 19​:04 +0200\, "demerphq" \demerphq@&#8203;gmail\.com wrote​:

2009/8/6 demerphq \demerphq@&#8203;gmail\.com​:

Summary of my perl5 (revision 5 version 10 subversion 1 patch maint-5.10 2009-08-06.00​:19​:12 d79203520c4254550b36937dae4d767b6a21d93d 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 d79203520c4254550b36937dae4d767b6a21d93d 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 commented 15 years ago

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 commented 15 years ago

From @demerphq

2009/8/6 Curtis Jewell \lists\.perl\.perl5\-porters@&#8203;csjewell\.fastmail\.us​:

On Thu\, 06 Aug 2009 19​:04 +0200\, "demerphq" \demerphq@&#8203;gmail\.com wrote​:

2009/8/6 demerphq \demerphq@&#8203;gmail\.com​:

Summary of my perl5 (revision 5 version 10 subversion 1 patch maint-5.10 2009-08-06.00​:19​:12 d79203520c4254550b36937dae4d767b6a21d93d 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 d79203520c4254550b36937dae4d767b6a21d93d 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 commented 15 years ago

From @iabyn

Now fixed in 5.10.1

p5pRT commented 15 years ago

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