Monday, September 27, 2010

[android-developers] Re: VerifyError reloaded

VerifyError occurs for two basic reasons:

1) An error in the bytecodes.
2) An error due to a mismatch between two different class files.

It's really unusual to find a case for reason (1) but you apparently
"lucked out".
If this is code that runs OK in a regular Java environment but fails
on Android then I would suspect a bug in the Android verifier (or
perhaps a "feechur" -- some sort of limitation/restriction).

Apparently fadden suspects a bug in the Android verifier as well.

On Sep 25, 2:33 pm, Dirk <dirkb...@googlemail.com> wrote:
> Hi,
> I'm currently trying to port the famous complex event processing
> runtime "Esper" to the Android (2.2) platform and am facing a
> VerifyError, which I - although reading several other post on
> VerifyErrors - do not understand.
>
> The project I am trying to build and run contains only Java sources
> (no libraries). Therefore, I assume, that if these are compiled
> successfully, they would pass the verification process. But during
> runtime, I get the following error:
>
> 09-25 18:33:27.549: WARN/dalvikvm(300): VFY: invalid switch start: at
> 8, switch offset -31132, count 34530
> 09-25 18:33:27.549: WARN/dalvikvm(300): VFY:  rejected Lcom/espertech/
> esper/epl/generated/EsperEPL2GrammarParser
> $DFA156;.specialStateTransition (ILorg/antlr/runtime/IntStream;)I
> 09-25 18:33:27.549: WARN/dalvikvm(300): Verifier rejected class Lcom/
> espertech/esper/epl/generated/EsperEPL2GrammarParser$DFA156;
> 09-25 18:33:27.559: DEBUG/AndroidRuntime(300): Shutting down VM
> 09-25 18:33:27.559: WARN/dalvikvm(300): threadid=1: thread exiting
> with uncaught exception (group=0x4001d800)
> 09-25 18:33:27.589: ERROR/AndroidRuntime(300): FATAL EXCEPTION: main
> 09-25 18:33:27.589: ERROR/AndroidRuntime(300): java.lang.VerifyError:
> com.espertech.esper.epl.generated.EsperEPL2GrammarParser$DFA156
> 09-25 18:33:27.589: ERROR/AndroidRuntime(300):     at
> com.espertech.esper.epl.generated.EsperEPL2GrammarParser.<init>(EsperEPL2GrammarParser.java:
> 28870)
> 09-25 18:33:27.589: ERROR/AndroidRuntime(300):     at
> com.espertech.esper.epl.generated.EsperEPL2GrammarParser.<init>(EsperEPL2GrammarParser.java:
> 338)
> 09-25 18:33:27.589: ERROR/AndroidRuntime(300):     at
> com.espertech.esper.epl.parse.ParseHelper.parse(ParseHelper.java:108)
> 09-25 18:33:27.589: ERROR/AndroidRuntime(300):     at
> com.espertech.esper.core.EPAdministratorImpl.compileEPL(EPAdministratorImpl.java:
> 299)
> 09-25 18:33:27.589: ERROR/AndroidRuntime(300):     at
> com.espertech.esper.core.EPAdministratorImpl.createEPLStmt(EPAdministratorImpl.java:
> 142)
> 09-25 18:33:27.589: ERROR/AndroidRuntime(300):     at
> com.espertech.esper.core.EPAdministratorImpl.createEPL(EPAdministratorImpl.java:
> 94)
> 09-25 18:33:27.589: ERROR/AndroidRuntime(300):     at
> esper.android.EsperAndroidTest.onCreate(EsperAndroidTest.java:39)
> 09-25 18:33:27.589: ERROR/AndroidRuntime(300):     at
> android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:
> 1047)
> 09-25 18:33:27.589: ERROR/AndroidRuntime(300):     at
> android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
> 2627)
> 09-25 18:33:27.589: ERROR/AndroidRuntime(300):     at
> android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:
> 2679)
> 09-25 18:33:27.589: ERROR/AndroidRuntime(300):     at
> android.app.ActivityThread.access$2300(ActivityThread.java:125)
> 09-25 18:33:27.589: ERROR/AndroidRuntime(300):     at
> android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
> 09-25 18:33:27.589: ERROR/AndroidRuntime(300):     at
> android.os.Handler.dispatchMessage(Handler.java:99)
> 09-25 18:33:27.589: ERROR/AndroidRuntime(300):     at
> android.os.Looper.loop(Looper.java:123)
> 09-25 18:33:27.589: ERROR/AndroidRuntime(300):     at
> android.app.ActivityThread.main(ActivityThread.java:4627)
> 09-25 18:33:27.589: ERROR/AndroidRuntime(300):     at
> java.lang.reflect.Method.invokeNative(Native Method)
> 09-25 18:33:27.589: ERROR/AndroidRuntime(300):     at
> java.lang.reflect.Method.invoke(Method.java:521)
> 09-25 18:33:27.589: ERROR/AndroidRuntime(300):     at
> com.android.internal.os.ZygoteInit
> $MethodAndArgsCaller.run(ZygoteInit.java:868)
> 09-25 18:33:27.589: ERROR/AndroidRuntime(300):     at
> com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
> 09-25 18:33:27.589: ERROR/AndroidRuntime(300):     at
> dalvik.system.NativeStart.main(Native Method)
>
> The source of "EsperEPL2GrammarParser" is quite big ( > 40,000 lines)
> and so is the above mentioned inner class DFA156, which mainly
> contains a switch-statement (> 60 cases) and each case contains
> several (> 50?) if-then-else statements. Just an idea ... when reading
> the error message above (invalid switch start: at 8, switch offset
> -31132, count 34530) my alarm bells ring, cause some values around
> 32768 (16 bit range) always make me nervous.
>
> Nevertheless, I am confused with this VerifyError and would appreciate
> any help getting closer to the error's source. What can I do to
> encircle the error ?
>
> Thanks in advance,
> Cheers Dirk

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

No comments:

Post a Comment