#520 Hang in OSR_OsrPointConstructor

closed
6
2012-09-21
2006-06-22
No

Compiling the below OPT_Test.testFailing method
causes the optimizing
compiler to go into an infinite loop. A work around
is to use
testWorking instead which is equivalent for my
purposes.


public class OPT_Test
{
static int i;
static void testWorking ()
{
while (i != 0) {
;
}
}
static void testFailing ()
{
if (i != 0) {
for (;;) {
;
}
}
}
}


Here is the output from the OptTestHarness from
jikesrvm 2.4.2:


$ rvm OptTestHarness -oc:verbose=true -
oc:phases=true -oc:print_all_ir=true -method OPT_Test
testFailing -
Compiling 0 methods baseline
Compiling 1 methods opt
-methodOpt OPT_Test testFailing ()V
Generate HIR done
* START OF IR DUMP After Generate HIR FOR
OPT_Test.testFailing ()V
-13 LABEL0 Frequency: 0.0
-2 EG ir_prologue
-1 bbend BB0 (ENTRY)
0 LABEL2 Frequency: 0.0
0 getstatic t0i(I) = Addr
0x000158f8, <mem loc:="" LOPT_Test;.i="">
3 int_ifcmp t1v(GUARD) = t0i
(I), 0, ==, LABEL3, Probability: 0.5
-1 bbend BB2
6 LABEL4 Frequency: 0.0
-1 bbend BB4
9 LABEL5 Frequency: 0.0
9 goto LABEL5
-1 bbend BB5
12 LABEL3 Frequency: 0.0
12 goto LABEL1
-1 bbend BB3
-14 LABEL1 Frequency: 0.0
-3 return <unused>
-1 bbend BB1
*
END OF IR DUMP After Generate HIR FOR
OPT_Test.testFailing ()V
AdjustBytecodeIndexes done
* START OF IR DUMP After
AdjustBytecodeIndexes FOR OPT_Test.testFailing ()V
-13 LABEL0 Frequency: 0.0
-2 EG ir_prologue
-1 bbend BB0 (ENTRY)
0 LABEL2 Frequency: 0.0
0 getstatic t0i(I) = Addr
0x000158f8, <mem loc:="" LOPT_Test;.i="">
3 int_ifcmp t1v(GUARD) = t0i
(I), 0, ==, LABEL3, Probability: 0.5
-1 bbend BB2
6 LABEL4 Frequency: 0.0
-1 bbend BB4
9 LABEL5 Frequency: 0.0
9 goto LABEL5
-1 bbend BB5
12 LABEL3 Frequency: 0.0
12 goto LABEL1
-1 bbend BB3
-14 LABEL1 Frequency: 0.0
-3 return <unused>
-1 bbend BB1
*
END OF IR DUMP After
AdjustBytecodeIndexes FOR OPT_Test.testFailing ()V
OSR_OsrPointConstructor
------------------------------------------------------
at this point it hangs. If I run with verbose
logging, I can see where
in the OSR_OsrPointConstructor things are hanging:
------------------------------------------------------
OSR_OsrPointConstructorEntered
VM_Interface.triggerCollection(). Stack:
-- Stack --
Lorg/mmtk/vm/Collection; triggerCollection(I)V at
line 122
Lorg/mmtk/plan/marksweep/MS; poll
(ZLorg/mmtk/policy/Space;)Z at line 145
Lorg/mmtk/policy/Space; acquire(I)
Lorg/vmmagic/unboxed/Address; at line 451
Lorg/mmtk/utility/alloc/BlockAllocator; allocSlow
(I)Lorg/vmmagic/unboxed/Address; at line 185
Lorg/mmtk/utility/alloc/BlockAllocator; alloc(I)
Lorg/vmmagic/unboxed/Address; at line 104
Lorg/mmtk/utility/alloc/SegregatedFreeList;
expandSizeClass(I)Lorg/vmmagic/unboxed/Address; at
line 277
Lorg/mmtk/utility/alloc/SegregatedFreeList;
allocSlowOnce(IIIZ)Lorg/vmmagic/unboxed/Address; at
line 253
Lorg/mmtk/utility/alloc/Allocator; allocSlowBody
(IIIZ)Lorg/vmmagic/unboxed/Address; at line 167
Lorg/mmtk/utility/alloc/Allocator; allocSlow(IIIZ)
Lorg/vmmagic/unboxed/Address; at line 157
Lorg/mmtk/utility/alloc/SegregatedFreeList; alloc
(IIIZ)Lorg/vmmagic/unboxed/Address; at line 156
Lorg/mmtk/plan/marksweep/MSLocal; alloc(IIII)
Lorg/vmmagic/unboxed/Address; at line 86

Lcom/ibm/JikesRVM/memoryManagers/mmInterface/MM_Interf
ace; allocateSpace
(Lcom/ibm/JikesRVM/memoryManagers/mmInterface/Selected
PlanLocal;IIIZILorg/vmmagic\ /unboxed/ObjectReference;)
Lorg/vmmagic/unboxed/Address; at line 672

Lcom/ibm/JikesRVM/memoryManagers/mmInterface/MM_Interf
ace; allocateSpace
(Lcom/ibm/JikesRVM/memoryManagers/mmInterface/Selected
PlanLocal;IIII)Lorg/vmmagic\ /unboxed/Address; at line 622

Lcom/ibm/JikesRVM/memoryManagers/mmInterface/MM_Interf
ace; allocateScalar(I[Ljava/lang/Object;III)
Ljava/lang/Object; at line 566
Lcom/ibm/JikesRVM/VM_Runtime; resolvedNewScalar(I
[Ljava/lang/Object;ZIII)Ljava/lang/Object; at line 342
Lcom/ibm/JikesRVM/opt/OPT_SpaceEffGraphNode;
insertOut
(Lcom/ibm/JikesRVM/opt/OPT_SpaceEffGraphNode;)V at
line 260
Lcom/ibm/JikesRVM/opt/ir/OPT_BasicBlock;
recomputeNormalOut(Lcom/ibm/JikesRVM/opt/ir/OPT_IR;)V
at line 1192
Lcom/ibm/JikesRVM/opt/OPT_BranchOptimizations;
processConditionalBranch
(Lcom/ibm/JikesRVM/opt/ir/OPT_IR;Lcom/ibm/JikesRVM/opt
/ir/OPT_Instruction;Lcom/ibm\ /JikesRVM/opt/ir/OPT_BasicBlock;)Z at line 252
Lcom/ibm/JikesRVM/opt/OPT_BranchOptimizations;
optimizeBranchInstruction
(Lcom/ibm/JikesRVM/opt/ir/OPT_IR;Lcom/ibm/JikesRVM/opt
/ir/OPT_Instruction;Lcom/ib\ m/JikesRVM/opt/ir/OPT_BasicBlock;)Z at line 74

Lcom/ibm/JikesRVM/opt/OPT_BranchOptimizationDriver;
applyPeepholeBranchOpts
(Lcom/ibm/JikesRVM/opt/ir/OPT_IR;)Z at line 105

Lcom/ibm/JikesRVM/opt/OPT_BranchOptimizationDriver;
perform(Lcom/ibm/JikesRVM/opt/ir/OPT_IR;Z)V at line 76

Lcom/ibm/JikesRVM/opt/OPT_BranchOptimizationDriver;
perform(Lcom/ibm/JikesRVM/opt/ir/OPT_IR;)V at line 64
Lcom/ibm/JikesRVM/opt/OSR_OsrPointConstructor;
perform(Lcom/ibm/JikesRVM/opt/ir/OPT_IR;)V at line 72
Lcom/ibm/JikesRVM/opt/OPT_CompilerPhase;
performPhase(Lcom/ibm/JikesRVM/opt/ir/OPT_IR;)V at
line 129

Lcom/ibm/JikesRVM/opt/OPT_OptimizationPlanAtomicElemen
t; perform(Lcom/ibm/JikesRVM/opt/ir/OPT_IR;)V at line
80

Lcom/ibm/JikesRVM/opt/OPT_OptimizationPlanCompositeEle
ment; perform(Lcom/ibm/JikesRVM/opt/ir/OPT_IR;)V at
line 141
Lcom/ibm/JikesRVM/opt/OPT_CompilationPlan; execute
()Lcom/ibm/JikesRVM/opt/ir/OPT_IR; at line 105
Lcom/ibm/JikesRVM/opt/OPT_Compiler; compile
(Lcom/ibm/JikesRVM/opt/OPT_CompilationPlan;)
Lcom/ibm/JikesRVM/VM_CompiledMethod; at line 222
LOptTestHarness; compileMethodsInVector()V at line
334
LOptTestHarness; executeCommand()V at line 353
LOptTestHarness; main([Ljava/lang/String;)V at
line 396
<invisible method="">
Lcom/ibm/JikesRVM/VM_Reflection; invoke
(Lcom/ibm/JikesRVM/classloader/VM_Method;Ljava/lang/Ob
ject;[Ljava/lang/Object;Z)Ljava/lang/Object; at line
118
Lcom/ibm/JikesRVM/VM_Reflection; invoke
(Lcom/ibm/JikesRVM/classloader/VM_Method;Ljava/lang/Ob
ject;[Ljava/lang/Object;)Ljava/lang/Object; at line 32
Ljava/lang/reflect/Method; invoke
(Ljava/lang/Object;[Ljava/lang/Object;)
Ljava/lang/Object; at line 132
Ltcc/RunLESS; main([Ljava/lang/String;)V at line
111
Lcom/ibm/JikesRVM/MainThread; run()V at line 120
Lcom/ibm/JikesRVM/VM_Thread; run()V at line 204
Lcom/ibm/JikesRVM/VM_Thread; startoff()V at line
803
Collection triggered due to resource exhaustion


This stack trace from GC is not from 2.4.2, but from
a build from CVS
taken at "2005-12-09 03:00:00". If I leave rvm
running, it repeated
garbage collects with this same stack trace.

Discussion

  • Ian Rogers

    Ian Rogers - 2007-07-19

    Logged In: YES
    user_id=308843
    Originator: NO

    This bug still effects Jikes RVM 2.9.1.

     
  • Daniel Frampton

    Daniel Frampton - 2007-07-19

    Logged In: YES
    user_id=1215450
    Originator: NO

    Fixed in r13100

     

Log in to post a comment.