bug-ddd
[Top][All Lists]
Advanced

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

DDD 3.3.11 "hangs" when exiting


From: Doug Graham
Subject: DDD 3.3.11 "hangs" when exiting
Date: Mon, 21 Nov 2005 15:22:47 -0500
User-agent: Mutt/1.4.1i

On RedHat Linux 7.3 and RHEL 3, ddd often "hangs" after Exit is selected
from the File menu.  It is spinning in a tight loop burning CPU, and
will only stop spinning and exit properly when the mouse is moved or,
presumably, some other external event occurs.

A patch is included below which hopefully explains what is going wrong.
I did not investigate further to find out why the fread() is failing
with EIO.

   % ddd --configuration
   GNU DDD 3.3.11 (i686-pc-linux-gnu)
   Copyright (C) 1995-1999 Technische Universitdt Braunschweig, Germany.
   Copyright (C) 1999-2001 Universitdt Passau, Germany.
   Copyright (C) 2001 Universitdt des Saarlandes, Germany.
   Copyright (C) 2001-2004 Free Software Foundation, Inc.
   
   Compiled with GCC 3.4.1, GNU libc 2.2
   Requires X11R6, Xt11R6, Motif 2.2.3 (Motif Version 2.2.2)
   Includes XPM 3.4.11, Athena Panner (7000002L), DDD core

*** LiterateA.C 2005/11/20 21:12:07     1.1
--- LiterateA.C 2005/11/21 20:14:21
***************
*** 220,225 ****
--- 220,230 ----
        _raiseIOWarning("cannot set file to non-blocking mode");
  #endif
  
+     /*
+      * On Linux, this call is returning zero with errno set to EIO
+      * when we are exiting.  That causes an infinite loop unless
+      * the caller checks with ferror().
+      */
      // Read stuff
      int nitems = fread(buffer, sizeof(char), nelems, fp);
  
***************
*** 366,372 ****
        int length = lc->readInput(datap);
        if (length > 0)
            lc->dispatch(Input, datap, length);
!       else if (length == 0 && lc->inputfp() != 0 && feof(lc->inputfp()))
            lc->inputEOF();
      }
  }
--- 371,382 ----
        int length = lc->readInput(datap);
        if (length > 0)
            lc->dispatch(Input, datap, length);
!       /*
!        * [++doug]  Added ferror() here becasue rather than EOF,
!        * we are getting an error (EIO) when shutting down.
!        */
!       else if (length == 0 && lc->inputfp() != 0
!             && (feof(lc->inputfp()) || ferror(lc->inputfp())))
            lc->inputEOF();
      }
  }

--Doug.




reply via email to

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