[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

"Error: could not flush file-descriptor 1"

From: Steve Tell
Subject: "Error: could not flush file-descriptor 1"
Date: Mon, 14 Jun 2004 22:07:26 -0400 (EDT)

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.

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.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]