Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Infinite loop in InvocationExprent.lambda$isMappingInBounds$18 #356

Open
Geolykt opened this issue Apr 5, 2024 · 0 comments
Open

Infinite loop in InvocationExprent.lambda$isMappingInBounds$18 #356

Geolykt opened this issue Apr 5, 2024 · 0 comments
Labels
bug Something isn't working Priority: Medium Medium priority Subsystem: Writing Anything concerning how expressions are written

Comments

@Geolykt
Copy link
Contributor

Geolykt commented Apr 5, 2024

Vineflower version

1.10.0

Describe the bug

While decompiling the gdx jar version 1.9.11 (https://repo1.maven.org/maven2/com/badlogicgames/gdx/gdx/1.9.11/gdx-1.9.11.jar), Vineflower will deadlock itself. When using --thread-count=1 the log suggest that the decompiler hangs while processing com/badlogic/gdx/utils/OrderedMap.

Additional information

Relevant jstack trace:

2024-04-05 15:12:14
Full thread dump OpenJDK 64-Bit Server VM (17.0.10+7 mixed mode, sharing):

Threads class SMR info:
_java_thread_list=0x00007f279480d880, length=16, elements={
0x00007f287c025a40, 0x00007f287c131070, 0x00007f287c132460, 0x00007f287c1379b0,
0x00007f287c138d70, 0x00007f287c13a190, 0x00007f287c13bb50, 0x00007f287c13d090,
0x00007f287c146500, 0x00007f287c14e450, 0x00007f287c151110, 0x00007f287c3950f0,
0x00007f287c395dc0, 0x00007f287c396dd0, 0x00007f287c397dd0, 0x00007f27cc000ff0
}

"main" #1 prio=5 os_prio=0 cpu=931.81ms elapsed=235.58s tid=0x00007f287c025a40 nid=0x7a20 waiting on condition  [0x00007f288291d000]
   java.lang.Thread.State: WAITING (parking)
	at jdk.internal.misc.Unsafe.park(java.base@17.0.10/Native Method)
	- parking to wait for  <0x0000000680c00000> (a java.util.concurrent.FutureTask)
	at java.util.concurrent.locks.LockSupport.park(java.base@17.0.10/LockSupport.java:211)
	at java.util.concurrent.FutureTask.awaitDone(java.base@17.0.10/FutureTask.java:447)
	at java.util.concurrent.FutureTask.get(java.base@17.0.10/FutureTask.java:190)
	at org.jetbrains.java.decompiler.struct.ContextUnit.waitForAll(ContextUnit.java:226)
	at org.jetbrains.java.decompiler.struct.ContextUnit.save(ContextUnit.java:194)
	at org.jetbrains.java.decompiler.struct.StructContext.saveContext(StructContext.java:178)
	at org.jetbrains.java.decompiler.main.Fernflower.decompileContext(Fernflower.java:149)
	at org.jetbrains.java.decompiler.main.decompiler.ConsoleDecompiler.decompileContext(ConsoleDecompiler.java:246)
	at org.jetbrains.java.decompiler.main.decompiler.ConsoleDecompiler.main(ConsoleDecompiler.java:191)

"Reference Handler" #2 daemon prio=10 os_prio=0 cpu=1.14ms elapsed=235.54s tid=0x00007f287c131070 nid=0x7a27 waiting on condition  [0x00007f2855026000]
   java.lang.Thread.State: RUNNABLE
	at java.lang.ref.Reference.waitForReferencePendingList(java.base@17.0.10/Native Method)
	at java.lang.ref.Reference.processPendingReferences(java.base@17.0.10/Reference.java:253)
	at java.lang.ref.Reference$ReferenceHandler.run(java.base@17.0.10/Reference.java:215)

"Finalizer" #3 daemon prio=8 os_prio=0 cpu=0.18ms elapsed=235.54s tid=0x00007f287c132460 nid=0x7a28 in Object.wait()  [0x00007f2854f26000]
   java.lang.Thread.State: WAITING (on object monitor)
	at java.lang.Object.wait(java.base@17.0.10/Native Method)
	- waiting on <0x000000062b000af8> (a java.lang.ref.ReferenceQueue$Lock)
	at java.lang.ref.ReferenceQueue.remove(java.base@17.0.10/ReferenceQueue.java:155)
	- locked <0x000000062b000af8> (a java.lang.ref.ReferenceQueue$Lock)
	at java.lang.ref.ReferenceQueue.remove(java.base@17.0.10/ReferenceQueue.java:176)
	at java.lang.ref.Finalizer$FinalizerThread.run(java.base@17.0.10/Finalizer.java:172)

"Signal Dispatcher" #4 daemon prio=9 os_prio=0 cpu=0.26ms elapsed=235.54s tid=0x00007f287c1379b0 nid=0x7a29 waiting on condition  [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"Service Thread" #5 daemon prio=9 os_prio=0 cpu=0.21ms elapsed=235.54s tid=0x00007f287c138d70 nid=0x7a2a runnable  [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"Monitor Deflation Thread" #6 daemon prio=9 os_prio=0 cpu=11.58ms elapsed=235.54s tid=0x00007f287c13a190 nid=0x7a2b runnable  [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"C2 CompilerThread0" #7 daemon prio=9 os_prio=0 cpu=13892.67ms elapsed=235.54s tid=0x00007f287c13bb50 nid=0x7a2c waiting on condition  [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE
   No compile task

"C1 CompilerThread0" #9 daemon prio=9 os_prio=0 cpu=2702.94ms elapsed=235.54s tid=0x00007f287c13d090 nid=0x7a2d waiting on condition  [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE
   No compile task

"Sweeper thread" #10 daemon prio=9 os_prio=0 cpu=83.53ms elapsed=235.54s tid=0x00007f287c146500 nid=0x7a2e runnable  [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"Notification Thread" #11 daemon prio=9 os_prio=0 cpu=0.08ms elapsed=235.53s tid=0x00007f287c14e450 nid=0x7a2f runnable  [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"Common-Cleaner" #12 daemon prio=8 os_prio=0 cpu=1.30ms elapsed=235.53s tid=0x00007f287c151110 nid=0x7a31 in Object.wait()  [0x00007f2854625000]
   java.lang.Thread.State: TIMED_WAITING (on object monitor)
	at java.lang.Object.wait(java.base@17.0.10/Native Method)
	- waiting on <0x000000062b000d50> (a java.lang.ref.ReferenceQueue$Lock)
	at java.lang.ref.ReferenceQueue.remove(java.base@17.0.10/ReferenceQueue.java:155)
	- locked <0x000000062b000d50> (a java.lang.ref.ReferenceQueue$Lock)
	at jdk.internal.ref.CleanerImpl.run(java.base@17.0.10/CleanerImpl.java:140)
	at java.lang.Thread.run(java.base@17.0.10/Thread.java:840)
	at jdk.internal.misc.InnocuousThread.run(java.base@17.0.10/InnocuousThread.java:162)

"pool-1-thread-1" #13 prio=5 os_prio=0 cpu=8171.04ms elapsed=234.51s tid=0x00007f287c3950f0 nid=0x7a3c waiting on condition  [0x00007f284dffe000]
   java.lang.Thread.State: WAITING (parking)
	at jdk.internal.misc.Unsafe.park(java.base@17.0.10/Native Method)
	- parking to wait for  <0x000000062daa3900> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
	at java.util.concurrent.locks.LockSupport.park(java.base@17.0.10/LockSupport.java:341)
	at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionNode.block(java.base@17.0.10/AbstractQueuedSynchronizer.java:506)
	at java.util.concurrent.ForkJoinPool.unmanagedBlock(java.base@17.0.10/ForkJoinPool.java:3465)
	at java.util.concurrent.ForkJoinPool.managedBlock(java.base@17.0.10/ForkJoinPool.java:3436)
	at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(java.base@17.0.10/AbstractQueuedSynchronizer.java:1623)
	at java.util.concurrent.LinkedBlockingQueue.take(java.base@17.0.10/LinkedBlockingQueue.java:435)
	at java.util.concurrent.ThreadPoolExecutor.getTask(java.base@17.0.10/ThreadPoolExecutor.java:1062)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(java.base@17.0.10/ThreadPoolExecutor.java:1122)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(java.base@17.0.10/ThreadPoolExecutor.java:635)
	at java.lang.Thread.run(java.base@17.0.10/Thread.java:840)

"pool-1-thread-2" #14 prio=5 os_prio=0 cpu=8907.92ms elapsed=234.51s tid=0x00007f287c395dc0 nid=0x7a3d waiting on condition  [0x00007f284defe000]
   java.lang.Thread.State: WAITING (parking)
	at jdk.internal.misc.Unsafe.park(java.base@17.0.10/Native Method)
	- parking to wait for  <0x000000062daa3900> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
	at java.util.concurrent.locks.LockSupport.park(java.base@17.0.10/LockSupport.java:341)
	at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionNode.block(java.base@17.0.10/AbstractQueuedSynchronizer.java:506)
	at java.util.concurrent.ForkJoinPool.unmanagedBlock(java.base@17.0.10/ForkJoinPool.java:3465)
	at java.util.concurrent.ForkJoinPool.managedBlock(java.base@17.0.10/ForkJoinPool.java:3436)
	at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(java.base@17.0.10/AbstractQueuedSynchronizer.java:1623)
	at java.util.concurrent.LinkedBlockingQueue.take(java.base@17.0.10/LinkedBlockingQueue.java:435)
	at java.util.concurrent.ThreadPoolExecutor.getTask(java.base@17.0.10/ThreadPoolExecutor.java:1062)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(java.base@17.0.10/ThreadPoolExecutor.java:1122)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(java.base@17.0.10/ThreadPoolExecutor.java:635)
	at java.lang.Thread.run(java.base@17.0.10/Thread.java:840)

"pool-1-thread-3" #15 prio=5 os_prio=0 cpu=10575.34ms elapsed=234.51s tid=0x00007f287c396dd0 nid=0x7a3e waiting on condition  [0x00007f284ddfe000]
   java.lang.Thread.State: WAITING (parking)
	at jdk.internal.misc.Unsafe.park(java.base@17.0.10/Native Method)
	- parking to wait for  <0x000000062daa3900> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
	at java.util.concurrent.locks.LockSupport.park(java.base@17.0.10/LockSupport.java:341)
	at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionNode.block(java.base@17.0.10/AbstractQueuedSynchronizer.java:506)
	at java.util.concurrent.ForkJoinPool.unmanagedBlock(java.base@17.0.10/ForkJoinPool.java:3465)
	at java.util.concurrent.ForkJoinPool.managedBlock(java.base@17.0.10/ForkJoinPool.java:3436)
	at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(java.base@17.0.10/AbstractQueuedSynchronizer.java:1623)
	at java.util.concurrent.LinkedBlockingQueue.take(java.base@17.0.10/LinkedBlockingQueue.java:435)
	at java.util.concurrent.ThreadPoolExecutor.getTask(java.base@17.0.10/ThreadPoolExecutor.java:1062)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(java.base@17.0.10/ThreadPoolExecutor.java:1122)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(java.base@17.0.10/ThreadPoolExecutor.java:635)
	at java.lang.Thread.run(java.base@17.0.10/Thread.java:840)

"pool-1-thread-4" #16 prio=5 os_prio=0 cpu=223731.22ms elapsed=234.50s tid=0x00007f287c397dd0 nid=0x7a3f runnable  [0x00007f284dcfb000]
   java.lang.Thread.State: RUNNABLE
	at org.jetbrains.java.decompiler.modules.decompiler.exps.InvocationExprent.lambda$isMappingInBounds$18(InvocationExprent.java:1574)
	at org.jetbrains.java.decompiler.modules.decompiler.exps.InvocationExprent$$Lambda$298/0x00007f27f80d8f58.apply(Unknown Source)
	at org.jetbrains.java.decompiler.modules.decompiler.exps.InvocationExprent.lambda$isMappingInBounds$19(InvocationExprent.java:1643)
	at org.jetbrains.java.decompiler.modules.decompiler.exps.InvocationExprent$$Lambda$304/0x00007f27f80d9ce0.test(Unknown Source)
	at java.util.stream.MatchOps$1MatchSink.accept(java.base@17.0.10/MatchOps.java:90)
	at java.util.ArrayList$ArrayListSpliterator.tryAdvance(java.base@17.0.10/ArrayList.java:1602)
	at java.util.stream.ReferencePipeline.forEachWithCancel(java.base@17.0.10/ReferencePipeline.java:129)
	at java.util.stream.AbstractPipeline.copyIntoWithCancel(java.base@17.0.10/AbstractPipeline.java:527)
	at java.util.stream.AbstractPipeline.copyInto(java.base@17.0.10/AbstractPipeline.java:513)
	at java.util.stream.AbstractPipeline.wrapAndCopyInto(java.base@17.0.10/AbstractPipeline.java:499)
	at java.util.stream.MatchOps$MatchOp.evaluateSequential(java.base@17.0.10/MatchOps.java:230)
	at java.util.stream.MatchOps$MatchOp.evaluateSequential(java.base@17.0.10/MatchOps.java:196)
	at java.util.stream.AbstractPipeline.evaluate(java.base@17.0.10/AbstractPipeline.java:234)
	at java.util.stream.ReferencePipeline.anyMatch(java.base@17.0.10/ReferencePipeline.java:632)
	at org.jetbrains.java.decompiler.modules.decompiler.exps.InvocationExprent.lambda$isMappingInBounds$20(InvocationExprent.java:1643)
	at org.jetbrains.java.decompiler.modules.decompiler.exps.InvocationExprent$$Lambda$299/0x00007f27f80d9190.test(Unknown Source)
	at java.util.stream.MatchOps$1MatchSink.accept(java.base@17.0.10/MatchOps.java:90)
	at java.util.ArrayList$ArrayListSpliterator.tryAdvance(java.base@17.0.10/ArrayList.java:1602)
	at java.util.stream.ReferencePipeline.forEachWithCancel(java.base@17.0.10/ReferencePipeline.java:129)
	at java.util.stream.AbstractPipeline.copyIntoWithCancel(java.base@17.0.10/AbstractPipeline.java:527)
	at java.util.stream.AbstractPipeline.copyInto(java.base@17.0.10/AbstractPipeline.java:513)
	at java.util.stream.AbstractPipeline.wrapAndCopyInto(java.base@17.0.10/AbstractPipeline.java:499)
	at java.util.stream.MatchOps$MatchOp.evaluateSequential(java.base@17.0.10/MatchOps.java:230)
	at java.util.stream.MatchOps$MatchOp.evaluateSequential(java.base@17.0.10/MatchOps.java:196)
	at java.util.stream.AbstractPipeline.evaluate(java.base@17.0.10/AbstractPipeline.java:234)
	at java.util.stream.ReferencePipeline.allMatch(java.base@17.0.10/ReferencePipeline.java:637)
	at org.jetbrains.java.decompiler.modules.decompiler.exps.InvocationExprent.isMappingInBounds(InvocationExprent.java:1643)
	at org.jetbrains.java.decompiler.modules.decompiler.exps.InvocationExprent.putGenericMapping(InvocationExprent.java:1543)
	at org.jetbrains.java.decompiler.modules.decompiler.exps.InvocationExprent.processGenericMapping(InvocationExprent.java:1515)
	at org.jetbrains.java.decompiler.modules.decompiler.exps.InvocationExprent.getInferredExprType(InvocationExprent.java:571)
	at org.jetbrains.java.decompiler.modules.decompiler.exps.InvocationExprent.getInferredExprType(InvocationExprent.java:503)
	at org.jetbrains.java.decompiler.modules.decompiler.ExprProcessor.listToJava(ExprProcessor.java:893)
	at org.jetbrains.java.decompiler.modules.decompiler.stats.BasicBlockStatement.toJava(BasicBlockStatement.java:90)
	at org.jetbrains.java.decompiler.modules.decompiler.ExprProcessor.jmpWrapper(ExprProcessor.java:833)
	at org.jetbrains.java.decompiler.modules.decompiler.stats.DoStatement.toJava(DoStatement.java:141)
	at org.jetbrains.java.decompiler.modules.decompiler.ExprProcessor.jmpWrapper(ExprProcessor.java:833)
	at org.jetbrains.java.decompiler.modules.decompiler.stats.SequenceStatement.toJava(SequenceStatement.java:107)
	at org.jetbrains.java.decompiler.modules.decompiler.stats.RootStatement.toJava(RootStatement.java:36)
	at org.jetbrains.java.decompiler.main.ClassWriter.writeMethod(ClassWriter.java:1283)
	at org.jetbrains.java.decompiler.main.ClassWriter.writeClass(ClassWriter.java:470)
	at org.jetbrains.java.decompiler.main.ClassesProcessor.writeClass(ClassesProcessor.java:474)
	at org.jetbrains.java.decompiler.main.Fernflower.getClassContent(Fernflower.java:191)
	at org.jetbrains.java.decompiler.struct.ContextUnit.lambda$save$3(ContextUnit.java:187)
	at org.jetbrains.java.decompiler.struct.ContextUnit$$Lambda$274/0x00007f27f80d4b00.run(Unknown Source)
	at java.util.concurrent.Executors$RunnableAdapter.call(java.base@17.0.10/Executors.java:539)
	at java.util.concurrent.FutureTask.run(java.base@17.0.10/FutureTask.java:264)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(java.base@17.0.10/ThreadPoolExecutor.java:1136)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(java.base@17.0.10/ThreadPoolExecutor.java:635)
	at java.lang.Thread.run(java.base@17.0.10/Thread.java:840)

"Attach Listener" #17 daemon prio=9 os_prio=0 cpu=0.38ms elapsed=212.63s tid=0x00007f27cc000ff0 nid=0x7a94 waiting on condition  [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"VM Thread" os_prio=0 cpu=30.05ms elapsed=235.54s tid=0x00007f287c12d0e0 nid=0x7a26 runnable  

"GC Thread#0" os_prio=0 cpu=734.07ms elapsed=235.58s tid=0x00007f287c052440 nid=0x7a21 runnable  

"GC Thread#1" os_prio=0 cpu=708.50ms elapsed=235.13s tid=0x00007f27ec0050c0 nid=0x7a33 runnable  

"GC Thread#2" os_prio=0 cpu=623.74ms elapsed=235.13s tid=0x00007f27ec005b00 nid=0x7a34 runnable  

"GC Thread#3" os_prio=0 cpu=694.02ms elapsed=235.13s tid=0x00007f27ec006540 nid=0x7a35 runnable  

"G1 Main Marker" os_prio=0 cpu=0.05ms elapsed=235.58s tid=0x00007f287c0624b0 nid=0x7a22 runnable  

"G1 Conc#0" os_prio=0 cpu=0.09ms elapsed=235.58s tid=0x00007f287c063420 nid=0x7a23 runnable  

"G1 Refine#0" os_prio=0 cpu=38.27ms elapsed=235.58s tid=0x00007f287c0feb60 nid=0x7a24 runnable  

"G1 Refine#1" os_prio=0 cpu=3.65ms elapsed=234.62s tid=0x00007f283c000eb0 nid=0x7a3b runnable  

"G1 Refine#2" os_prio=0 cpu=0.09ms elapsed=216.14s tid=0x00007f277c001750 nid=0x7a84 runnable  

"G1 Service" os_prio=0 cpu=38.56ms elapsed=235.58s tid=0x00007f287c0ffa60 nid=0x7a25 runnable  

"VM Periodic Task Thread" os_prio=0 cpu=66.84ms elapsed=235.53s tid=0x00007f287c14fda0 nid=0x7a30 waiting on condition  

JNI global refs: 9, weak refs: 0

Using VisualVM and making use of the jstack command multiple times suggests that the VM stays in this method and does not leave it or call another method, furthermore no notable heap allocations are performed (though it slowly accumulates memory nevertheless).

@Geolykt Geolykt added the bug Something isn't working label Apr 5, 2024
@jaskarth jaskarth added Subsystem: Writing Anything concerning how expressions are written Priority: Medium Medium priority labels Apr 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Priority: Medium Medium priority Subsystem: Writing Anything concerning how expressions are written
Projects
None yet
Development

No branches or pull requests

2 participants