Fixed
Status Update
Comments
xa...@google.com <xa...@google.com> #2
Thank you for the report and the supplied dump with the reproduction. I can confirm that the NPE is also present on HEAD, and I will look into it.
Quite a few of the class files in the dump has malformed inner-class attribute, where R8 reports e.g.:
Info in /tmp/tmpo67ucguh/program.jar:ofifmwrrhhmodsc/ψξψξψξξ.class:
Malformed inner-class attribute:
outerTypeInternal: ofifmwrrhhmodsc/ψξψξψξξ
innerTypeInternal: ofifmwrrhhmodsc/ψξψξψξξ$ψξξψξξξ
innerName: ψξψξψξξ$ψξξψξξξ
These are ignored, so they should not be the reason for the NPE, but something to also look into.
au...@google.com <au...@google.com> #3
Project: r8
Branch: main
commit e59500ca4445f5fb5d2ccc1114acbf66df11d196
Author: Søren Gjesse <sgjesse@google.com>
Date: Tue Mar 21 09:48:55 2023
Insert patched frame instructions in the right place
Fixes: b/274337639
Change-Id: Iae204ed529f9af5bf5fa3eaacba45128dfa6fd9e
M src/main/java/com/android/tools/r8/graph/LazyCfCode.java
M src/test/java/com/android/tools/r8/cf/frames/InitBeforeNewInInstructionStreamTest.java
https://r8-review.googlesource.com/77390
Branch: main
commit e59500ca4445f5fb5d2ccc1114acbf66df11d196
Author: Søren Gjesse <sgjesse@google.com>
Date: Tue Mar 21 09:48:55 2023
Insert patched frame instructions in the right place
Fixes:
Change-Id: Iae204ed529f9af5bf5fa3eaacba45128dfa6fd9e
M src/main/java/com/android/tools/r8/graph/LazyCfCode.java
M src/test/java/com/android/tools/r8/cf/frames/InitBeforeNewInInstructionStreamTest.java
sp...@google.com <sp...@google.com> #4
Project: r8
Branch: main
commit 780c2e83c8c033e7594d61894fa1b3dbcad6630b
Author: Søren Gjesse <sgjesse@google.com>
Date: Tue Mar 21 09:48:13 2023
Add reproduction of b/274337639
Bug: b/274337639
Change-Id: I7573883d6a649eed47b10d7bf0cdea2e11710268
M build.gradle
M src/main/java/com/android/tools/r8/cf/code/frame/UninitializedNew.java
A src/test/java/com/android/tools/r8/cf/frames/InitBeforeNewInInstructionStreamTest.java
https://r8-review.googlesource.com/77389
Branch: main
commit 780c2e83c8c033e7594d61894fa1b3dbcad6630b
Author: Søren Gjesse <sgjesse@google.com>
Date: Tue Mar 21 09:48:13 2023
Add reproduction of
Bug:
Change-Id: I7573883d6a649eed47b10d7bf0cdea2e11710268
M build.gradle
M src/main/java/com/android/tools/r8/cf/code/frame/UninitializedNew.java
A src/test/java/com/android/tools/r8/cf/frames/InitBeforeNewInInstructionStreamTest.java
sp...@google.com <sp...@google.com> #5
I will backport this to the 8.0 and 4.0 branches.
sp...@google.com <sp...@google.com> #6
Thank you very much for taking a look at this!
Is this fix related to the nullpointer or the malformed inner-class attributes ?
Do you have a separated ticket for it? Could you share it?
Description
AndroidLintTask
lists the lint baseline file (e.g.lint-baseline.xml
) as an@InputFiles
property, but the file is also functioning as an@Output
of the task, since Lint, as documentedThis isn't good practice in Gradle, and leads to some odd behavior.
For instance, if you:
gradlew app:lint -Dlint.baselines.continue=true
, generating a new baseline filegradlew app:lint -Dlint.baselines.continue=true
The baseline file is not re-created, since Gradle observes the same "before" state for both invocations and marks the task as
Up-To-Date
(Gradle doesn't include the file in the "after" snapshot for the task because the file isn't marked as an@Output
). A fix/workaround is pending for this particular issue, but there may be other issues inherent to this non-idiomatic use of the Gradle API.This comment proposes a fix in AGP for the broader issue.