Crash on current head + switchpoint patch (original) (raw)
Rémi Forax forax at univ-mlv.fr
Thu Sep 1 18:11:34 PDT 2011
- Previous message: Crash on current head + switchpoint patch
- Next message: Crash on current head + switchpoint patch
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On 09/02/2011 02:13 AM, Tom Rodriguez wrote:
I reproduced it. Basically we've chosen to inline a method handle because that's what we do but the profile for the call site says it's never been invoked, so the invokecount is 0. When we try to use that zero as a scale for inlining tests of callees we get a div by zero. The problem has always been there I think but it was masked by the inline size cutoffs. We may want to emit uncommon traps for invokedynamic call sites that haven't been reached according to profiles. I filed 7086187 for this. If you need a workaround, this should work.
diff -r a32de5085326 src/share/vm/opto/bytecodeInfo.cpp --- a/src/share/vm/opto/bytecodeInfo.cpp +++ b/src/share/vm/opto/bytecodeInfo.cpp @@ -145,7 +145,7 @@ } assert(invokecount != 0, "require invocation count greater than zero"); - int freq = callsitecount / invokecount; + int freq = invokecount> 0 ? (callsitecount / invokecount) : 0; // bump the max size if the call is frequent if ((freq>= InlineFrequencyRatio) || You'd need to disable the assert too if you wanted to run fastdebug. By the way, after working around it, I get this: dbx) c MethodHandleStatics.java:102:in
newIllegalArgumentException': java.lang.IllegalArgumentException: target and fallback types must match: (ThreadContext,IRubyObject,IRubyObject,String)IRubyObject != (JRubyCallSite,ThreadContext,IRubyObject,IRubyObject,String)IRubyObject_ _from MethodHandles.java:2166:in
misMatchedTypes' from MethodHandles.java:2150:inguardWithTest'_ _from SwitchPoint.java:173:in
guardWithTest' from InvokeDynamicSupport.java:660:inupdateInvocationTarget'_ _from InvokeDynamicSupport.java:462:in
invocationFallback' from ./redblacktree.rb:68:inmethod_11$RUBY$initialize'_ _from <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>d</mi><mi>o</mi><mi>t</mi></mrow><annotation encoding="application/x-tex">dot</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6944em;"></span><span class="mord mathnormal">d</span><span class="mord mathnormal">o</span><span class="mord mathnormal">t</span></span></span></span>redblacktree$method_11$RUBY$initialize:65535:in
call' from CachingCallSite.java:142:incallBlock'_ _from CachingCallSite.java:148:in
call' from RubyClass.java:798:innewInstance'_ _from RubyClass$i$newInstance.gen:65535:in
call' from JavaMethod.java:256:incall'_ _from MethodHandle.java:566:in
invokeWithArguments' from InvokeDynamicSupport.java:464:ininvocationFallback'_ _from bm1.rb:16:in
method_0$RUBY$rbtbm' from bm1$method_0$RUBY$rbtbm:65535:incall'_ _from bm1$method_0$RUBY$rbtbm:65535:in
call' from MethodHandle.java:566:ininvokeWithArguments'_ _from InvokeDynamicSupport.java:464:in
invocationFallback' from bm1.rb:30:inblock10$RUBY$_file_'_ _from bm1$block10$RUBY$_file_:65535:in
call' from CompiledBlock.java:112:inyield'_ _from CompiledBlock.java:95:in
yield' from Block.java:130:inyield'_ _from RubyFixnum.java:252:in
times' from MethodHandleImpl.java:1154:ininvokeL5'_ _from MethodHandleImpl.java:1154:in
invokeL5' from MethodHandle.java:566:ininvokeWithArguments'_ _from InvokeDynamicSupport.java:538:in
invocationFallback' from bm1.rb:29:in_file_'_ _from bm1.rb:-1:in
load' from Ruby.java:715:inrunScript'_ _from Ruby.java:708:in
runScript' from Ruby.java:615:inrunNormally'_ _from Ruby.java:464:in
runFromMain' from Main.java:317:indoRunFromMain'_ _from Main.java:237:in
internalRun' from Main.java:203:inrun'_ _from Main.java:187:in
run' from Main.java:167:in `main'
oups, Charles, you forget to bind the callsite :)
Anyway, thanks for the report. tom
Rémi
- Previous message: Crash on current head + switchpoint patch
- Next message: Crash on current head + switchpoint patch
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the hotspot-compiler-dev mailing list