debugging SIGSEV on pclose

Thu Sep 8 00:44:00 GMT 2011

On 2011-09-05 PM 11:01, Marco atzeri wrote:
> Hi jojelino,
> gs is unlikely crashing as the fltk.png is correctly produced.
>  From strace I know that octave crashes before gs complete its output.
i'm sorry. mine was not the case.
and after some digging, it is found that fd[6] is *closed* before pclose.

warning: print.m: epstool binary is not available.
Some output formats are not available.
Hardware watchpoint 3: cygheap->fdtab.fds[6]

Old value = (fhandler_base *) 0x0
New value = (fhandler_pipe *) 0x612dbb8c
_pipe (filedes=0x22b370, psize=0x10000, mode=0x10000)
     at /tmp/winsup/winsup/cygwin/
382           filedes[0] = fdin;
(gdb) b _sigfe_fclose
Breakpoint 6 at 0x610f080b
(gdb) c
[New Thread 1684.0xf98]

Breakpoint 6, 0x610f080b in _sigfe_fclose ()
    from /cygdrive/d/cygwin/bin/cygwin1.dll
(gdb) bt
#0  0x610f080b in _sigfe_fclose () from /cygdrive/d/cygwin/bin/cygwin1.dll
#1  0x66f6a41f in 
cygoctinterp-0!_ZN13glps_renderer4drawERK15graphics_object ()
    from /cygdrive/d/cygwin/bin/cygoctinterp-0.dll
#2  0x6ec0ff2f in _init_fltk__-0!_ZN11OpenGL_fltk4drawEv ()
    from D:/cygwin/lib/octave/3.4.2/oct/i686-pc-cygwin/__init_fltk__.oct
#3  0x6dab19ef in cygfltk_gl-1!_ZN12Fl_Gl_Window5flushEv ()
    from /cygdrive/d/cygwin/bin/cygfltk_gl-1.1.dll
#4  0x6dae2a0f in cygfltk-1!_ZN2Fl5flushEv ()
    from /cygdrive/d/cygwin/bin/cygfltk-1.1.dll
#5  0x6dae2c28 in cygfltk-1!_ZN2Fl4waitEd ()
    from /cygdrive/d/cygwin/bin/cygfltk-1.1.dll
#6  0x6ec21272 in 
    from D:/cygwin/lib/octave/3.4.2/oct/i686-pc-cygwin/__init_fltk__.oct
#7  0x66ffc52b in cygoctinterp-0!_Z8FdrawnowRK17octave_value_listi ()
    from /cygdrive/d/cygwin/bin/cygoctinterp-0.dll
#8  0x67159266 in 
    from /cygdrive/d/cygwin/bin/cygoctinterp-0.dll
#9  0x67158397 in 
    from /cygdrive/d/cygwin/bin/cygoctinterp-0.dll
#10 0x67159066 in 
<return> to continue, or q <return> to quit---q

i think fltk have bad behavior which use fclose to close pipe fd, but it 
should have used pclose. so closing disposed fd yields sigsegv.
we should inspect fltk's glps_renderer::draw(graphics_object const&) for 
this strange behavior.

Problem reports:
Unsubscribe info:

More information about the Cygwin mailing list