Infinite loop with Rearranger plugin and #2002

I get an infinite loop with 100% cpu using the rearranger plugin, see
thread dump below. Anybody else see it too?

Bas

Full thread dump Java HotSpot(TM) Client VM (1.4.2_03-b02 mixed mode):

"EditorCaretThread" prio=7 tid=0x1c5309f8 nid=0x810 waiting on condition
[1fdbf0
00..1fdbfd88]
at java.lang.Thread.sleep(Native Method)
at com.intellij.openapi.editor.c.m$bh_.run(m$bh_.java:1)

"AWT-EventQueue-1" prio=7 tid=0x1c5ae6d8 nid=0x1d0 waiting on condition
[1e2af00
0..1e2afd88]
at com.intellij.psi.impl.source.bn$0.a(bn$0.java)
at com.intellij.psi.impl.source.g.c.a(c.java:30)
at com.intellij.psi.impl.source.m.getChildren(m.java:50)
at
com.wrq.rearranger.entry.ClassEntry.parseField(ClassEntry.java:218)
at
com.wrq.rearranger.entry.ClassEntry.parseRemainingClassContents(Class
Entry.java:125)
at
com.wrq.rearranger.entry.ClassEntry.parseClass(ClassEntry.java:80)
at
com.wrq.rearranger.entry.ClassEntry.parseRemainingClassContents(Class
Entry.java:154)
at
com.wrq.rearranger.entry.PsiFileEntry.parseFile(PsiFileEntry.java:80)

at
com.wrq.rearranger.rearrangement.Parser.parseOuterLevel(Parser.java:4
9)
at
com.wrq.rearranger.RearrangerActionHandler.rearrangeDocument(Rearrang
erActionHandler.java:166)
at
com.wrq.rearranger.RearrangerActionHandler$rearrangerTask.run(Rearran
gerActionHandler.java:217)
at com.intellij.openapi.command.impl.a.executeCommand(a.java:73)
at
com.wrq.rearranger.RearrangerActionHandler.runWriteActionRearrangemen
t(RearrangerActionHandler.java:134)
at
com.wrq.rearranger.RearrangerActionHandler$1.run(RearrangerActionHand
ler.java:94)
at com.intellij.openapi.application.b.b.runWriteAction(b.java:212)
at
com.wrq.rearranger.RearrangerActionHandler.execute(RearrangerActionHa
ndler.java:90)
at
com.intellij.openapi.editor.actionSystem.EditorAction$1.run(EditorAct
ion.java:1)
at com.intellij.openapi.command.impl.a.executeCommand(a.java:13)
at
com.intellij.openapi.editor.actionSystem.EditorAction.actionPerformed
(EditorAction.java:14)
at
com.intellij.openapi.editor.actionSystem.EditorAction.actionPerformed
(EditorAction.java:17)
at
com.intellij.openapi.actionSystem.b.n$b_.actionPerformed(n$b_.java:12
)
at
javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:17
86)
at
com.intellij.openapi.actionSystem.b.n.fireActionPerformed(n.java:44)
at com.intellij.ui.b.a.h.doClick(h.java:87)
at com.intellij.ui.b.a.h.access$300(h.java:141)
at com.intellij.ui.b.a.h$a_.mouseReleased(h$a_.java:4)
at java.awt.Component.processMouseEvent(Component.java:5100)
at java.awt.Component.processEvent(Component.java:4897)
at java.awt.Container.processEvent(Container.java:1569)
at java.awt.Component.dispatchEventImpl(Component.java:3615)
at java.awt.Container.dispatchEventImpl(Container.java:1627)
at java.awt.Component.dispatchEvent(Component.java:3477)
at
java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3483
)
at
java.awt.LightweightDispatcher.processMouseEvent(Container.java:3198)

at
java.awt.LightweightDispatcher.dispatchEvent(Container.java:3128)
at java.awt.Container.dispatchEventImpl(Container.java:1613)
at java.awt.Window.dispatchEventImpl(Window.java:1606)
at java.awt.Component.dispatchEvent(Component.java:3477)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:456)
at com.intellij.ide.q.b(q.java:129)
at com.intellij.ide.q.a(q.java:50)
at com.intellij.ide.q.dispatchEvent(q.java:41)
at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
read.java:201)
at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
ad.java:151)
at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)

at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)

at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)

"Thread-2" prio=7 tid=0x009a3ba8 nid=0x604 waiting on condition
[1d76f000..1d76f
d88]
at java.lang.Thread.sleep(Native Method)
at com.intellij.openapi.progress.b.a$0.run(a$0.java:1)

"com.jniwrapper.NativeResourceCollector" daemon prio=7 tid=0x1ca01f40
nid=0x710
in Object.wait()
at java.lang.Object.wait(Native Method)
- waiting on (a java.lang.ref.ReferenceQueue$Lock) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:111) - locked <0x10dadcf0> (a java.lang.ref.ReferenceQueue$Lock) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:127) at com.jniwrapper.e.run(SourceFile:58) "TimerQueue" daemon prio=5 tid=0x1c9e8e18 nid=0x44c runnable [1d6ef000..1d6efd88 ] at java.lang.Object.wait(Native Method) at javax.swing.TimerQueue.postExpiredTimers(TimerQueue.java:213) - locked <0x10e0a738> (a javax.swing.TimerQueue) at javax.swing.TimerQueue.run(TimerQueue.java:229) - locked <0x10e0a738> (a javax.swing.TimerQueue) at java.lang.Thread.run(Thread.java:534) "StoreRefreshStatusThread" prio=2 tid=0x1c6f4838 nid=0x2dc in Object.wait() [1d5 9f000..1d59fd88] at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:429) at com.intellij.util.c.j$b_.b(j$b_.java:15) - locked <0x10bda9e0> (a com.intellij.util.c.j$b_) at com.intellij.openapi.application.b.b.runReadAction(b.java:319) at com.intellij.openapi.vfs.a.a.g.g(g.java:264) at com.intellij.openapi.vfs.a.a.g.access$200(g.java:204) at com.intellij.openapi.vfs.a.a.g$b_.run(g$b_.java:7) "WatchForChangesThread" prio=7 tid=0x1c6f42f0 nid=0x4bc runnable [1d55f000..1d55 fd88] at com.intellij.vfs.local.win32.FileWatcher.waitForChangeImpl(Native Met hod) at com.intellij.vfs.local.win32.FileWatcher.c(FileWatcher.java:28) at com.intellij.openapi.vfs.a.a.g$c_.run(g$c_.java:13) "AlarmThread" prio=5 tid=0x1c5e5750 nid=0x17c in Object.wait() [1d32f000..1d32fd 88] at java.lang.Object.wait(Native Method) at com.intellij.util.Alarm$MyThread.run(Alarm.java:34) - locked <0x10bd1740>]]> (a java.lang.Object)

"AlarmThread" prio=5 tid=0x1c5e52f8 nid=0x6fc runnable
at java.lang.Object.wait(Native Method)
at com.intellij.util.Alarm$MyThread.run(Alarm.java:34)
- locked (a java.lang.Object) "AWT-Shutdown" prio=7 tid=0x1c6c02e8 nid=0x13c in Object.wait() [1d26f000..1d26f d88] at java.lang.Object.wait(Native Method) - waiting on <0x10b14588> (a java.lang.Object) at java.lang.Object.wait(Object.java:429) at sun.awt.AWTAutoShutdown.run(AWTAutoShutdown.java:259) - locked <0x10b14588> (a java.lang.Object) at java.lang.Thread.run(Thread.java:534) "SocketListenerThread" prio=5 tid=0x1c6c5e20 nid=0x1f8 runnable [1d1df000..1d1df d88] at java.net.PlainDatagramSocketImpl.receive(Native Method) - locked <0x10b16d30> (a java.net.PlainDatagramSocketImpl) at java.net.DatagramSocket.receive(DatagramSocket.java:711) - locked <0x10b16d60> (a java.net.DatagramPacket) - locked <0x10b16d80> (a java.net.MulticastSocket) at com.intellij.licensecommon.g.a.e.b(e.java:8) at com.intellij.licensecommon.g.a.f.run(f.java:3) "SocketListenerThread" prio=5 tid=0x1c6c9fe8 nid=0x4dc runnable [1d19f000..1d19f d88] at java.net.PlainDatagramSocketImpl.receive(Native Method) - locked <0x10b19548> (a java.net.PlainDatagramSocketImpl) at java.net.DatagramSocket.receive(DatagramSocket.java:711) - locked <0x10b19578> (a java.net.DatagramPacket) - locked <0x10b19598> (a java.net.DatagramSocket) at com.intellij.licensecommon.g.a.e.b(e.java:8) at com.intellij.licensecommon.g.a.f.run(f.java:3) "MessageDeliveryThread" prio=5 tid=0x1c6ca168 nid=0x578 in Object.wait() [1d15f0 00..1d15fd88] at java.lang.Object.wait(Native Method) - waiting on <0x10b19620> (a java.lang.Object) at java.lang.Object.wait(Object.java:429) at com.intellij.licensecommon.g.r.run(r.java:22) - locked <0x10b19620> (a java.lang.Object) "Java2D Disposer" daemon prio=10 tid=0x1c6c1fc0 nid=0x3d0 in Object.wait() [1cce f000..1ccefd88] at java.lang.Object.wait(Native Method) - waiting on <0x10b19670> (a java.lang.ref.ReferenceQueue$Lock) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:111) - locked <0x10b19670>]]> (a java.lang.ref.ReferenceQueue$Lock)
at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:127)
at sun.java2d.Disposer.run(Disposer.java:100)
at java.lang.Thread.run(Thread.java:534)

"AWT-Windows" daemon prio=7 tid=0x1c6b2370 nid=0x524 runnable
[1cc5f000..1cc5fd8
8]
at sun.awt.windows.WToolkit.eventLoop(Native Method)
at sun.awt.windows.WToolkit.run(WToolkit.java:262)
at java.lang.Thread.run(Thread.java:534)

"Lock thread" prio=5 tid=0x009b2020 nid=0x1fc runnable
at java.net.PlainSocketImpl.socketAccept(Native Method)
at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:353)
- locked ]]> (a java.net.PlainSocketImpl)
at java.net.ServerSocket.implAccept(ServerSocket.java:448)
at java.net.ServerSocket.accept(ServerSocket.java:419)
at com.intellij.idea.e$b_.run(e$b_.java:8)
at java.lang.Thread.run(Thread.java:534)

"DestroyJavaVM" prio=5 tid=0x00235c50 nid=0x53c waiting on condition


"Signal Dispatcher" daemon prio=10 tid=0x009204b0 nid=0x4f8 waiting on
condition


"Finalizer" daemon prio=9 tid=0x0091d648 nid=0x4e8 in Object.wait()
[1c1af000..1
c1afd88]
at java.lang.Object.wait(Native Method)
- waiting on (a java.lang.ref.ReferenceQueue$Lock) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:111) - locked <0x109e0368> (a java.lang.ref.ReferenceQueue$Lock) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:127) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:159) "Reference Handler" daemon prio=10 tid=0x0091c1c0 nid=0x728 in Object.wait() [1c 16f000..1c16fd88] at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:429) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:115) - locked <0x109e0060>]]> (a java.lang.ref.Reference$Lock)

"VM Thread" prio=5 tid=0x0095d2c8 nid=0x790 runnable

"VM Periodic Task Thread" prio=10 tid=0x0023efe8 nid=0x744 waiting on
condition

"Suspend Checker Thread" prio=10 tid=0x0091fb60 nid=0x750 runnable

2 comments

Hi Bas,

Could you send me your source file and settings? I'll try to reproduce it. You can just email them to me at davek ]]> wrq.com.

(I assume you are using the latest version of the plugin.)

-Dave

0

It seems the problem is related to the idea.jar library that the plugin is built with. There doesn't seem to be a way to get one plugin version to run under both 4.0 and #2002.

If I build the plugin with IDEA 4.0 (Aurora), it runs fine on 4.0 but will go into an infinite loop on IDEA build 2002. If I build the plugin with IDEA 2002, it runs fine on 2002 but causes a null pointer exception in IDEA 4.0.

It appears I will have to compile with both environments and upload two versions of the plugin .jar file, one for production 4.0 and one for the EAP.

Unfortunately, the twiki site won't let me upload any files (and barely lets me maintain the plugin page -- the changes are timing out.) So I can't leave a second version there yet. I don't really want to upload a new "Rearranger2" plugin to the plugin manager site, but may have to if the twiki site isn't fixed soon.

Bas, I'll email you a version of Rearranger that should work with #2002; please let me know if it works.

Thanks,
-Dave

0

Please sign in to leave a comment.