Proc::Fork on Windows

2007-12-19 Thread David Golden
On Dec 19, 2007 7:23 AM, A. Pagaltzis <[EMAIL PROTECTED]> wrote:
> I wish someone would help me fix Proc::Fork on Windows. I got
> two tickets about it and a bunch of Testers failures, but several
> attempts to make it work have failed and my repeated pleas have
> fallen on deaf ears.  :-)

I poked around with it a bit.  One think I noticed immediately is that
you have "-T" switches in your shebang lines on the test files.

As I've reported elsewhere, Perl on windows has what I call the
"taint-fork bug" -- forking while under taint just segfaults.

  > perl -Te fork

It still segfaulted on the 01-real.t test, but it does so after the
fork when calling the anonymous subroutines instead of on the fork
itself.

With a little more poking around, the problem lies in your
modification of @_ and use of goto &_do_fork.  Changing the relevent
lines to

  my @args = @{ $config}{ qw( parent child error retry ) };
  undef $config;
  _do_fork(@args);

passes all tests.  You lose the nice callstack, but it doesn't
segfault.  I'm guessing that's really an issue with goto and
pseudoforks or threads on Windows.

(As an aside, I did try it with Sub::Uplevel and it ran the child
branch bug segfaulted calling the parent branch -- not sure why.)

Regards,
David


Re: Proc::Fork on Windows

2007-12-19 Thread A. Pagaltzis
Hi David,

thanks for taking a gander!

* David Golden <[EMAIL PROTECTED]> [2007-12-19 16:35]:
> As I've reported elsewhere, Perl on windows has what I call the
> "taint-fork bug" -- forking while under taint just segfaults.

Ugh.

> With a little more poking around, the problem lies in your
> modification of @_ and use of goto &_do_fork.

That was a desperate guess; the previous version just returned
the $config hash and used DESTROY to trigger the fork when it
went out of scope. I blindly guessed that object destruction
across threads might be causing the problem, so I tried to get
rid of the hash before the fork.

> Changing the relevent lines to
> 
>   my @args = @{ $config}{ qw( parent child error retry ) };
>   undef $config;
>   _do_fork(@args);
> 
> passes all tests. You lose the nice callstack, but it doesn't
> segfault. I'm guessing that's really an issue with goto and
> pseudoforks or threads on Windows.

Does it continue to pass if you replace the first line with

my ( $p, $c, $e, $r ) = @{ $config }{ qw( parent child error retry ) };

and then inline the body of `_do_fork`?

(Logically, it should, but this utterly undebuggable problem has
made me a bit superstitious…)

Regards,
-- 
Aristotle Pagaltzis // 


Re: Proc::Fork on Windows

2007-12-19 Thread David Golden
On Dec 19, 2007 11:03 AM, A. Pagaltzis <[EMAIL PROTECTED]> wrote:
> Does it continue to pass if you replace the first line with
>
> my ( $p, $c, $e, $r ) = @{ $config }{ qw( parent child error retry ) };
>
> and then inline the body of `_do_fork`?
>
> (Logically, it should, but this utterly undebuggable problem has
> made me a bit superstitious…)

It looks like it does (as long as you remove the "-T" from the shebang
in 01.real.t.

David


Re: Proc::Fork on Windows

2007-12-19 Thread Andy Armstrong

On 19 Dec 2007, at 16:25, David Golden wrote:

(Logically, it should, but this utterly undebuggable problem has
made me a bit superstitious…)


It looks like it does (as long as you remove the "-T" from the shebang
in 01.real.t.



This is good - I can stop messing around trying to make a debug build  
of Vanilla :)


--
Andy Armstrong, Hexten






Re: Proc::Fork on Windows

2007-12-21 Thread Christopher H. Laco
A. Pagaltzis wrote:
> * David Golden <[EMAIL PROTECTED]> [2007-12-19 17:30]:
>> It looks like it does (as long as you remove the "-T" from the
>> shebang in 01.real.t.
> 
> Anyone with Windows who cares to, please bang on
> http://plasmasturm.org/attic/Proc-Fork-0.5.tar.gz
> before I send it to the CPAN.
> 
> Thanks again for tracking this down, David.
> 
> Regards,

All tests pass: Strawberry Perl 5.8.8/XP

-=Chris



signature.asc
Description: OpenPGP digital signature


Re: Proc::Fork on Windows

2007-12-21 Thread A. Pagaltzis
* David Golden <[EMAIL PROTECTED]> [2007-12-19 17:30]:
> It looks like it does (as long as you remove the "-T" from the
> shebang in 01.real.t.

Anyone with Windows who cares to, please bang on
http://plasmasturm.org/attic/Proc-Fork-0.5.tar.gz
before I send it to the CPAN.

Thanks again for tracking this down, David.

Regards,
-- 
Aristotle Pagaltzis // 


Re: Proc::Fork on Windows

2007-12-21 Thread A. Pagaltzis
* Christopher H. Laco <[EMAIL PROTECTED]> [2007-12-21 18:40]:
> All tests pass: Strawberry Perl 5.8.8/XP

Thanks Chris. On its way.

Regards,
-- 
Aristotle Pagaltzis // 


Re: Proc::Fork on Windows

2007-12-21 Thread David Golden
On Dec 21, 2007 12:32 PM, A. Pagaltzis <[EMAIL PROTECTED]> wrote:
> Anyone with Windows who cares to, please bang on
> http://plasmasturm.org/attic/Proc-Fork-0.5.tar.gz
> before I send it to the CPAN.

Passes on Strawberry Perl 5.10.0 beta 2 as well.

David