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

Several class objects are used for synchronization

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 1.1.8
    • 1.1.7, 1.1.8, 1.2.0
    • client-libs
    • 1.1.8
    • generic, x86
    • generic, windows_nt
    • Verified

      nowned>
          String intern lock: <unowned>
          JNI pinning lock: <unowned>
          JNI global reference lock: <unowned>
          BinClass lock: <unowned>
          Class loading lock: owner "main" (0x8afd60, 1 entry)
          Java stack lock: <unowned>
          Code rewrite lock: <unowned>
          Heap lock: <unowned>
          Has finalization queue lock: <unowned>
          Finalize me queue lock: <unowned>
              Waiters: 1
          Monitor registry: <unowned>

      That's the second thread dump.
      elizabeth.mezias@Eng 1998-12-17
      The VM has a bug in 1.1.X versions (4041699) where deadlocks can occur when synchronizing using class objects. Several Swing and AWT classes either have synchronized blocks which use a class object or "static synchronized" methods, which is essentially the same thing.

      ___________________________________________________________
      The following stack trace is from a database program written in java using some lightweight borland ui classes along with standard Swing classes. The data was generated following a hang.

      Full thread dump:
          "antiGC" (TID:0x12b8108, sys_thread_t:0x906a80, Win32ID:0x78, state:CW) prio=2
              java.lang.Object.wait(Object.java:315)
              COM.cloudscape.impl.BasicServices.Monitor.Generic.AntiGC.run(BaseMonitor.java:1724)
              java.lang.Thread.run(Thread.java:474)
          "Screen Updater" (TID:0x12b93e0, sys_thread_t:0x905e90, Win32ID:0x79, state:MW) prio=6
              sun.awt.ScreenUpdater.run(ScreenUpdater.java:102)
          "TimerQueue" (TID:0x12b0c70, sys_thread_t:0x8cfc70, Win32ID:0x82, state:CW)
      prio=5
              com.sun.java.swing.TimerQueue.run(TimerQueue.java:210)
              java.lang.Thread.run(Thread.java:474)
          "AWT-Windows" (TID:0x12a93b0, sys_thread_t:0x8b5f20, Win32ID:0x8a, state:MW)prio=5
              java.awt.EventQueue.postEvent(EventQueue.java:91)
              java.awt.EventQueue.postEvent(EventQueue.java:61)
              sun.awt.windows.WToolkit.postEvent(WToolkit.java:118)
              sun.awt.windows.WComponentPeer.postEvent(WComponentPeer.java:295)
              sun.awt.windows.WToolkit.run(WToolkit.java:107)
              java.lang.Thread.run(Thread.java:474)
          "AWT-EventQueue-0" (TID:0x12a91c8, sys_thread_t:0x8b45e0, Win32ID:0x85, state:MW) prio=5
              com.sun.java.swing.RepaintManager$WorkRequest.run(RepaintManager.java:449)
              com.sun.java.swing.SystemEventQueueUtilities.processRunnableEvent(SystemEventQueueUtilities.java:193)
              com.sun.java.swing.SystemEventQueueUtilities.access$0(SystemEventQueueUtilities.java:189)
              com.sun.java.swing.SystemEventQueueUtilities$RunnableTarget.processEvent(SystemEventQueueUtilities.java:230)
              java.awt.Component.dispatchEventImpl(Component.java:1781)
              java.awt.Component.dispatchEvent(Component.java:1708)
              java.awt.EventDispatchThread.run(EventDispatchThread.java:81)
          "Finalizer thread" (TID:0x12a3088, sys_thread_t:0x8ae580, Win32ID:0x7e, state:MW) prio=2
              sun.awt.windows.WMenuItemPeer.finalize(WMenuItemPeer.java:99)
          "main" (TID:0x12a30b0, sys_thread_t:0x8ab7d0, Win32ID:0x47, state:CW) prio=5
              COM.cloudscape.impl.Database.Language.Datatypes.Compilation.TypeCompilationFactoryImpl.registerFormatClasses(TypeCompilationFactoryImpl.java:135)
              COM.cloudscape.impl.BasicServices.Monitor.Generic.BaseMonitor.runInitMethod(BaseMonitor.java:1624)
              COM.cloudscape.impl.BasicServices.Monitor.Generic.BaseMonitor.getImplementations(BaseMonitor.java:1044)
              COM.cloudscape.impl.BasicServices.Monitor.Generic.BaseMonitor.getDefaultImplementations(BaseMonitor.java:1094)
              COM.cloudscape.impl.BasicServices.Monitor.Generic.BaseMonitor.run(BaseMonitor.java:253)
              COM.cloudscape.core.MonitorBoot.start(MonitorBoot.java:63)
              COM.cloudscape.core.JDBCBoot.boot(JDBCBoot.java:57)
              COM.cloudscape.core.JDBCDriver.boot(JDBCDriver.java:137)
              COM.cloudscape.core.JDBCDriver.<clinit>(JDBCDriver.java:58)
              COM.cloudscape.ui.DomainConnection.setSelectedDatabase(DomainConnection.java:101)
              COM.cloudscape.ui.Database.connect(Database.java:472)
              COM.cloudscape.ui.VisualDatabasePanel.openDatabase(VisualDatabasePanel.java:501)
              COM.cloudscape.ui.VisualDatabaseFrame.openDatabase(VisualDatabaseFrame.java:177)
              COM.cloudscape.ui.VisualDatabaseFrame.openDatabases(VisualDatabaseFrame.java:172)
              COM.cloudscape.ui.VisualDatabase.<init>(VisualDatabase.java:57)
              COM.cloudscape.ui.VisualDatabase.<init>(VisualDatabase.java:39)
              COM.cloudscape.tools.vjbms.main(vjbms.java:24)
              Wrapper.main(Wrapper.java:14)
      Monitor Cache Dump:
          java.lang.Class@12BB660/138B510: owner "main" (0x8ab7d0, 1 entry)
          java.lang.Class@12BB808/138FEE0: owner "main" (0x8ab7d0, 1 entry)
          java.lang.Class@12BB820/138FDB0: owner "main" (0x8ab7d0, 1 entry)
          com.sun.java.swing.TimerQueue@12B0C78/130A650: <unowned>
              Waiters: 1
          COM.cloudscape.impl.BasicServices.Monitor.Generic.AntiGC@12B80E0/1371C88: <u
      nowned>
              Waiters: 1
          java.lang.Class@12AE608/12FFE40: owner "AWT-EventQueue-0" (0x8b45e0, 1 entry)
          java.lang.Class@12B9728/134A6D8: owner "Finalizer thread" (0x8ae580, 1 entry)
          java.lang.Class@12A9220/12F1E58: owner "AWT-Windows" (0x8b5f20, 1 entry)
          java.awt.EventQueue@12A9218/12F1ED8: owner "AWT-Windows" (0x8b5f20, 2 entries)
          java.lang.Class@12B93D8/136DED0: owner "Screen Updater" (0x905e90, 1 entry)
      Registered Monitor Dump:
          Thread queue lock: <unowned>
          Name and type hash table lock: <unowned>
          String intern lock: <unowned>
          JNI pinning lock: <unowned>
          JNI global reference lock: <unowned>
          BinClass lock: <unowned>
          Class loading lock: owner "main" (0x8ab7d0, 1 entry)
          Java stack lock: <unowned>
          Code rewrite lock: <unowned>
          Heap lock: <unowned>
          Has finalization queue lock: <unowned>
          Finalize me queue lock: <unowned>
              Waiters: 1
          Monitor registry: <unowned>

      A review of multiple stack traces shows main as the owner of the Class loading lock. The thread waiting for the Finalize me queue lock is probably main. All of the stack traces had a java.lang.Class*** lock in the Cache dump.

      For this customer, this bug is a showstopper.
      elizabeth.mezias@Eng 1998-12-08

      Using 1.1.8D to test Cloudscapes application I found that the problem is not resolved with the current integrated fix. I have pasted the thread dump below.

      ==== Iteration 110 Thu Dec 17 10:39:37 CST 1998 ====
      java -mx32m Wrapper 2 toursDB150

      Full thread dump:
          "antiGC" (TID:0x12aaba0, sys_thread_t:0x918740, Win32ID:0x56, state:MW) prio
      =2
              java.lang.Thread.run(Thread.java:466)
          "Screen Updater" (TID:0x12b3b80, sys_thread_t:0x916620, Win32ID:0x47, state:
      CW) prio=4
              java.lang.Object.wait(Compiled Code)
              sun.awt.ScreenUpdater.nextEntry(Compiled Code)
              sun.awt.ScreenUpdater.run(Compiled Code)
          "TimerQueue" (TID:0x12b12b0, sys_thread_t:0x8d9d10, Win32ID:0x97, state:CW)
      prio=5
              com.sun.java.swing.TimerQueue.run(Compiled Code)
              java.lang.Thread.run(Thread.java:466)
          "AWT-Windows" (TID:0x12a94c0, sys_thread_t:0x8b7ed0, Win32ID:0x92, state:MW)
       prio=5
              sun.awt.windows.WToolkit.postEvent(Compiled Code)
              sun.awt.windows.WWindowPeer.postFocusOnActivate(WWindowPeer.java:82)
              sun.awt.windows.WToolkit.run(WToolkit.java:98)
              java.lang.Thread.run(Thread.java:466)
          "AWT-EventQueue-0" (TID:0x12a9598, sys_thread_t:0x8b71b0, Win32ID:0x74, stat
      e:MW) prio=5
              java.awt.LightweightDispatcher.retargetMouseEvent(Compiled Code)
              java.awt.LightweightDispatcher.processMouseEvent(Container.java:1650)
              java.awt.LightweightDispatcher.dispatchEvent(Container.java:1525)
              java.awt.Container.dispatchEventImpl(Compiled Code)
              java.awt.Window.dispatchEventImpl(Window.java:509)
              java.awt.Component.dispatchEvent(Compiled Code)
              java.awt.EventDispatchThread.run(Compiled Code)
          "Finalizer thread" (TID:0x12a3088, sys_thread_t:0x8ad850, Win32ID:0xa9, stat
      e:MW) prio=5
              java.awt.image.ColorModel.finalize(ColorModel.java:113)
          "main" (TID:0x12a30b0, sys_thread_t:0x8afd60, Win32ID:0x9f, state:CW) prio=5

              COM.cloudscape.impl.BasicServices.Monitor.Generic.BaseMonitor.getImpleme
      ntations(Compiled Code)
              COM.cloudscape.impl.BasicServices.Monitor.Generic.BaseMonitor.getDefault
      Implementations(BaseMonitor.java:1095)
              COM.cloudscape.impl.BasicServices.Monitor.Generic.BaseMonitor.run(BaseMo
      nitor.java:254)
              COM.cloudscape.core.MonitorBoot.start(MonitorBoot.java:63)
              COM.cloudscape.core.JDBCBoot.boot(JDBCBoot.java:57)
              COM.cloudscape.core.JDBCDriver.boot(JDBCDriver.java:137)
              COM.cloudscape.core.JDBCDriver.<clinit>(JDBCDriver.java:58)
              COM.cloudscape.ui.DomainConnection.setSelectedDatabase(DomainConnection.
      java:101)
              COM.cloudscape.ui.Database.connect(Database.java:472)
              COM.cloudscape.ui.VisualDatabasePanel.openDatabase(VisualDatabasePanel.j
      ava:503)
              COM.cloudscape.ui.VisualDatabaseFrame.openDatabase(VisualDatabaseFrame.j
      ava:177)
              COM.cloudscape.ui.VisualDatabaseFrame.openDatabases(Compiled Code)
              COM.cloudscape.ui.VisualDatabase.<init>(VisualDatabase.java:57)
              COM.cloudscape.ui.VisualDatabase.<init>(VisualDatabase.java:39)
              COM.cloudscape.tools.vjbms.main(vjbms.java:25)
              Wrapper.main(Wrapper.java:14)
      Monitor Cache Dump:
          java.awt.EventQueue@12A9320/1300120: owner "AWT-Windows" (0x8b7ed0, 1 entry)

          java.lang.Class@12AAB00/138D378: owner "antiGC" (0x918740, 1 entry)
          com.sun.java.swing.TimerQueue@12B12B8/1345288: <unowned>
              Waiters: 1
          java.lang.Class@12B5678/1388158: owner "AWT-EventQueue-0" (0x8b71b0, 1 entry
      )
          java.lang.Class@12B1FF0/1366DA0: owner "AWT-Windows" (0x8b7ed0, 1 entry)
          java.lang.Class@12BD938/13546A0: owner "main" (0x8afd60, 1 entry)
          sun.awt.ScreenUpdater@12B3B80/1389C10: <unowned>
              Waiters: 1
      Registered Monitor Dump:
          SymcJIT Method Monitor: owner "antiGC" (0x918740, 2 entries)
          SymcJIT Method Monitor: owner "AWT-EventQueue-0" (0x8b71b0, 2 entries)
          SymcJIT Method Monitor: owner "AWT-Windows" (0x8b7ed0, 2 entries)
          SymcJIT Method Monitor: <unowned>
          SymcJIT Method List Monitor: <unowned>
          SymcJIT Fixups Allocation: <unowned>
          SymcJIT Code Allocation: <unowned>
          SymcJIT Data Allocation: <unowned>
          Thread queue lock: <unowned>
          Name and type hash table lock: <unowned>
          String intern lock: <unowned>
          JNI pinning lock: <unowned>
          JNI global reference lock: <unowned>
          BinClass lock: <unowned>
          Class loading lock: owner "main" (0x8afd60, 1 entry)
          Java stack lock: <unowned>
          Code rewrite lock: <unowned>
          Heap lock: <unowned>
          Has finalization queue lock: <unowned>
          Finalize me queue lock: <unowned>
              Waiters: 1
          Monitor registry: <unowned>

      I am running the same test script with the interpreter rather than the jit and will add another thread dump when the program hangs.
      elizabeth.mezias@Eng 1998-12-17

      ==== Iteration 111 Thu Dec 17 10:57:27 CST 1998 ====
      java -Djava.compiler=none -mx32m Wrapper 2 toursDB150
      Warning: JIT compiler "none" not found. Will use interpreter.

      Full thread dump:
          "rawStoreDaemon" (TID:0x12c0650, sys_thread_t:0x95ae90, Win32ID:0x47, state:CW) prio=5
              COM.cloudscape.impl.BasicServices.DaemonService.SingleThread.SingleThreadDaemon.rest(SingleThreadDaemon.java:199)
              COM.cloudscape.impl.BasicServices.DaemonService.SingleThread.SingleThreadDaemon.run(SingleThreadDaemon.java:72)
              java.lang.Thread.run(Thread.java:466)
          "antiGC" (TID:0x12ab4a8, sys_thread_t:0x915290, Win32ID:0x9f, state:CW) prio=2
              java.lang.Object.wait(Object.java:307)
              COM.cloudscape.impl.BasicServices.Monitor.Generic.AntiGC.run(BaseMonitor.java:1725)
              java.lang.Thread.run(Thread.java:466)
          "Screen Updater" (TID:0x12b25e8, sys_thread_t:0x907df0, Win32ID:0xa3, state:CW) prio=4
              java.lang.Object.wait(Object.java:307)
              sun.awt.ScreenUpdater.nextEntry(ScreenUpdater.java:70)
              sun.awt.ScreenUpdater.run(ScreenUpdater.java:90)
          "TimerQueue" (TID:0x12b1320, sys_thread_t:0x8d26a0, Win32ID:0x8d, state:CW) prio=5
              com.sun.java.swing.TimerQueue.run(TimerQueue.java:210)
              java.lang.Thread.run(Thread.java:466)
          "AWT-Windows" (TID:0x12a94b0, sys_thread_t:0x8b21a0, Win32ID:0x97, state:MW) prio=5
              sun.awt.windows.WToolkit.run(WToolkit.java:98)
              java.lang.Thread.run(Thread.java:466)
          "AWT-EventQueue-0" (TID:0x12a9588, sys_thread_t:0x8b9e90, Win32ID:0x42, state:CW) prio=5
              java.lang.Object.wait(Object.java:307)
              java.awt.EventQueue.getNextEvent(EventQueue.java:126)
              java.awt.EventDispatchThread.run(EventDispatchThread.java:67)
          "Finalizer thread" (TID:0x12a3088, sys_thread_t:0x8ad620, Win32ID:0x79, state:MW) prio=2
              java.awt.image.ColorModel.finalize(ColorModel.java:113)
          "main" (TID:0x12a30b0, sys_thread_t:0x8afd60, Win32ID:0xad, state:CW) prio=5

              COM.cloudscape.ui.TabbedDatabasePanel.<init>(TabbedDatabasePanel.java:13)
              COM.cloudscape.ui.VisualDatabasePanel.getTabbedDatabasePanel(VisualDatabasePanel.java:1401)
              COM.cloudscape.ui.VisualDatabasePanel.selectionChanged(VisualDatabasePanel.java:1177)
              COM.cloudscape.ui.VisualDatabasePanel.treeControl1_selectionChanged(VisualDatabasePanel.java:1511)
              COM.cloudscape.ui.VisualDatabasePanel_treeControl1_selectionAdapter.selectionChanged(VisualDatabasePanel.java:1738)
              borland.jbcl.model.GraphSelectionMulticaster.dispatch(GraphSelectionMulticaster.java:73)
              borland.jbcl.model.GraphSelectionMulticaster.selectionChanged(GraphSelectionMulticaster.java:42)
              borland.jbcl.model.GraphSelectionEvent.dispatch(GraphSelectionEvent.java:50)
              borland.jbcl.util.EventMulticaster.dispatch(EventMulticaster.java:62)
              borland.jbcl.model.SingleGraphSelection.processSelectionEvent(SingleGraphSelection.java:116)
              borland.jbcl.model.SingleGraphSelection.add(SingleGraphSelection.java:71)
              borland.jbcl.view.TreeCore.setSubfocus(TreeCore.java:321)
              borland.jbcl.view.TreeCore.setSubfocus(TreeCore.java:286)
              borland.jbcl.view.TreeView.setSubfocus(TreeView.java:153)
              COM.cloudscape.ui.VisualDatabasePanel.addDatabaseOptionallyAddingToTree(VisualDatabasePanel.java:317)
              COM.cloudscape.ui.VisualDatabasePanel.addDatabase(VisualDatabasePanel.java:302)
              COM.cloudscape.ui.VisualDatabasePanel.openDatabase(VisualDatabasePanel.java:504)
              COM.cloudscape.ui.VisualDatabaseFrame.openDatabase(VisualDatabaseFrame.java:177)
              COM.cloudscape.ui.VisualDatabaseFrame.openDatabases(VisualDatabaseFrame.java:172)
              COM.cloudscape.ui.VisualDatabase.<init>(VisualDatabase.java:57)
      Monitor Cache Dump:
          java.awt.EventQueue@12A9320/12F56F0: <unowned>
              Waiters: 1
          COM.cloudscape.impl.BasicServices.Monitor.Generic.AntiGC@12AB3F8/1379250: <unowned>
              Waiters: 1
          java.lang.Class@12CEE30/13E7E28: owner "main" (0x8afd60, 1 entry)
          sun.awt.ScreenUpdater@12B25E8/1376850: <unowned>
              Waiters: 1
          java.lang.Class@12C9608/1402A60: owner "main" (0x8afd60, 1 entry)
          com.sun.java.swing.TimerQueue@12B1328/13229A8: <unowned>
              Waiters: 1
          COM.cloudscape.impl.BasicServices.DaemonService.SingleThread.SingleThreadDaemon@12C0408/1390620: <unowned>
              Waiters: 1
      Registered Monitor Dump:
          Thread queue lock: <unowned>
          Name and type hash table lock: <u

            tdv Dmitri Trembovetski (Inactive)
            tballsunw Tom Ball (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: