delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2011/09/08/18:23:36

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RP_MATCHES_RCVD,T_TO_NO_BRKTS_FREEMAIL
X-Spam-Check-By: sourceware.org
Message-ID: <32427575.post@talk.nabble.com>
Date: Thu, 8 Sep 2011 15:23:12 -0700 (PDT)
From: "jan.kolar" <kolar AT math DOT cas DOT cz>
To: cygwin AT cygwin DOT com
Subject: Re: debugging SIGSEV on pclose
In-Reply-To: <20110908182210.GA30425@ednor.casa.cgf.cx>
MIME-Version: 1.0
References: <4E64BE96 DOT 5020107 AT gmail DOT com> <4E68CE13 DOT 6010106 AT gmail DOT com> <20110908142702 DOT GA28918 AT ednor DOT casa DOT cgf DOT cx> <4E68DB48 DOT 3050906 AT gmail DOT com> <4E68EB4A DOT 5040406 AT gmail DOT com> <20110908165203 DOT GB28918 AT ednor DOT casa DOT cgf DOT cx> <4E68F861 DOT 5090309 AT gmail DOT com> <20110908182210 DOT GA30425 AT ednor DOT casa DOT cgf DOT cx>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com



Christopher Faylor-8 wrote:
> 
>>I suspect more a borderline cygwin issue that octave is just hitting.
>>But of course I could be wrong.
> 
> Sure it could be but adding a band-aid to work around the issue is not
> the way to go.
> 


So we have sequence
  1.   popen  
  2.   fclose   
  3.   pclose
that is done by octave, not directly for purpose, might be for convenience.

And I do not what we should expect from 2. and 3.
Should fclose() complain or close the pipe?
Is pclose() supposed to wait for the child even if the file was closed?

Sometimes its handy to signal EOF to the child (fclose?), do some
independent work
and then wait for the childs exit status (popen?).
Well, sequence 1.2.3. does not look like to serve this purpose since (I
think)
fclose(fp) is supposed to free the FILE structure so that fp is invalid
afterwards :-(

The safest seems if fclose complains(?) and does free the FILE structure.
If it sends EOF, would be nice.
What actually Linux does?

Jan
-- 
View this message in context: http://old.nabble.com/debugging-SIGSEV-on-pclose-tp32400695p32427575.html
Sent from the Cygwin list mailing list archive at Nabble.com.


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019