cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

This product reached the end of support date on March 31, 2021.

java.lang.VerifyError on instrumented lambda's of Runnable signature

tuur_bressinck
Newcomer

I work on a java 8 application that uses Vaadin on which a Dynatrace agent (Dynatrace Appmon 7.2.3.1030 - 2018 October) is enabled. After an upgrade of Vaadin from 7.x to 8.4.5 the following exception started appearing:

Caused by: com.vaadin.event.ListenerMethod$MethodException: Invocation of method onDataChange in com.vaadin.data.provider.DataCommunicator$$Lambda$1591/1760678401 failed.
at com.vaadin.event.ListenerMethod.receiveEvent(ListenerMethod.java:519)
at com.vaadin.event.EventRouter.fireEvent(EventRouter.java:273)
at com.vaadin.event.EventRouter.fireEvent(EventRouter.java:237)
at com.vaadin.data.provider.AbstractDataProvider.fireEvent(AbstractDataProvider.java:90)
at com.vaadin.data.provider.AbstractDataProvider.refreshAll(AbstractDataProvider.java:51)
at be.**************.FillMoreFavorableSituationTableController$6.buttonClick(FillMoreFavorableSituationTableController.java:235)
at sun.reflect.GeneratedMethodAccessor1354.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.vaadin.event.ListenerMethod.receiveEvent(ListenerMethod.java:499)
... 56 more
Caused by: java.lang.BootstrapMethodError: call site initialization exception
at java.lang.invoke.CallSite.makeSite(CallSite.java:341)
at java.lang.invoke.MethodHandleNatives.linkCallSiteImpl(MethodHandleNatives.java:307)
at java.lang.invoke.MethodHandleNatives.linkCallSite(MethodHandleNatives.java:297)
at com.vaadin.data.provider.DataCommunicator.lambda$attachDataProviderListener$7a32c94f$1(DataCommunicator.java:769)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.vaadin.event.ListenerMethod.receiveEvent(ListenerMethod.java:499)
... 65 more
Caused by: java.lang.VerifyError: (class: com/vaadin/data/provider/DataCommunicator$$Lambda$1633, method: run signature: ()V) Illegal use of nonvirtual function call
at sun.misc.Unsafe.defineAnonymousClass(Native Method)
at java.lang.invoke.InnerClassLambdaMetafactory.spinInnerClass(InnerClassLambdaMetafactory.java:326)
at java.lang.invoke.InnerClassLambdaMetafactory.buildCallSite(InnerClassLambdaMetafactory.java:194)
at java.lang.invoke.LambdaMetafactory.metafactory(LambdaMetafactory.java:304)
at java.lang.invoke.CallSite.makeSite(CallSite.java:302)
... 73 more

The code at line769 in com.vaadin.data.provider.DataCommunicator reads:

getUI().access(() -> markAsDirty());

The method UI.access takes a Runnable, but in this case it's being called with a lambda. This, in combination with an active "Thread Start Tagging" sensor pack in Dynatrace, seems to cause the VerifyError. (from the documentation: The Thread Start Tagging Sensor adds the TraceTag to a local field of the Runnable object that is used to start the thread. A concurrency problem occurs if the same Runnable object is started twice concurrently.)

More in detail, what I think is happening: The jvm converts a lambda at runtime to an anonymous class, dynatrace will then instrument that generated bytecode but the resulting bytecode does not pass the verification step in the JVM.

For now I have disabled the "Thread Start Tagging" sensor pack as a workaround, but this reduces the amount of information that Dynatrace gathers. Has anyone had any similar experiences and/or better solutions?


2 REPLIES 2

sebastian_kryst
DynaMight Leader
DynaMight Leader

I think it will be better to open support ticket for such case.

Sebastian


tuur_bressinck
Newcomer

Ok, I'll do that. Thanks for your quick answer.