develooper Front page | perl.perl5.porters | Postings from November 2013

[perl #21382] exit()/exec() crashes Perl after fork

From:
bulk88 via RT
Date:
November 25, 2013 06:40
Subject:
[perl #21382] exit()/exec() crashes Perl after fork
Message ID:
rt-4.0.18-12751-1385361604-171.21382-15-0@perl.org
To move this old ticket along

On Sat May 24 00:40:29 2003, Jens.Lippmann@t-mobile.de wrote:
> Hi
> 
> I cannot shrink the script, as soon as I remove a certain quantity
> of text the crash disappears.
> Well I admit that I use file IO quite extensively and keep file handles
> in memory, so that both parent and child refer to the same descriptors.
> BUT the child does not make use of those descriptors, it simply calls
> 'system("echo test") && exit'
> Immediately after the child exits Perl will crash.
> 
> I'm in an urgent need of a Perl Debug-Build because I can't afford the
> time to play catch-me with this bug.
> Any Perl that runs on Win32 and uses threads is welcome.
> My crash occurs with Indigo 5.6.1/5.8.0 as well as ActiveState 5.6.1.
> If someone can point me to a Win32 Perl development distribution I
> would be *greatly* relieved.
> 
> 
> -----Urspr√ľngliche Nachricht-----
> Von: Lippmann Jens,E2 
> Gesendet am: Donnerstag, 15. Mai 2003 18:50
> An: 'perlbug-followup@perl.org'
> Betreff: AW: [perl #21382] exit()/exec() crashes Perl after fork
> 
> 
> > > My pledge is to build up a FAQ topic (perldoc -q) for fork that helps
> > > out of this remedy, and to extend the fork/exec sections in the
> > > perlfuncs doc module, and to overhaul the notorious
> > >  'if ($pid = fork()) { ... } else { ... exec/exit; }'
> > > examples that are used throughout the perlipc doc.
> 
> > None of this has been done yet.  Is it all that necessary?  Has anyone
> > else found the need to have this documented in some way, somewhere?
> 
> I'm currently building up an extension to perlfaq8.pod
> top 'How do I start a process in the background?'.
> 

I dont think this patch will ever come since it is 2013. The text, in question, now has a disclaimer that fork/exec aren't the only way to background run.

-----------------------------------------------
=head2 How do I start a process in the background?

(contributed by brian d foy)

There's not a single way to run code in the background so you don't
have to wait for it to finish before your program moves on to other
tasks. Process management depends on your particular operating system,
and many of the techniques are in L<perlipc>.

Several CPAN modules may be able to help, including C<IPC::Open2> or
C<IPC::Open3>, C<IPC::Run>, C<Parallel::Jobs>,
C<Parallel::ForkManager>, C<POE>, C<Proc::Background>, and
C<Win32::Process>. There are many other modules you might use, so
check those namespaces for other options too.
-----------------------------------------------


> Later I'll try to narrow down my script in size to a
> sniplet that is able to reproduce the crash.
> Although it might be troublesome since the crash (race condition)
> seems to be related to the size of the process image.
> 

Is this a crash with 5.005 threads?

-- 
bulk88 ~ bulk88 at hotmail.com

---
via perlbug:  queue: perl5 status: open
https://rt.perl.org/Ticket/Display.html?id=21382



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