linkedin / dexmaker

A utility for doing compile or runtime code generation targeting Android's Dalvik VM
Apache License 2.0
1.88k stars 249 forks source link

UI test cases failing on API 34 #190

Open varunajaygupta opened 7 months ago

varunajaygupta commented 7 months ago

Hi,
After upgrading the compileSdk and targetSdk to API 34, UI test cases have encountered failures specifically on the API 34 emulator. However, they continue to function as expected on emulators running API 33 or lower.

Unable to match the desired swap behavior.
2024-04-22 10:50:25.852  5379-5397  components.test         com...spf.common.ui.components.test  A  dex_file.h:530] Check failed: &proto_id < proto_ids_ + header_->proto_ids_size_ (&proto_id=0x744937e504, proto_ids_ + header_->proto_ids_size_=0x719aa434b0) /apex/com.android.art/javalib/core-oj.jar
2024-04-22 10:50:26.183  5379-5397  components.test         com...spf.common.ui.components.test  A  runtime.cc:691] Runtime aborting...
                                                                                                    runtime.cc:691] All threads:
                                                                                                    runtime.cc:691] DALVIK THREADS (26):
                                                                                                    runtime.cc:691] "main" prio=10 tid=1 Native
                                                                                                    runtime.cc:691]   | group="" sCount=1 ucsCount=0 flags=1 obj=0x71bdecd8 self=0xb40000722358cf50
                                                                                                    runtime.cc:691]   | sysTid=5379 nice=-10 cgrp=top-app sched=0/0 handle=0x746a5f94f8
                                                                                                    runtime.cc:691]   | state=S schedstat=( 326024440 30341753 369 ) utm=28 stm=3 core=3 HZ=100
                                                                                                    runtime.cc:691]   | stack=0x7fe13cd000-0x7fe13cf000 stackSize=8188KB
                                                                                                    runtime.cc:691]   | held mutexes=
                                                                                                    runtime.cc:691]   native: #00 pc 00062e1c  /apex/com.android.runtime/lib64/bionic/libc.so (syscall+28) (BuildId: a87908b48b368e6282bcc9f34bcfc28c)
                                                                                                    runtime.cc:691]   native: #01 pc 0022cfac  /apex/com.android.art/lib64/libart.so (art::ConditionVariable::WaitHoldingLocks+140) (BuildId: b10f5696fea1b32039b162aef3850ed3)
                                                                                                    runtime.cc:691]   native: #02 pc 00427e50  /apex/com.android.art/lib64/libart.so (artQuickGenericJniEndTrampoline+960) (BuildId: b10f5696fea1b32039b162aef3850ed3)
                                                                                                    runtime.cc:691]   native: #03 pc 00377040  /apex/com.android.art/lib64/libart.so (art_quick_generic_jni_trampoline+160) (BuildId: b10f5696fea1b32039b162aef3850ed3)
                                                                                                    runtime.cc:691]   native: #04 pc 003605a4  /apex/com.android.art/lib64/libart.so (art_quick_invoke_stub+612) (BuildId: b10f5696fea1b32039b162aef3850ed3)
                                                                                                    runtime.cc:691]   native: #05 pc 004906b4  /apex/com.android.art/lib64/libart.so (bool art::interpreter::DoCall<false>+1248) (BuildId: b10f5696fea1b32039b162aef3850ed3)
                                                                                                    runtime.cc:691]   native: #06 pc 00509f94  /apex/com.android.art/lib64/libart.so (void art::interpreter::ExecuteSwitchImplCpp<false>+780) (BuildId: b10f5696fea1b32039b162aef3850ed3)
                                                                                                    runtime.cc:691]   native: #07 pc 003797d8  /apex/com.android.art/lib64/libart.so (ExecuteSwitchImplAsm+8) (BuildId: b10f5696fea1b32039b162aef3850ed3)
                                                                                                    runtime.cc:691]   native: #08 pc 001c4f90  /system/framework/framework.jar (android.os.BinderProxy.transact)
                                                                                                    runtime.cc:691]   native: #09 pc 0037cde0  /apex/com.android.art/lib64/libart.so (art::interpreter::Execute +356) (BuildId: b10f5696fea1b32039b162aef3850ed3)
                                                                                                    runtime.cc:691]   native: #10 pc 0049120c  /apex/com.android.art/lib64/libart.so (bool art::interpreter::DoCall<false>+4152) (BuildId: b10f5696fea1b32039b162aef3850ed3)
                                                                                                    runtime.cc:691]   native: #11 pc 0050aca4  /apex/com.android.art/lib64/libart.so (void art::interpreter::ExecuteSwitchImplCpp<false>+4124) (BuildId: b10f5696fea1b32039b162aef3850ed3)
                                                                                                    runtime.cc:691]   native: #12 pc 003797d8  /apex/com.android.art/lib64/libart.so (ExecuteSwitchImplAsm+8) (BuildId: b10f5696fea1b32039b162aef3850ed3)
                                                                                                    runtime.cc:691]   native: #13 pc 004f5154  /system/framework/framework.jar (com.android.internal.view.IInputMethodManager$Stub$Proxy.startInputOrWindowGainedFocus)
                                                                                                    runtime.cc:691]   native: #14 pc 0037cde0  /apex/com.android.art/lib64/libart.so (art::interpreter::Execute +356) (BuildId: b10f5696fea1b32039b162aef3850ed3)
                                                                                                    runtime.cc:691]   native: #15 pc 00398d78  /apex/com.android.art/lib64/libart.so (art::interpreter::ArtInterpreterToInterpreterBridge+100) (BuildId: b10f5696fea1b32039b162aef3850ed3)
                                                                                                    runtime.cc:691]   native: #16 pc 00398520  /apex/com.android.art/lib64/libart.so (bool art::interpreter::DoCall<true>+1388) (BuildId: b10f5696fea1b32039b162aef3850ed3)
                                                                                                    runtime.cc:691]   native: #17 pc 005111e4  /apex/com.android.art/lib64/libart.so (void art::interpreter::ExecuteSwitchImplCpp<false>+30044) (BuildId: b10f5696fea1b32039b162aef3850ed3)
                                                                                                    runtime.cc:691]   native: #18 pc 003797d8  /apex/com.android.art/lib64/libart.so (ExecuteSwitchImplAsm+8) (BuildId: b10f5696fea1b32039b162aef3850ed3)
                                                                                                    runtime.cc:691]   native: #19 pc 0025b784  /system/framework/framework.jar (android.view.inputmethod.IInputMethodManagerGlobalInvoker.startInputOrWindowGainedFocus)
                                                                                                    runtime.cc:691]   native: #20 pc 0037cde0  /apex/com.android.art/lib64/libart.so (art::interpreter::Execute +356) (BuildId: b10f5696fea1b32039b162aef3850ed3)
                                                                                                    runtime.cc:691]   at java.lang.StackStreamFactory$StackFrameTraverser.consumeFrames(StackStreamFactory.java:601)
                                                                                                    runtime.cc:691]   at java.lang.StackStreamFactory$AbstractStackWalker.doStackWalk(StackStreamFactory.java:316)
                                                                                                    runtime.cc:691]   at java.lang.StackStreamFactory$AbstractStackWalker.callStackWalk(StackStreamFactory.java:436)
                                                                                                    runtime.cc:691]   at java.lang.StackStreamFactory$AbstractStackWalker.beginStackWalk(StackStreamFactory.java:380)
                                                                                                    runtime.cc:691]   at java.lang.StackStreamFactory$AbstractStackWalker.walk(StackStreamFactory.java:251)
2024-04-22 11:35:25.073  5260-5260  components.test         com.paypal.spf.ui.components.test    A  runtime.cc:691]   at java.lang.StackWalker.walk(StackWalker.java:503)
                                                                                                    runtime.cc:691]   at org.mockito.internal.debugging.LocationImpl.stackWalk(LocationImpl.java:134)
                                                                                                    runtime.cc:691]   at org.mockito.internal.debugging.LocationImpl.framesToSkip(LocationImpl.java:123)
                                                                                                    runtime.cc:691]   at org.mockito.internal.debugging.LocationImpl.<clinit>(LocationImpl.java:59)
                                                                                                    runtime.cc:691]   at org.mockito.internal.debugging.LocationFactory$DefaultLocationFactory.create(LocationFactory.java:48)
                                                                                                    runtime.cc:691]   at org.mockito.internal.debugging.LocationFactory.create(LocationFactory.java:19)
                                                                                                    runtime.cc:691]   at org.mockito.internal.debugging.LocationFactory.create(LocationFactory.java:15)
                                                                                                    runtime.cc:691]   at org.mockito.internal.invocation.DefaultInvocationFactory.createInvocation(DefaultInvocationFactory.java:74)
                                                                                                    runtime.cc:691]   at org.mockito.internal.invocation.DefaultInvocationFactory.createInvocation(DefaultInvocationFactory.java:48)
                                                                                                    runtime.cc:691]   at org.mockito.internal.invocation.DefaultInvocationFactory.createInvocation(DefaultInvocationFactory.java:39)
                                                                                                    runtime.cc:691]   at com.android.dx.mockito.InvocationHandlerAdapter.invoke(InvocationHandlerAdapter.java:52)
                                                                                                    runtime.cc:691]   at java.lang.reflect.Proxy.invoke(Proxy.java:1006)

Full logs available here: logs.txt

Malachiasz commented 7 months ago

With compile SDK 34, and Android gradle plugin 8.x, the following error is printed out:

MockMakerMultiplexer E Could not init mockmaker com.android.dx.mockito.inline.InlineStaticMockMaker

Also following errors are printed:

04-25 13:29:57.932  3891  3891 F DEBUG   :       #92 pc 0000000000432ab0  <anonymous:6faab08000> (org.mockito.internal.debugging.LocationImpl$$ExternalSyntheticApiModelOutline0.m+0)
04-25 13:29:57.932  3891  3891 F DEBUG   :       #93 pc 000000000037cde0  /apex/com.android.art/lib64/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool) (.__uniq.112435418011751916792819755956732575238.llvm.1377403774332988508)+356) (BuildId: b10f5696fea1b32039b162aef3850ed3)
04-25 13:29:57.932  3891  3891 F DEBUG   :       #94 pc 000000000049120c  /apex/com.android.art/lib64/libart.so (bool art::interpreter::DoCall<false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, bool, art::JValue*)+4152) (BuildId: b10f5696fea1b32039b162aef3850ed3)
04-25 13:29:57.932  3891  3891 F DEBUG   :       #95 pc 000000000050a2f8  /apex/com.android.art/lib64/libart.so (void art::interpreter::ExecuteSwitchImplCpp<false>(art::interpreter::SwitchImplContext*)+1648) (BuildId: b10f5696fea1b32039b162aef3850ed3)
04-25 13:29:57.932  3891  3891 F DEBUG   :       #96 pc 00000000003797d8  /apex/com.android.art/lib64/libart.so (ExecuteSwitchImplAsm+8) (BuildId: b10f5696fea1b32039b162aef3850ed3)

Version 2.28.1

cckroets commented 5 months ago

@Malachiasz @varunajaygupta do you have the same issue using the latest version, 2.28.3?

Malachiasz commented 5 months ago

Yes, back then I have also given a try to the newest version but there was no difference.

cleberhenriques commented 2 months ago

Hi, same is happening in our project. instrumentation tests passes when running on API 33 but fail when running on API 34.

Logs:

08-29 13:32:57.741 10089 10089 F DEBUG   : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
08-29 13:32:57.741 10089 10089 F DEBUG   : Build fingerprint: 'google/sdk_gphone64_arm64/emu64a:14/UE1A.230829.036.A4/12096271:user/release-keys'
08-29 13:32:57.741 10089 10089 F DEBUG   : Revision: '0'
08-29 13:32:57.741 10089 10089 F DEBUG   : ABI: 'arm64'
08-29 13:32:57.741 10089 10089 F DEBUG   : Timestamp: 2024-08-29 13:32:57.551937911+0200
08-29 13:32:57.741 10089 10089 F DEBUG   : Process uptime: 3s
08-29 13:32:57.741 10089 10089 F DEBUG   : Cmdline: io.moia.vga.debug
08-29 13:32:57.741 10089 10089 F DEBUG   : pid: 9902, tid: 9973, name: roidJUnitRunner  >>> io.moia.vga.debug <<<
08-29 13:32:57.741 10089 10089 F DEBUG   : uid: 10194
08-29 13:32:57.741 10089 10089 F DEBUG   : tagged_addr_ctrl: 0000000000000001 (PR_TAGGED_ADDR_ENABLE)
08-29 13:32:57.741 10089 10089 F DEBUG   : pac_enabled_keys: 000000000000000f (PR_PAC_APIAKEY, PR_PAC_APIBKEY, PR_PAC_APDAKEY, PR_PAC_APDBKEY)
08-29 13:32:57.741 10089 10089 F DEBUG   : signal 6 (SIGABRT), code -1 (SI_QUEUE), fault addr --------
08-29 13:32:57.741 10089 10089 F DEBUG   : Abort message: 'Check failed: &proto_id >= proto_ids_ (&proto_id=0x70c3eab0b8, proto_ids_=0x713902a8c8) /apex/com.android.art/javalib/core-oj.jar'
08-29 13:32:57.741 10089 10089 F DEBUG   :     x0  0000000000000000  x1  00000000000026f5  x2  0000000000000006  x3  00000070960c8a00
08-29 13:32:57.741 10089 10089 F DEBUG   :     x4  712d73686d74692d  x5  712d73686d74692d  x6  712d73686d74692d  x7  7f7f7f7f7f7f7f7f
08-29 13:32:57.741 10089 10089 F DEBUG   :     x8  00000000000000f0  x9  00000073dc05b090  x10 0000000000000001  x11 00000073dc0ae058
08-29 13:32:57.741 10089 10089 F DEBUG   :     x12 0000000000003a52  x13 000000007fffffff  x14 0000000000042440  x15 00000db80d2d344f
08-29 13:32:57.741 10089 10089 F DEBUG   :     x16 00000073dc11bd08  x17 00000073dc0efe90  x18 00000070950dc000  x19 00000000000026ae
08-29 13:32:57.741 10089 10089 F DEBUG   :     x20 00000000000026f5  x21 00000000ffffffff  x22 000000724d7ea7f0  x23 00000070960c8ac8
08-29 13:32:57.741 10089 10089 F DEBUG   :     x24 000000713a813000  x25 b4000071ad7ed1f0  x26 0000007139ca95ca  x27 000000000000000b
08-29 13:32:57.741 10089 10089 F DEBUG   :     x28 000000713a816000  x29 00000070960c8a80
08-29 13:32:57.741 10089 10089 F DEBUG   :     lr  00000073dc09f9b8  sp  00000070960c89e0  pc  00000073dc09f9e4  pst 0000000000001000
08-29 13:32:57.741 10089 10089 F DEBUG   : 332 total frames
08-29 13:32:57.741 10089 10089 F DEBUG   : backtrace:
 at org.mockito.internal.debugging.LocationImpl$$ExternalSyntheticLambda0.apply(D8$$SyntheticClass:0)
08-29 13:32:57.416  9902  9973 F .moia.vga.debug: runtime.cc:691]   at java.lang.StackStreamFactory$StackFrameTraverser.consumeFrames(StackStreamFactory.java:601)
08-29 13:32:57.416  9902  9973 F .moia.vga.debug: runtime.cc:691]   at java.lang.StackStreamFactory$AbstractStackWalker.doStackWalk(StackStreamFactory.java:316)
08-29 13:32:57.416  9902  9973 F .moia.vga.debug: runtime.cc:691]   at java.lang.StackStreamFactory$AbstractStackWalker.callStackWalk(StackStreamFactory.java:436)
08-29 13:32:57.416  9902  9973 F .moia.vga.debug: runtime.cc:691]   at java.lang.StackStreamFactory$AbstractStackWalker.beginStackWalk(StackStreamFactory.java:380)
08-29 13:32:57.416  9902  9973 F .moia.vga.debug: runtime.cc:691]   at java.lang.StackStreamFactory$AbstractStackWalker.walk(StackStreamFactory.java:251)
08-29 13:32:57.416  9902  9973 F .moia.vga.debug: runtime.cc:691]   at java.lang.StackWalker.walk(StackWalker.java:503)
08-29 13:32:57.416  9902  9973 F .moia.vga.debug: runtime.cc:691]   at org.mockito.internal.debugging.LocationImpl.stackWalk(LocationImpl.java:134)
08-29 13:32:57.416  9902  9973 F .moia.vga.debug: runtime.cc:691]   at org.mockito.internal.debugging.LocationImpl.getStackFrame(LocationImpl.java:90)
08-29 13:32:57.416  9902  9973 F .moia.vga.debug: runtime.cc:691]   at org.mockito.internal.debugging.LocationImpl.<init>(LocationImpl.java:65)
08-29 13:32:57.416  9902  9973 F .moia.vga.debug: runtime.cc:691]   at org.mockito.internal.debugging.LocationFactory$DefaultLocationFactory.create(LocationFactory.java:48)
08-29 13:32:57.416  9902  9973 F .moia.vga.debug: runtime.cc:691]   at org.mockito.internal.debugging.LocationFactory.create(LocationFactory.java:19)
08-29 13:32:57.416  9902  9973 F .moia.vga.debug: runtime.cc:691]   at org.mockito.internal.debugging.LocationFactory.create(LocationFactory.java:15)
08-29 13:32:57.416  9902  9973 F .moia.vga.debug: runtime.cc:691]   at org.mockito.internal.invocation.DefaultInvocationFactory.createInvocation(DefaultInvocationFactory.java:74)
08-29 13:32:57.416  9902  9973 F .moia.vga.debug: runtime.cc:691]   at org.mockito.internal.invocation.DefaultInvocationFactory.createInvocation(DefaultInvocationFactory.java:48)
08-29 13:32:57.416  9902  9973 F .moia.vga.debug: runtime.cc:691]   at org.mockito.internal.invocation.DefaultInvocationFactory.createInvocation(DefaultInvocationFactory.java:39)
08-29 13:32:57.416  9902  9973 F .moia.vga.debug: runtime.cc:691]   at com.android.dx.mockito.inline.InvocationHandlerAdapter.invoke(InvocationHandlerAdapter.java:112)
08-29 13:32:57.416  9902  9973 F .moia.vga.debug: runtime.cc:691]   at java.lang.reflect.Proxy.invoke(Proxy.java:1006)
08-29 13:32:57.416  9902  9973 F .moia.vga.debug: runtime.cc:691]   at io.moia.vga.iot.api.IotRepository.observeConnection(IotRepository.kt:-2)
08-29 13:32:57.416  9902  9973 F .moia.vga.debug: runtime.cc:691]   at io.moia.vga.app.VgaServiceTest.setup(VgaServiceTest.kt:118)
08-29 13:32:57.416  9902  9973 F .moia.vga.debug: runtime.cc:691]   at java.lang.reflect.Method.invoke(Native method)
08-29 13:32:57.416  9902  9973 F .moia.vga.debug: runtime.cc:691]   at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
08-29 13:32:57.416  9902  9973 F .moia.vga.debug: runtime.cc:691]   at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
08-29 13:32:57.416  9902  9973 F .moia.vga.debug: runtime.cc:691]   at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)

Tried with version 2.28.3 and 2.28.4.

gmatyszczak commented 2 months ago

I had similar problem, in my case mockito-kotlin added as dependency was causing this issue, but excluding "org.mockito" group from it helped.

androidTestImplementation("org.mockito.kotlin:mockito-kotlin:5.4.0") {
    exclude(group = "org.mockito")
}