Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Content-Disposition: inline Content-Transfer-Encoding: binary MIME-Version: 1.0 Cc: "Gerrit @ cygwin" , Perl 5 Porters Subject: Re: Cygwin /dev/null problem or perl 5.8.0 problem? (was: Re: autom4te and perl 5.8.0) In-Reply-To: <20020619233222.8ABA.H.M.BRAND@hccnet.nl> from H.Merijn Brand on Wed, 19 Jun 2002 23:35:44 +0200 References: <076601c217d6$d4405020$6132bc3e AT BABEL> <119964355610 DOT 20020619232858 AT familiehaase DOT de> <20020619233222 DOT 8ABA DOT H DOT M DOT BRAND AT hccnet DOT nl> Content-Type: text/plain; charset="UTF-8" To: h DOT m DOT brand AT hccnet DOT nl Message-Id: <20020620134305.15949.2@bactrian.elixent.com> Date: Thu, 20 Jun 2002 14:43:05 +0100 From: Nick Ing-Simmons Reply-To: Nick Ing-Simmons H.Merijn Brand writes: >On Wed 19 Jun 2002 23:28, "Gerrit P. Haase" wrote: >> Hallo Conrad, >> >> Am Mittwoch, 19. Juni 2002 um 23:18 schriebst du: >> >> > "Gerrit P. Haase" wrote: >> >> Segfaulting with perl 5.8.0 on Cygwin: >> >> use IO::File; >> my $out = new IO::File; >> $out->open("/dev/null", O_CREAT | O_WRONLY | O_TRUNC, 0666); >> It is a perl5.7+ problem of uncertain vintage. The root cause is fixed by: --- doio.c.ship Thu Jun 20 14:35:53 2002 +++ doio.c Thu Jun 20 14:14:27 2002 @@ -663,7 +663,10 @@ if (writing) { if (IoTYPE(io) == IoTYPE_SOCKET || (IoTYPE(io) == IoTYPE_WRONLY && fd >= 0 && S_ISCHR(PL_statbuf.st_mode)) ) { - mode[0] = 'w'; + char *s = mode; + if (*s == 'I' || *s == '#') + s++; + *s = 'w'; if (!(IoOFP(io) = PerlIO_openn(aTHX_ type,mode,fd,0,0,NULL,0,svp))) { PerlIO_close(fp); IoIFP(io) = Nullfp; Otherwise in this case "mode" is passed as "ww" rather than "#w", PerlIOBase_push objects and returns a NULL and we get the SEGV. (I am testing a change which makes perlio.c more defensive with returned NULL as well.) I am slightly confused by the condition though - this is the IoIFP and IoOFP need their own PerlIO * logic - fine if it is a socket but why do we need that for the WRONLY case of a char-device? Did we mean RDWR case? -- Nick Ing-Simmons http://www.ni-s.u-net.com/ -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/