unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: Steve Tell <tell@telltronics.org>
Subject: "Error: could not flush file-descriptor 1"
Date: Mon, 14 Jun 2004 22:07:26 -0400 (EDT)	[thread overview]
Message-ID: <Pine.LNX.4.56.0406142138580.24307@ariel> (raw)
In-Reply-To: <3756B586-BC05-11D8-8DF3-000A958866C4@qwest.net>


Can anyone shed some light on under what circumstances I can end up with 
this error message from guile-1.6.4?

I found the text of the message, in fport_flush() in fports.c:

          if (scm_i_terminating)
            {
              const char *msg = "Error: could not flush file-descriptor ";
              char buf[11];

              write (2, msg, strlen (msg));
              sprintf (buf, "%d\n", fp->fdes);
              write (2, buf, strlen (buf));
(BTW, could this not be extended to print the value of errno?)

>From the comments it appears that (scm_i_terminating != 0) means that guile is
trying to exit after some fatal error - but I'm lost trying to figure out
what the problem condition might be.

The program is a long-running daemon that had redirected both
current-output-port and current-error-port to (the same) file, and then
had been running fine, with occaisional output.  (the disk with the
logfile isn't full or anything).

After the error message, the program is hung (sleeping state 'S' in
ps).  I send it a SIGSTOP and try to attach to it with gdb, but gdb
running as root is unable to connect:
      GNU gdb Red Hat Linux (5.3post-0.20021129.18rh)
      ....
      This GDB was configured as "i386-redhat-linux-gnu".
      (gdb) attach 24920
      Attaching to process 24920
      Couldn't get registers: Operation not permitted.
      (gdb) q
      The program is running.  Quit anyway (and detach it)? (y or n) y
      Detaching from program: , process 24920
      ptrace: Operation not permitted.
      (gdb) 

One possible clue:

Besides possibly confusingly-reordered output due to buffering, is
there any known real problem with mixing output to C standard-IO
routines with guile port output?  In some C routines I have some
fprintf(stderr, msg) debugging statements, and one of these is the
next-to-last line output before the "Error: could not flush
file-descriptor" and hang.


thanks,
Steve



_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-user


      reply	other threads:[~2004-06-15  2:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-12  0:12 a question regarding reload Steven Wu
2004-06-15  2:07 ` Steve Tell [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.56.0406142138580.24307@ariel \
    --to=tell@telltronics.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).