Status Update
Comments
sg...@google.com <sg...@google.com> #2
Looking at the attached smali, then method java.lang.StackTraceElement com.pax.log.LogUtils.getCaller(com.pax.log.b, java.lang.StackTraceElement[], int)
has this code:
.method static getCaller(Lcom/pax/log/b;[Ljava/lang/StackTraceElement;I)Ljava/lang/StackTraceElement;
.locals 5
.line 55
:goto_0
array-length v1, p1
if-ge p2, v1, :cond_2
.line 56
aget-object v1, p1, p2
.line 1052
iget-object v2, p0, Lcom/pax/log/b;->A:Ljava/util/ArrayList;
.line 58
invoke-virtual {v2}, Ljava/util/ArrayList;->iterator()Ljava/util/Iterator;
move-result-object v2
:cond_0
invoke-interface {v2}, Ljava/util/Iterator;->hasNext()Z
move-result v3
if-eqz v3, :cond_1
invoke-interface {v2}, Ljava/util/Iterator;->next()Ljava/lang/Object;
move-result-object v3
check-cast v3, Ljava/lang/String;
.line 59
invoke-virtual {v1}, Ljava/lang/StackTraceElement;->getClassName()Ljava/lang/String;
move-result-object v4
invoke-virtual {v4, v3}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v3
if-eqz v3, :cond_0
if-nez v0, :cond_1
goto :goto_1
:cond_1
add-int/lit8 p2, p2, 0x1
goto :goto_0
:cond_2
const/4 v1, 0x0
:goto_1
return-object v1
.end method
Where the only use of v0
is in if-nez v0, :cond_1
.
sg...@google.com <sg...@google.com> #3
To original reporter
ge...@paymentsense.com <ge...@paymentsense.com> #4
sg...@google.com <sg...@google.com> #5
The received dump had issue. Requested a new one.
ge...@paymentsense.com <ge...@paymentsense.com> #6
sg...@google.com <sg...@google.com> #7
The new dump also had issues.
ge...@paymentsense.com <ge...@paymentsense.com> #8
This is for:
- AGP 8.5.0
- Gradle wrapper - 8.7
- Java - 17.0.10 2024-01-16 LTS
The crash continues to happen for prod, but never happens for debug and we have not enabled any r8 optimisations or anything like that. Can you take a look in the errors and tell me what is wrong as I am following the command you suggested.
./gradlew :app:assembleRelease -Dorg.gradle.caching=false -Dcom.android.tools.r8.dumpinputtofile=mydump.zip --no-daemon
sg...@google.com <sg...@google.com> #9
Sorry for the delay in replying here. As mentioned in our mail correspondence I wondered about the large classpath, and I missed that this was not a build using R8 optimizations. In that case you need to use com.android.tools.r8.dumpinputtodirectory
instead, as a non optimizing build generates many dump files, so
./gradlew clean
./gradlew :app:assembleRelease -Dorg.gradle.caching=false -Dcom.android.tools.r8.dumpinputtodirectory=mydumpdir --no-daemon
Please make sure mydumpdir
exists and is empty before building.
Then please privately share
- the
mydumpdir
content - the final APK as well
Do you see this issue on a specific set of devices (Android version, vendor, etc.)?
ge...@paymentsense.com <ge...@paymentsense.com> #10
sg...@google.com <sg...@google.com> #11
Thanks again for the smali. As mentioned in VerifyError
is pretty clear, as v0
is undefined, when used in the if-nez v0, :cond_1
instruction. What I am looking for is the compilation (D8 compilation in this case) which generated that code. One of the dumps generated into the mydumpdir
will contain that compilation.
As this is not an optimized build we could start by just looking at the com.pax.log.LogUtils
class if it does not use default interface methods. Is that class from a public or internal library?
ge...@paymentsense.com <ge...@paymentsense.com> #12
ge...@paymentsense.com <ge...@paymentsense.com> #13
sg...@google.com <sg...@google.com> #14
Thank you for the dumps. I found the compilation of com.pax.log.LogUtils
in dump190565377314083.zip, and compiling that
unzip dump190565377314083.zip -d dump190565377314083
tools/compiledump.py --version 8.6.13-dev -d dump190565377314083.zip --temp dump190565377314083
hits an assertion error in the compiler:
Caused by: java.lang.AssertionError: Invalid code after SplitBranch
at com.android.tools.r8.ir.conversion.passes.CodeRewriterPass.verifyConsistentCode(CodeRewriterPass.java:68)
at com.android.tools.r8.ir.conversion.passes.CodeRewriterPass.run(CodeRewriterPass.java:56)
at com.android.tools.r8.ir.conversion.passes.CodeRewriterPass.lambda$run$0(CodeRewriterPass.java:41)
at com.android.tools.r8.utils.Timing.time(Timing.java:471)
at com.android.tools.r8.ir.conversion.passes.CodeRewriterPass.run(CodeRewriterPass.java:41)
at com.android.tools.r8.ir.conversion.passes.CodeRewriterPassCollection.run(CodeRewriterPassCollection.java:70)
at com.android.tools.r8.ir.conversion.IRConverter.optimize(IRConverter.java:696)
at com.android.tools.r8.ir.conversion.IRConverter.rewriteDesugaredCodeInternal(IRConverter.java:491)
at com.android.tools.r8.ir.conversion.PrimaryD8L8IRConverter.rewriteNonDesugaredCodeInternal(PrimaryD8L8IRConverter.java:377)
at com.android.tools.r8.ir.conversion.PrimaryD8L8IRConverter.lambda$rewriteNonDesugaredCode$4(PrimaryD8L8IRConverter.java:361)
at com.android.tools.r8.utils.ExceptionUtils.withOriginAndPositionAttachmentHandler(ExceptionUtils.java:252)
at com.android.tools.r8.ir.conversion.PrimaryD8L8IRConverter.rewriteNonDesugaredCode(PrimaryD8L8IRConverter.java:357)
at com.android.tools.r8.ir.conversion.PrimaryD8L8IRConverter.convertMethod(PrimaryD8L8IRConverter.java:156)
at com.android.tools.r8.ir.conversion.D8MethodProcessor.processMethod(D8MethodProcessor.java:142)
at com.android.tools.r8.ir.conversion.PrimaryD8L8IRConverter.convertMethods(PrimaryD8L8IRConverter.java:121)
at com.android.tools.r8.ir.conversion.ClassConverter.convertMethods(ClassConverter.java:229)
at com.android.tools.r8.ir.conversion.ClassConverter$DefaultClassConverter.convertClass(ClassConverter.java:247)
at com.android.tools.r8.ir.conversion.ClassConverter.lambda$internalConvertClasses$2(ClassConverter.java:162)
at com.android.tools.r8.utils.ThreadUtils.lambda$processItems$4(ThreadUtils.java:126)
at com.android.tools.r8.utils.ThreadUtils.lambda$processItems$6(ThreadUtils.java:167)
at com.android.tools.r8.utils.ThreadUtils.lambda$processItemsWithResultsThatMatches$2(ThreadUtils.java:111)
at java.base/java.util.concurrent.ForkJoinTask$AdaptedCallable.exec(ForkJoinTask.java:1448)
at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:177)
Running with assertions disabled compiledump.py -da ...
compiles to the invalid DEX, where v0
is used before initialized.
ge...@paymentsense.com <ge...@paymentsense.com> #15
ap...@google.com <ap...@google.com> #16
Branch: main
commit 7d9876990d0dba6c76e3eed6b7d3d32900b9647b
Author: Søren Gjesse <sgjesse@google.com>
Date: Fri Jun 28 13:32:50 2024
Add reproduction of
Change-Id: I110623e94cfb747b1d3b014fa7f20be9c8003bf7
Bug:
A src/test/java/com/android/tools/r8/ir/optimize/ifs/Regress343136777Test.java
an...@paymentsense.com <an...@paymentsense.com> #17
Have you made any progress on this issue?
cl...@google.com <cl...@google.com>
ap...@google.com <ap...@google.com> #18
Branch: main
commit c0f3646d88824dd0b1a376858d435b417c147f3f
Author: Clément Béra <clementbera@google.com>
Date: Tue Jul 30 10:57:37 2024
Fix SplitBranch with invalid phi
-Regress Tivi size by 0.007%
Bug:
Change-Id: Ie42724bf73b57ebbaa5145a054cce9e6bae06f56
M src/main/java/com/android/tools/r8/ir/conversion/passes/SplitBranch.java
M src/test/java/com/android/tools/r8/ir/optimize/ifs/Regress343136777Test.java
cl...@google.com <cl...@google.com> #19
Fixed, I need now to backport a bit.
ap...@google.com <ap...@google.com> #20
Branch: 8.6
commit 041afb7d25f7d2bb53d88066bcd212b3a4ebcabf
Author: Clément Béra <clementbera@google.com>
Date: Tue Jul 30 13:03:42 2024
Fix SplitBranch with invalid phi
-Regress Tivi size by 0.007%
Bug:
Change-Id: Ie42724bf73b57ebbaa5145a054cce9e6bae06f56
M src/main/java/com/android/tools/r8/ir/conversion/passes/SplitBranch.java
M src/test/java/com/android/tools/r8/ir/optimize/ifs/Regress343136777Test.java
ap...@google.com <ap...@google.com> #21
Branch: 8.6
commit 3ec73ce1dbb45b2b43148cb32753ef1e9fada74d
Author: Clément Béra <clementbera@google.com>
Date: Tue Jul 30 13:07:49 2024
Version 8.6.16
Bug:
Bug:
Bug:
Bug:
Change-Id: I9f2ad5022503a910fad4e649cf5df8dbbb616316
M src/main/java/com/android/tools/r8/Version.java
ap...@google.com <ap...@google.com> #22
Branch: 8.5
commit d360da0f12e43c2e9798aaa1bdf3443cb7661e51
Author: Clément Béra <clementbera@google.com>
Date: Tue Jul 30 13:26:24 2024
Version 8.5.34
Bug:
Bug:
Bug:
Bug:
Change-Id: Ife8945c8f8ed416af360c78e5fc4267bba97b967
M src/main/java/com/android/tools/r8/Version.java
ap...@google.com <ap...@google.com> #23
Branch: 8.5
commit 53afe8ea0c3600e3c5a6e50232759f65db70f3ce
Author: Clément Béra <clementbera@google.com>
Date: Tue Jul 30 13:23:19 2024
Fix SplitBranch with invalid phi
-Regress Tivi size by 0.007%
Bug:
Change-Id: Ie42724bf73b57ebbaa5145a054cce9e6bae06f56
M src/main/java/com/android/tools/r8/ir/conversion/passes/SplitBranch.java
M src/test/java/com/android/tools/r8/ir/optimize/ifs/Regress343136777Test.java
ap...@google.com <ap...@google.com> #24
Branch: 8.5
commit eba4c3e1e92b583c5f352ed87d2e660c0b15dbbf
Author: Clément Béra <clementbera@google.com>
Date: Tue Jul 30 13:22:42 2024
Add reproduction of
Change-Id: I110623e94cfb747b1d3b014fa7f20be9c8003bf7
Bug:
A src/test/java/com/android/tools/r8/ir/optimize/ifs/Regress343136777Test.java
cl...@google.com <cl...@google.com>
an...@google.com <an...@google.com> #25
Thank you for your patience while our engineering team worked to resolve this issue. A fix for this issue is now available in:
- Android Studio Koala Feature Drop | 2024.1.2 RC 1
- Android Gradle Plugin 8.6.0-rc01
We encourage you to try the latest update.
If you notice further issues or have questions, please file a new bug report.
Thank you for taking the time to submit feedback — we really appreciate it!
an...@google.com <an...@google.com> #26
The fixes for this issue are now also available in:
- Android Studio Koala | 2024.1.1 Patch 2
- Android Gradle Plugin 8.5.2
We encourage you to try the latest update.
If you notice further issues or have questions, please file a new bug report.
Description
Hello,
The issue continues to happen for us even with AGP 8.4.1. I am attaching the smali output here.
java.lang.VerifyError: Verifier rejected class com.pax.log.LogUtils: java.lang.StackTraceElement com.pax.log.LogUtils.getCaller(com.pax.log.b, java.lang.StackTraceElement[], int) failed to verify: java.lang.StackTraceElement com.pax.log.LogUtils.getCaller(com.pax.log.b, java.lang.StackTraceElement[], int): [0x21] type Undefined unexpected as arg to if-eqz/if-nez (declaration of 'com.pax.log.LogUtils' appears in /data/app/******-1/base.apk:classes8.dex)
at com.pax.log.LogUtils.isAndroid(LogUtils.java:125)
at com.pax.log.PaxLogWrapper.<init>(PaxLogWrapper.java:63)
at com.pax.log.PaxLogWrapper.<init>(PaxLogWrapper.java:52)
at com.pax.log.LogWrapperBinding.<clinit>(LogWrapperBinding.java:1)
at com.pax.log.LogWrapperBinding.registerLog(LogWrapperBinding.java:1)
at com.pax.poscomm.utils.CommLog.<clinit>(CommLog.java:1)
at com.pax.poscomm.utils.CommLog.v(CommLog.java:1)
at com.pax.poscomm.posapi.peripheries.NeptuneBase.getDalObjFromNeptuneLite(NeptuneBase.java:5)
at com.pax.poscomm.posapi.peripheries.NeptuneBase.getDalObjectFromNeptuneLib(NeptuneBase.java:6)
at com.pax.poscomm.posapi.peripheries.NeptuneBase.getClassLoader(NeptuneBase.java:2)
at com.pax.poscomm.posapi.peripheries.NeptuneBase.loadDex(NeptuneBase.java:4)
at com.pax.poslink.POSLinkAndroid.a(POSLinkAndroid.java:2)
at com.pax.poslink.POSLinkAndroid.init(POSLinkAndroid.java:21)