debugging SIGSEV on pclose

Thu Sep 8 22:23:00 GMT 2011

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
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?

View this message in context:
Sent from the Cygwin list mailing list archive at

Problem reports:
Unsubscribe info:

More information about the Cygwin mailing list