This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: debugging SIGSEV on pclose


On 9/8/2011 8:22 PM, Christopher Faylor wrote:
On Thu, Sep 08, 2011 at 07:16:17PM +0200, Marco atzeri wrote:
On 9/8/2011 6:52 PM, Christopher Faylor wrote:
As I said, on Linux, if you call pclose twice in succession you get a
SEGV.  I am comfortable with Cygwin's behavior especially since you
seem to be seeing an actual program problem.

unlikely a octave issue as it SEGFAULT's only on cygwin, and all the other platforms are fine: Linux, BSD, Apple.

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.

cgf


Cgf,


If I am not fooling myself, octave sequence is this:

- popen , creating pipe 5 and 6 (handle 0x20204F9C)
  (pipe 5 is closed as the communication is unidirectional)

- fdopen (6) duplicating the handle (new handle 0x2020500C)

- a lot of writing to 6

- fclose (0x2020500C)
  this is causing fclose to call : close(6)
-----------------------------------------------
Run till exit from #0  fclose (fp=0x2020500c)
    at ../../../../../src_new/newlib/libc/stdio/fclose.c:116

Breakpoint 6, close (fd=6)
    at /pub/cygwin/cvs/src_new/winsup/cygwin/syscalls.cc:1214
------------------------------------------------

- pclose(0x20204F9C)
  that SEGFAULT's as fd=6 is already closed

The close(6) seems an abnormal beahviour of fclose as there is another
FILE handle still open.

How does cygwin track the number of open FILE handles for each
file descriptor  ?

Regards
Marco





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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]