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

[instrumentation] "Object (...) should not be materialized" errors #1445

Closed
fniephaus opened this issue Jun 27, 2019 · 6 comments
Closed

[instrumentation] "Object (...) should not be materialized" errors #1445

fniephaus opened this issue Jun 27, 2019 · 6 comments
Assignees

Comments

@fniephaus
Copy link
Member

When using the Chrome debugger via the --inspect option, we see quite a few compiler errors (such as the one below) for our language. It seems that the compiler is unable to optimize a call target due to a Frame#materialize() call. How can this be fixed?

[truffle] opt fail         Heap>>downHeapSingle: <split-463685c6>                      |Reason org.graalvm.compiler.code.SourceStackTraceBailoutException$1: Object of type Lorg/graalvm/compiler/truffle/runtime/FrameWithoutBoxing; shoul
d not be materialized:                                                                                                                                                                                                                     
org.graalvm.compiler.code.SourceStackTraceBailoutException$1: Object of type Lorg/graalvm/compiler/truffle/runtime/FrameWithoutBoxing; should not be materialized:                                                                         
        at com.oracle.truffle.api.debug.DebuggerSession$SteppingNode.onEnter(DebuggerSession.java:1286)                                                                                                                                    
        at com.oracle.truffle.api.debug.DebuggerSession$RootSteppingDepthNode.onEnter(DebuggerSession.java:1378)                                                                                                                           
        at com.oracle.truffle.api.instrumentation.ProbeNode$EventProviderChainNode.innerOnEnter(ProbeNode.java:1449)                                                                                                                       
        at com.oracle.truffle.api.instrumentation.ProbeNode$EventChainNode.onEnter(ProbeNode.java:898)                                                                                                                                     
        at com.oracle.truffle.api.instrumentation.ProbeNode.onEnter(ProbeNode.java:156)                                                                                                                                                    
        at de.hpi.swa.graal.squeak.nodes.EnterCodeNodeWrapper.execute(EnterCodeNodeWrapper.java:44)                                                                                                                                        
        at de.hpi.swa.graal.squeak.nodes.EnterCodeNode$SqueakCodeRootNode.execute(EnterCodeNode.java:61)                                                                                                                                   
        at org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callProxy(OptimizedCallTarget.java:325)                                                                                                                                
        at org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callRoot(OptimizedCallTarget.java:315)                                                                                                                                 
Caused by: org.graalvm.compiler.graph.VerificationError: Object of type Lorg/graalvm/compiler/truffle/runtime/FrameWithoutBoxing; should not be materialized:                                                                              
        at org.graalvm.compiler.nodes.virtual.EnsureVirtualizedNode.ensureVirtualFailure(EnsureVirtualizedNode.java:98)                                                                                                                    
        at org.graalvm.compiler.nodes.virtual.EnsureVirtualizedNode.lower(EnsureVirtualizedNode.java:82)                                                                                                                                   
        at org.graalvm.compiler.phases.common.LoweringPhase$Round.process(LoweringPhase.java:476)                                                                                                                                          
        at org.graalvm.compiler.phases.common.LoweringPhase$Round.access$200(LoweringPhase.java:352)                                                                                                                                       
        at org.graalvm.compiler.phases.common.LoweringPhase$Round$ProcessFrame.preprocess(LoweringPhase.java:416)                                                                                                                          
        at org.graalvm.compiler.phases.common.LoweringPhase.processBlock(LoweringPhase.java:575)                                                                                                                                           
        at org.graalvm.compiler.phases.common.LoweringPhase$Round.run(LoweringPhase.java:401)                                                                                                                                              
        at org.graalvm.compiler.phases.Phase.run(Phase.java:49)                                                                                                                                                                            
        at org.graalvm.compiler.phases.BasePhase.apply(BasePhase.java:197)                                                                                                                                                                 
        at org.graalvm.compiler.phases.BasePhase.apply(BasePhase.java:139)                                                                                                                                                                 
        at org.graalvm.compiler.phases.PhaseSuite.run(PhaseSuite.java:212)                                                                                                                                                                 
        at org.graalvm.compiler.phases.common.IncrementalCanonicalizerPhase.run(IncrementalCanonicalizerPhase.java:56)                                                                                                                     
        at org.graalvm.compiler.phases.common.IncrementalCanonicalizerPhase.run(IncrementalCanonicalizerPhase.java:38)                                                                                                                     
        at org.graalvm.compiler.phases.BasePhase.apply(BasePhase.java:197)                                                                                                                                                                 
        at org.graalvm.compiler.phases.BasePhase.apply(BasePhase.java:139)                                                                                                                                                                 
        at org.graalvm.compiler.phases.common.LoweringPhase.lower(LoweringPhase.java:272)                                                                                                                                                  
        at org.graalvm.compiler.phases.common.LoweringPhase.run(LoweringPhase.java:265)                                                                                                                                                    
        at org.graalvm.compiler.phases.common.LoweringPhase.run(LoweringPhase.java:95)                                                                                                                                                     
        at org.graalvm.compiler.phases.BasePhase.apply(BasePhase.java:197)                                                                                                                                                                 
        at org.graalvm.compiler.phases.BasePhase.apply(BasePhase.java:139)                                                                                                                                                                 
        at org.graalvm.compiler.phases.PhaseSuite.run(PhaseSuite.java:212)                                                                                                                                                                 
        at org.graalvm.compiler.phases.BasePhase.apply(BasePhase.java:197)                                                                                                                                                                 
        at org.graalvm.compiler.phases.BasePhase.apply(BasePhase.java:139)                                                                                                                                                                 
        at org.graalvm.compiler.core.GraalCompiler.emitFrontEnd(GraalCompiler.java:220)                                                                                                                                                    
        at org.graalvm.compiler.core.GraalCompiler.compile(GraalCompiler.java:144)                                                                                                                                                         
        at org.graalvm.compiler.core.GraalCompiler.compileGraph(GraalCompiler.java:129)                                                                                                                                                    
        at org.graalvm.compiler.truffle.compiler.TruffleCompilerImpl.compilePEGraph(TruffleCompilerImpl.java:518)                                                                                                                          
        at org.graalvm.compiler.truffle.compiler.TruffleCompilerImpl.compileAST(TruffleCompilerImpl.java:452)                                                                                                                              
        at org.graalvm.compiler.truffle.compiler.TruffleCompilerImpl$TruffleCompilationWrapper.performCompilation(TruffleCompilerImpl.java:621)                                                                                            
        at org.graalvm.compiler.truffle.compiler.TruffleCompilerImpl$TruffleCompilationWrapper.performCompilation(TruffleCompilerImpl.java:568)                                                                                            
        at org.graalvm.compiler.core.CompilationWrapper.run(CompilationWrapper.java:177)                                                                                                                                                   
        at org.graalvm.compiler.truffle.compiler.TruffleCompilerImpl.doCompile(TruffleCompilerImpl.java:280)                                                                                                                               
        at org.graalvm.compiler.truffle.compiler.hotspot.libgraal.HotSpotToSVMEntryPoints.doCompile(HotSpotToSVMEntryPoints.java:251)   
@woess
Copy link
Member

woess commented Jun 27, 2019

Do you have CompilerDirectives.ensureVirtualized somewhere in your code?

@fniephaus
Copy link
Member Author

Good catch, yes I do. Apart from removing it, is there any other way to work around this problem?

@woess
Copy link
Member

woess commented Jul 1, 2019

I'm afraid that's the only way to fix this problem currently, since the SteppingNode materializes the frame.

@fniephaus
Copy link
Member Author

Thanks for the info!

@chumer
Copy link
Member

chumer commented Jul 4, 2019

@fniephaus you may still use CompilerDirectives.ensureVirtualized in unit tests, maybe even use instrumentation to insert the check.

@fniephaus
Copy link
Member Author

@chumer I realized that CompilerDirectives.ensureVirtualized is barely used in any of the language implementations. Also, I saw that TCK deploys checks via the instrument API. That's probably a good idea. Thanks for the idea!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants