unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
* a question regarding reload
@ 2004-06-12  0:12 Steven Wu
  2004-06-15  2:07 ` "Error: could not flush file-descriptor 1" Steve Tell
  0 siblings, 1 reply; 2+ messages in thread
From: Steven Wu @ 2004-06-12  0:12 UTC (permalink / raw)


It seems to be reloading a scheme code sometime gives problem. I have a 
scheme program file which loads in other scheme code and does some 
initialization thing, and I have no problem load it in the interactive 
mode, and run it. However, if I change some file, and reload, the 
symbols I defined go away, and sometimes, even quit, which I didn't 
overload, symbol cannot be found. Does anyone has this problem? Btw, I 
am using guile 1.6.4 on cygwin standard release.

steve





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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* "Error: could not flush file-descriptor 1"
  2004-06-12  0:12 a question regarding reload Steven Wu
@ 2004-06-15  2:07 ` Steve Tell
  0 siblings, 0 replies; 2+ messages in thread
From: Steve Tell @ 2004-06-15  2:07 UTC (permalink / raw)



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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-06-15  2:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-06-12  0:12 a question regarding reload Steven Wu
2004-06-15  2:07 ` "Error: could not flush file-descriptor 1" Steve Tell

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