Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!newstop!exodus!appserv!slovax.Eng.Sun.COM!lm From: lm@slovax.Eng.Sun.COM (Larry McVoy) Newsgroups: comp.lang.perl Subject: perl & vfork on sparc machines Message-ID: <549@appserv.Eng.Sun.COM> Date: 19 Apr 91 18:01:50 GMT Sender: news@appserv.Eng.Sun.COM Reply-To: lm@sun.UUCP (Larry McVoy) Organization: Sun Microsystems, Mountain View Lines: 20 I was porting perl to an alpha copy of our next release of the OS and ran into the following problem. It is unlikely that you will see this, but just in case... In util.c, function mypopen(), there is a line like so: while ((pid = (doexec?vfork():fork())) < 0) The problem showed up when I compiled w/ the optimizer turned on. The bug is that the internal release did not have a copy of vfork.h which has a pragma that tells the compiler not to optimize around vfork()s (a vfork is quite similar to a longjmp and both have a nasty interactions with register allocations). The arg "mode" was in a register and it got stomped on by the child. The only reason I mention it is that you may run into the problem on some other risc that doesn't have vfork.h or calls it something else. Pretty unlikely, but you never know. --- Larry McVoy, Sun Microsystems (415) 336-7627 ...!sun!lm or lm@sun.com