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
Comments
From @kmxHi, the following script: *** crashes during "fork" call on win32/strawberry perl 5.10.0.4 & 5.10.0.5 On Win32 Active state perl 5.10 the program (fork call) does not work The same script works fine on win32/strawberry perl 5.8.9.0 & 5.8.9.1 - To be honest I am not sure if this is a bug in Variable::Magic or perl Here is some debug info about the crash point: (gdb) run test.pl Perl Info
|
From bitcard@profvince.com
For kmx: cc'ing the progress to the p5p list. For p5p: This is a cross report of I think this can be fixed by making PerlProcFork() call Does someone know why perl_clone_using() is called here without this Vincent. |
The RT System itself - Status changed from 'new' to 'open' |
From @kmxHi, could you please confirm or reject this issue as a bug in fork I would appreciate if somebody could test whether the same behaviour This simple script kills Win32 perl 5.10.0 use Variable::Magic 'wizard'; -- |
From @kmxHi, I have investigated this issue further and found out that it is present Based on Vicent's post above I have tried this patch to win32/perlhost.h - PerlInterpreter *new_perl = perl_clone_using((PerlInterpreter*)aTHX, 1, and IT SOLVES the described fork issue but I am not able to say that I would appreciate any feedback. -- |
From @csjewellCan I request that this fix (or a better-implemented fix for this bug) I'm given to understand (talk to kmx about that to be sure) that this --Curtis Jewell Mon, 03 Aug 2009 07:03 -0700, "kmx via RT" <perlbug-followup@perl.org>
%DCL-E-MEM-BAD, bad memory [I use PC-Alpine, which deliberately does not display colors and pictures in HTML mail] |
From @iabynOn Tue, Aug 04, 2009 at 03:49:29PM -0600, Curtis Jewell wrote:
I would be extremely reluctant to put this in RC1, and if it's not in RC1,
So if I understand it correctly, Variable::Magic has been made to work The thing that puzzles me is that is doesn't explode on 5.8.x. -- |
From @kmx
-- |
From @csjewellOn Tue, 04 Aug 2009 23:46 +0100, "Dave Mitchell" <davem@iabyn.com>
I can understand that. I wouldn't want to take a patch that low-level in And I have to admit that I would prefer that Catalyst not have the Would it help if I ran a smoker over perl with that patch, and if so, --Curtis %DCL-E-MEM-BAD, bad memory [I use PC-Alpine, which deliberately does not display colors and pictures in HTML mail] |
From @csjewell(forgot to use my outbound to-list address when sending it out ----- Original message ----- On Tue, 04 Aug 2009 23:46 +0100, "Dave Mitchell" <davem@iabyn.com>
I can understand that. I wouldn't want to take a patch that low-level in And I have to admit that I would prefer that Catalyst not have the Would it help if I ran a smoker over perl with that patch, and if so, --Curtis %DCL-E-MEM-BAD, bad memory [I use PC-Alpine, which deliberately does not display colors and -- %DCL-E-MEM-BAD, bad memory [I use PC-Alpine, which deliberately does not display colors and pictures in HTML mail] |
From perl@profvince.com
Yes, exactly. Variable::Magic stores coderefs in a thread local context.
I've no idea about why it works with 5.8, nor why the pointer table is Vincent. |
From perl@profvince.comCC-ing the list.
Yes, exactly. Variable::Magic stores coderefs in a thread local context.
I've no idea about why it works with 5.8, nor why the pointer table is Vincent. |
From @iabynOn Wed, Aug 05, 2009 at 03:16:05PM +0200, Vincent Pit wrote:
That was a change to threads.xs a while ago. Originally neither kept the Anyway, I've caved in and applied the following to commits (the first is commit 46a76da win32/perlhost.h: use symbolic constant Affected files ... Differences ... Inline Patchdiff --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,
add CLONEf_KEEP_PTR_TABLE to win fork emulation. Affected files ... Differences ... Inline Patchdiff --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 |
From perl@profvince.comThanks for this.
Now I know why it doesn't crash on 5.8 : I explicitely disabled
threads.pm manually destroys the pointer table after the new interpreter Vincent. |
From @iabynOn Wed, Aug 05, 2009 at 04:02:54PM +0200, Vincent Pit wrote:
Ah, the penny drops! The real issue is that in perl_clone_using(), it frees the ptr_table With b0b93b3, I've fixed I'll be pushing this into maint in a moment. I wonder: for existing 5.10.0 users, whether Variable::Magic could -- |
From @kmxHi,
I have build perl/Win32 (using mingw) from blead with the Many thanks to all of you involved in solving this issues.
-- |
From @iabynOn Wed, Aug 05, 2009 at 03:33:34PM +0100, Dave Mitchell wrote:
PS can someone confirm ASAP that GitLive-maint-5.10-1727-g02784d7 or later Thanks. -- |
From @csjewellOn Wed Aug 05 14:01:26 2009, davem wrote:
Can you live with ASAP == between 12 and 24 hours? I'm not at the (speaking of which, I ran a 4-build gcc smoker (-DDEBUGGING and --Curtis |
From @iabynOn Wed, Aug 05, 2009 at 12:42:12PM -0700, kmx via RT wrote:
Yes, it'll be in 5.10.1 -- |
From @csjewellOn Thu, 06 Aug 2009 16:48 +0100, "Dave Mitchell" <davem@iabyn.com>
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 (test.pl being the script used in perl rt# 66158) C:\NewFolder>\perl\bin\perl test.pl The Perl in question? (I just compiled this from Summary of my perl5 (revision 5 version 10 subversion 1 patch maint-5.10 Characteristics of this binary (from libperl): Automated smoke report for 5.10.1 patch Summary: PASS O = OK F = Failure(s), extended report at the bottom blead-1787-ga0db33f Configuration (common) none Locally applied patches: Compiler messages(gcc): -- %DCL-E-MEM-BAD, bad memory [I use PC-Alpine, which deliberately does not display colors and pictures in HTML mail] |
From @csjewellIf I didn't say so earlier, thanks for getting this fix into 5.10.1 to %DCL-E-MEM-BAD, bad memory [I use PC-Alpine, which deliberately does not display colors and pictures in HTML mail] |
From @demerphq2009/8/6 Curtis Jewell <lists.perl.perl5-porters@csjewell.fastmail.us>:
Hrm, this is a bug by me. I have to fix that. (Note the tag doesnt Yves -- |
From @demerphq2009/8/6 demerphq <demerphq@gmail.com>:
Fixed. It should have said: maint-5.10 2009-08-06.00:19:12 Yves -- |
From @csjewellOn Thu, 06 Aug 2009 19:04 +0200, "demerphq" <demerphq@gmail.com> wrote:
I thought the tag at the end looked funny. (I did download it BEFORE it --Curtis %DCL-E-MEM-BAD, bad memory [I use PC-Alpine, which deliberately does not display colors and pictures in HTML mail] |
From @kmx
Once again many thanks for this "last-minute-before-5.10.1-patch" to all -- |
From @demerphq2009/8/6 Curtis Jewell <lists.perl.perl5-porters@csjewell.fastmail.us>:
Yes right, that was the bug. Yves -- |
From @iabynNow fixed in 5.10.1 |
@iabyn - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#66158 (status was 'resolved')
Searchable as RT66158$
The text was updated successfully, but these errors were encountered: