develooper Front page | perl.perl5.porters | Postings from January 2019

Re: [perl #128227] perlbug AutoReply: vfork should be used forspawning external processes

Thread Next
From:
Eric Wong
Date:
January 28, 2019 09:23
Subject:
Re: [perl #128227] perlbug AutoReply: vfork should be used forspawning external processes
Message ID:
20190128091751.ru7is6vw52rdoxex@whir
> https://rt.perl.org/Ticket/Display.html?id=128227

Another note:

I hit ENOMEM when attempting to spawn one small subprocess from
a giant Perl process.  I had enough RAM for the small subprocess
(but not enough for a full fork of the giant Perl process).

The kernel could not know the fork() was for an execve() shortly
afterwards when preparing for CoW, so it bailed with ENOMEM on
fork().

Using posix_spawn (where glibc uses CLONE_VFORK behind-the-scenes)
or vfork for spawning subprocesses would've avoided this problem.

Thread Next


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