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

List and TextArea objects not cleaned up properly, causing errors and core dumps

XMLWordPrintable

    • 1.1.5
    • sparc
    • solaris_2.5.1, solaris_9
    • Not verified



      Name: mf23781 Date: 09/12/97


      List and TextArea widgets are not being cleaned up
              properly, leading to error messages and core dumps.


      Platform: Solaris & ports thereof (in this case, AIX)

      Version: 1.1.2 - and I believe it is still present in 1.1.4

      Abstract: List awt_delWidget should be called when List and TextArea
                  widgets are disposed.


      The symptom (seen on AIX only so far) is that an AWT applications gets
      itself into a state where if you move the mouse over a certain window
      or widget, you get repeated 'method postEvent ... not found' messages,
      followed ultimately by a SIGSEGV and core dump.


      The exact text is:


      (On the "AWT-Motif" thread:)

      java.lang.NoSuchMethodError: : method postEvent(Ljava/awt/AWTEvent;)V not found
              at java.lang.Thread.run(Thread.java)
      java.lang.NoSuchMethodError: : method postEvent(Ljava/awt/AWTEvent;)V not found
              at java.lang.Thread.run(Thread.java)
      SIGSEGV received. Processing terminated
      (...full thread dump...)


      The problem is that List objects are creating two X widgets,
      and then storing them into a sort of widget registry (awt_addWidget
      and awt_delWidget) used to map incoming X events back to the
      correct java object. When the List object is disposed, only ONE
      of the two widgets is removed from the widget registry, so that when
      another object is later created with the same X widget address, it
      incorrectly mapped incoming events to a long dead-and-gone
      java object.

      The same problem exists for TextArea objects.



      DELTA: src/unix/sun/awt_List.c (a112 1.3)
      *** 1.2 Thu Sep 11 15:16:50 1997
      --- 1.3 Thu Sep 11 15:16:51 1997
      ***************
      *** 123,128 ****
      --- 123,143 ----
            AWT_UNLOCK();
        }
        
      + /* ibm02834 - pDispose that's specific to MListPeer added to remove the
      + * sdata->list widget from the widget list. */
      + void
      + sun_awt_motif_MListPeer_pDispose(struct Hsun_awt_motif_MListPeer *this)
      + {
      + struct ListData *sdata;
      + AWT_LOCK();
      + sdata = PDATA(ListData,this);
      +
      + if (sdata != 0)
      + awt_delWidget(sdata->list);
      + AWT_UNLOCK();
      +
      + sun_awt_motif_MComponentPeer_pDispose((struct Hsun_awt_motif_MComponentPeer*) this);
      + }
        
        long
        sun_awt_motif_MListPeer_isSelected(struct Hsun_awt_motif_MListPeer *this,



      DELTA: src/unix/sun/sun/awt/motif/MListPeer.java (a112 1.2)
      *** 1.1 Thu Sep 11 15:16:52 1997
      --- 1.2 Thu Sep 11 15:16:53 1997
      ***************
      *** 28,33 ****
      --- 28,34 ----
        
        class MListPeer extends MComponentPeer implements ListPeer {
            native void create(MComponentPeer parent);
      + native void pDispose(); /* ibm02834 */
        
            void initialize() {
              List li = (List)target;



      DELTA: src/unix/sun/sun/awt/motif/MTextAreaPeer.java (a112 1.2)
      *** 1.1 Thu Sep 11 15:16:54 1997
      --- 1.2 Thu Sep 11 15:16:55 1997
      ***************
      *** 33,38 ****
      --- 33,39 ----
        
        public class MTextAreaPeer extends MComponentPeer implements TextAreaPeer {
            native void create(MComponentPeer parent);
      + native void pDispose(); /* ibm02834 */
        
            void initialize() {
              TextArea txt = (TextArea)target;



      DELTA: src/unix/sun/awt_TextArea.c (a112 1.3)
      *** 1.2 Thu Sep 11 15:16:57 1997
      --- 1.3 Thu Sep 11 15:17:02 1997
      ***************
      *** 145,150 ****
      --- 145,165 ----
            AWT_UNLOCK();
        }
        
      + /* ibm02834 - pDispose that's specific to MTextAreaPeer added to remove the
      + * tdata->txt widget from the widget list. */
      + void
      + sun_awt_motif_MTextAreaPeer_pDispose(struct Hsun_awt_motif_MTextAreaPeer *this)
      + {
      + struct TextAreaData *tdata;
      + AWT_LOCK();
      + tdata = PDATA(TextAreaData,this);
      +
      + if (tdata != 0)
      + awt_delWidget(tdata->txt);
      + AWT_UNLOCK();
      +
      + sun_awt_motif_MComponentPeer_pDispose((struct Hsun_awt_motif_MComponentPeer*) this);
      + }
        
        long
        sun_awt_motif_MTextAreaPeer_getExtraWidth(struct Hsun_awt_motif_MTextAreaPeer *this)

      ======================================================================
      linda.mccolm@Eng 1997-09-22 investigating

            duke J. Duke
            miflemi Mick Fleming
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: