From owner-freebsd-sparc64@FreeBSD.ORG Wed Jul 30 06:06:58 2003 Return-Path: Delivered-To: freebsd-sparc64@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C507937B401 for ; Wed, 30 Jul 2003 06:06:58 -0700 (PDT) Received: from tts.orel.ru (tts.orel.ru [213.59.64.67]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3B90F43FA3 for ; Wed, 30 Jul 2003 06:06:56 -0700 (PDT) (envelope-from bel@orel.ru) Received: from orel.ru (lg.orel.ru [195.90.189.89]) by tts.orel.ru (8.12.6/8.12.6/bel) with ESMTP id h6UD6n0A024949 for ; Wed, 30 Jul 2003 17:06:53 +0400 Message-ID: <3F27C2EB.2030809@orel.ru> Date: Wed, 30 Jul 2003 17:06:51 +0400 From: Andrew Belashov Organization: ORIS User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.3) Gecko/20030411 X-Accept-Language: ru, en-us, en MIME-Version: 1.0 To: freebsd-sparc64@freebsd.org References: <3F210BF6.6070001@orel.ru> <20030725153258.GE10708@funkthat.com> <3F27A5DB.2050601@orel.ru> In-Reply-To: <3F27A5DB.2050601@orel.ru> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Subject: fork&Perl BUG X-BeenThere: freebsd-sparc64@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Porting FreeBSD to the Sparc List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Jul 2003 13:06:59 -0000 I modified Perl by adding sleep() in child after fork(): -------------------------------------------------------------- --- pp_sys.c.orig Fri Apr 6 08:38:46 2001 +++ pp_sys.c Wed Jul 30 16:23:39 2003 @@ -3700,6 +3700,8 @@ RETSETUNDEF; if (!childpid) { /*SUPPRESS 560*/ + /* CHILD */ + sleep(60); if ((tmpgv = gv_fetchpv("$", TRUE, SVt_PV))) sv_setiv(GvSV(tmpgv), (IV)PerlProc_getpid()); hv_clear(PL_pidstatus); /* no kids, so don't wait for 'em */ -------------------------------------------------------------- and running test script: -------------------------------------------------------------- bel@trash$ /usr/ports/lang/perl5.debug/work/perl-5.6.1/perl \ perlbug.pl 80000 ................................................................................ Main: sum = 39952.6836460792, cnt = 80000 Child pid = 90078 Parent working... Parent: sum = 39952.6836460792, cnt = 80000 Parent waiting a child... Parent exiting... Parent exiting... -------------------------------------------------------------- Wow! Child printing "Parent exiting..."! Its like as: kernel unblock fork() in parent before end of duplicating memory to child!