Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4307972

Appl stops responding when NPE in PostEventQueue

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 1.4.0
    • 1.3.0
    • client-libs
    • None
    • beta
    • sparc
    • solaris_7



      Name: ea65 Date: 01/28/2000

      I am filing this bug on behalf of Petr Nejedly.
        
      This email from petr describes the problem.
        
      Subject: PostEventQueue
         Date: Tue, 25 Jan 2000 16:22:55 GMT
         From: Petr Nejedly <###@###.###>
           To: ###@###.###
        
      Hi
        
      There's some problem with AWT. We aren't able to reproduce it, but it
      occurs sometimes. The symptoms are that application stops responding
      and repainting when this exception occurs:
        
      The exception making problems:
        
      > java.lang.NullPointerException
      > at java.awt.EventQueue.postEventPrivate(EventQueue.java:116)
      > at java.awt.EventQueue.postEvent(EventQueue.java:103)
      > at sun.awt.PostEventQueue.run(SunToolkit.java:502)
        
      makes PostEventQueue thread to die.
        
      PostEventQueue's run method (excerpt from JDK1.3t
      sun.awt.SunToolkit:482):
        
          /*
           * Continually post pending AWTEvents to the Java EventQueue.
           */
          public void run() {
              while (keepGoing && !isInterrupted()) {
                  try {
                      EventQueueItem item;
                      synchronized(this) {
                          while (keepGoing && (queueHead == null)) {
                              notifyAll();
                              wait();
                          }
                          if (!keepGoing)
                              break;
                          item = queueHead;
                      }
                      eventQueue.postEvent(item.event);
                      synchronized(this) {
                          queueHead = queueHead.next;
                          if (queueHead == null)
                              queueTail = null;
                      }
                  } catch (InterruptedException e) {
                      keepGoing = false; // Exit gracefully when interrupted
                      synchronized(this) {
                          notifyAll();
                      }
                  }
              }
          }
        
        
      The problem is that this thread is not imunne to exceptions in
      eventQueue.postEvent(),
      I think it would be done such way the AWT-Event-Que is - try/catch
      printing exception happened
      during event dispatching.
        
      IMHO the real problem lies somewhere in AWT-Motif, propably sending
      item with item.event == null
      and java.awt.EventQueue.postEvent will fail in this section
      (java.awt.EventQueue:116):
                      int id = theEvent.getID();
                     
        
      Petr Nejedly, SUN Microsystems
      ###@###.###

      ======================================================================

            prssunw Prs Prs (Inactive)
            duke J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: