[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Help debugging Re: bug report
From: |
Mathew Yeates |
Subject: |
Help debugging Re: bug report |
Date: |
Wed, 27 Mar 2002 11:06:47 -0800 |
Hi-
I'm tryin to debug groff running on SGI Irix 6.5.
When I do a system trace on man I see that file descriptors 0,1,2 are
closed by make immediately prior to gnroff being forked. Is this correct
behavior? I tried adding the line "echo HELLO" near the beginning of
gnroff and, as expected, this fails with a "bad file descriptor" message
in my trace.
Does that happen with other OS's?
Mathew
> Sorry, this doesn't ring any bells with me. Can you send me the test
> case? I'll try building a debug version of groff (2.5?) and see if I
> can find the close().
>
> David
>
> Werner LEMBERG wrote:
> >
> > [David, maybe you can help here. I've noted that recently a similar
> > problem has been discussed on the emacs-devel list, and maybe this
> > problem is related.
> >
> > Here the original report; Mathew is using an SGI Octane with Irix 6.5:
> >
> > Error: geqn fails when it tries to write output to stdout. This
> > happens at line 378 of main.cc. Doing a system call trace, it
> > appears that stdout has been closed. I added a line of code to
> > print out the errno when the printf fails. I get "stdout': Bad file
> > number"
> >
> > It appears that stdout was closed long before the error. In the
> > trace I see "open" calls returning the value 1.
> >
> > Does this sound familiar?]
> >
> > > Something really strange.... my system trace shows that man closes
> > > file descriptors 0,1, and 2 just prior to execv-ing nroff. Maybe
> > > the problem here is SGI's "man"?? I notice that when I run using
> > > the sgi nroff, eqn does not write to stdout. Instead, nothing is
> > > written to stdout again until man does a "write" after calling
> > > ioctl(1, __OLD_TCGETA, <bad indirect __old_termio param - len 30>)
> > > OK
> > >
> > > Maybe it isnt safe to call printf from with eqn without checking
> > > first that the IO file handles are still open??
> >
> > AFAIK, stderr, stdin, and stdout are opened and closed automatically
> > at the start and end of the program. If nothing explicitly closes the
> > handles, they should be always available. There is some trickery to
> > duplicate streams in groff.cc IIRC, but none is really closed.
> > Anyway, this shouldn't affect eqn.
> >
> > Werner
>
> --
> David KAELBLING <address@hidden> Silicon Graphics Computer Systems
> 1 Cabot Rd, suite 250; Hudson, MA 01749 781.839.2157, fax ...2357
- bug report, Mathew Yeates, 2002/03/25
- Re: bug report, Werner LEMBERG, 2002/03/26
- Re: bug report, Mathew Yeates, 2002/03/26
- Re: bug report, Werner LEMBERG, 2002/03/27
- Re: bug report, David Kaelbling, 2002/03/27
- Help debugging Re: bug report,
Mathew Yeates <=
- Re: Help debugging Re: bug report, David Kaelbling, 2002/03/27
- Re: Help debugging Re: bug report, Mathew Yeates, 2002/03/27
- Re: Help debugging Re: bug report, David Kaelbling, 2002/03/27
- Re: Help debugging Re: bug report, Mathew Yeates, 2002/03/27
- Re: Help debugging Re: bug report, David Kaelbling, 2002/03/27
- Re: Help debugging Re: bug report, Mathew Yeates, 2002/03/27
- Re: Help debugging Re: bug report, David Kaelbling, 2002/03/27
- A problem with "more" Re: Help debugging Re: bug report, Mathew Yeates, 2002/03/27
- Re: A problem with "more" Re: Help debugging Re: bug report, Werner LEMBERG, 2002/03/28