Status Update
Comments
ri...@google.com <ri...@google.com>
ch...@google.com <ch...@google.com> #2
Could you look into it @christofferqa?
The issue is with this class:
class MySpi : Spi {
@Volatile
private var myApi: Api? = null
// Incorrectly rewritten to return null;
override fun createApi(): Api {
return myApi ?: synchronized(this) {
myApi ?: MyApi().also { myApi = it }
}
}
}
The error seems to be that the ArgumentPropagator believes that the fieldState of myApi is ExactDynamicType(@NotNull MyApi)
while it should be ExactDynamicType(@Nullable MyApi)
It then removes the first branch (assuming myApi is not null):
return myApi ?: synchronized(this) {
myApi ?: MyApi().also { myApi = it }
}
is rewritten into:
return myApi
And then it eventually concludes that myApi is always null, replacing the code by
return null
The ArgumentPropagatorCodeScanner analyzes the assignment myApi = it
and correctly set join the state to ExactDynamicType(@NotNull MyApi)
However the ArgumentPropagator fails to understand that myApi
can be read before being written in the method, relying on the default null value, so it fails to join null
to the dynamic type.
yu...@bytedance.com <yu...@bytedance.com> #3
Yes I can take a look. Would it be possible for you to add a regression test of this issue?
ch...@google.com <ch...@google.com> #4
Project: r8
Branch: main
Author: Christoffer Adamsen <
Link:
Reproduce field propagation issue with ServiceLoader
Expand for full commit details
Reproduce field propagation issue with ServiceLoader
Bug: b/389737060
Change-Id: Id850448f68b999194bc0380dfca625f4f68bc31b
Files:
- A
src/test/java/com/android/tools/r8/ir/optimize/membervaluepropagation/DefaultFieldValueJoinerWithServiceLoaderTest.java
Hash: 6ba9af34b15f2a0d3fe356f6e7a5a4071128aed9
Date: Wed Feb 12 09:31:01 2025
to...@xperi.com <to...@xperi.com> #5
Project: r8
Branch: main
Author: Christoffer Adamsen <
Link:
Account for ServiceLoaders in field value propagation
Expand for full commit details
Account for ServiceLoaders in field value propagation
Fixes: b/389737060
Change-Id: Ide438a8e1b0541f3ce2385087f06f8b9909ab3c5
Files:
- M
src/main/java/com/android/tools/r8/optimize/argumentpropagation/propagation/DefaultFieldValueJoiner.java
- M
src/test/java/com/android/tools/r8/ir/optimize/membervaluepropagation/DefaultFieldValueJoinerWithServiceLoaderTest.java
Hash: 692fff07b70f6ee5ac520b179aed5e125a0d4848
Date: Wed Feb 12 09:34:04 2025
ch...@google.com <ch...@google.com> #6
Project: r8
Branch: 8.9
Author: Christoffer Adamsen <
Link:
Account for ServiceLoaders in field value propagation
Expand for full commit details
Account for ServiceLoaders in field value propagation
Fixes: b/389737060
Change-Id: Ide438a8e1b0541f3ce2385087f06f8b9909ab3c5
Files:
- M
src/main/java/com/android/tools/r8/optimize/argumentpropagation/propagation/DefaultFieldValueJoiner.java
- M
src/test/java/com/android/tools/r8/ir/optimize/membervaluepropagation/DefaultFieldValueJoinerWithServiceLoaderTest.java
Hash: 76cad195cf43c16aa9e7b0203e51662036587e71
Date: Thu Feb 13 10:33:29 2025
to...@xperi.com <to...@xperi.com> #7
Project: r8
Branch: 8.9
Author: Christoffer Adamsen <
Link:
Version 8.9.28
Expand for full commit details
Version 8.9.28
Bug: b/389737060
Change-Id: I42c8d3194dc053e3a16eef8ea1c4b3aced6752d6
Files:
- M
src/main/java/com/android/tools/r8/Version.java
Hash: 668c1778e857c1bc8e3f9308a65ddc01a6c14898
Date: Thu Feb 13 10:33:34 2025
ap...@google.com <ap...@google.com> #8
Project: r8
Branch: 8.9
Author: Christoffer Adamsen <
Link:
Reproduce field propagation issue with ServiceLoader
Expand for full commit details
Reproduce field propagation issue with ServiceLoader
Bug: b/389737060
Change-Id: Id850448f68b999194bc0380dfca625f4f68bc31b
Files:
- A
src/test/java/com/android/tools/r8/ir/optimize/membervaluepropagation/DefaultFieldValueJoinerWithServiceLoaderTest.java
Hash: a76d3e8637b5280dcc972ed9fabc74bb503cc30c
Date: Thu Feb 13 10:33:24 2025
ap...@google.com <ap...@google.com> #9
Project: r8
Branch: 8.8
Author: Christoffer Adamsen <
Link:
Reproduce field propagation issue with ServiceLoader
Expand for full commit details
Reproduce field propagation issue with ServiceLoader
Bug: b/389737060
Change-Id: Id850448f68b999194bc0380dfca625f4f68bc31b
Files:
- A
src/test/java/com/android/tools/r8/ir/optimize/membervaluepropagation/DefaultFieldValueJoinerWithServiceLoaderTest.java
Hash: a63678f7ebb3321af74c9846be9c851e4da78e4f
Date: Thu Feb 13 10:33:55 2025
ap...@google.com <ap...@google.com> #10
Project: r8
Branch: 8.8
Author: Christoffer Adamsen <
Link:
Version 8.8.35
Expand for full commit details
Version 8.8.35
Bug: b/389737060
Change-Id: I2361f77b42b529f2cbdfbf60fbe4a95e405ba716
Files:
- M
src/main/java/com/android/tools/r8/Version.java
Hash: d280891c805561bc120f5f96841b50353e74edfe
Date: Thu Feb 13 10:34:06 2025
to...@xperi.com <to...@xperi.com> #11
Project: r8
Branch: 8.8
Author: Christoffer Adamsen <
Link:
Account for ServiceLoaders in field value propagation
Expand for full commit details
Account for ServiceLoaders in field value propagation
Fixes: b/389737060
Change-Id: Ide438a8e1b0541f3ce2385087f06f8b9909ab3c5
Files:
- M
src/main/java/com/android/tools/r8/optimize/argumentpropagation/propagation/DefaultFieldValueJoiner.java
- M
src/test/java/com/android/tools/r8/ir/optimize/membervaluepropagation/DefaultFieldValueJoinerWithServiceLoaderTest.java
Hash: 05dd13d906b60efdf03caea7067dedf67b7c6a2e
Date: Thu Feb 13 10:34:00 2025
ap...@google.com <ap...@google.com> #12
Project: r8
Branch: 8.7
Author: Christoffer Adamsen <
Link:
Account for ServiceLoaders in field value propagation
Expand for full commit details
Account for ServiceLoaders in field value propagation
Fixes: b/389737060
Change-Id: Ide438a8e1b0541f3ce2385087f06f8b9909ab3c5
Files:
- M
src/main/java/com/android/tools/r8/optimize/argumentpropagation/propagation/DefaultFieldValueJoiner.java
- M
src/test/java/com/android/tools/r8/ir/optimize/membervaluepropagation/DefaultFieldValueJoinerWithServiceLoaderTest.java
Hash: d7dcc9001453052f772056337d3c120dba34fc46
Date: Thu Feb 13 10:34:31 2025
ap...@google.com <ap...@google.com> #13
Project: r8
Branch: 8.7
Author: Christoffer Adamsen <
Link:
Version 8.7.35
Expand for full commit details
Version 8.7.35
Bug: b/389737060
Change-Id: Icfb60f565b329600b5f167a496a39a61ebff9ea6
Files:
- M
src/main/java/com/android/tools/r8/Version.java
Hash: 1be71bdf4455bbc565502b4c3bbbae64608c57a6
Date: Thu Feb 13 10:34:38 2025
ap...@google.com <ap...@google.com> #14
Project: r8
Branch: 8.7
Author: Christoffer Adamsen <
Link:
Reproduce field propagation issue with ServiceLoader
Expand for full commit details
Reproduce field propagation issue with ServiceLoader
Bug: b/389737060
Change-Id: Id850448f68b999194bc0380dfca625f4f68bc31b
Files:
- A
src/test/java/com/android/tools/r8/ir/optimize/membervaluepropagation/DefaultFieldValueJoinerWithServiceLoaderTest.java
Hash: 7272540b4f7850ef22543defc221660359704ea2
Date: Thu Feb 13 10:34:26 2025
ap...@google.com <ap...@google.com> #15
Project: r8
Branch: 8.9
Author: Christoffer Adamsen <
Link:
Account for ServiceLoaders in field value propagation
Expand for full commit details
Account for ServiceLoaders in field value propagation
Fixes: b/389737060
Change-Id: Ide438a8e1b0541f3ce2385087f06f8b9909ab3c5
Files:
- M
src/main/java/com/android/tools/r8/optimize/argumentpropagation/propagation/DefaultFieldValueJoiner.java
- M
src/test/java/com/android/tools/r8/ir/optimize/membervaluepropagation/DefaultFieldValueJoinerWithServiceLoaderTest.java
Hash: 76cad195cf43c16aa9e7b0203e51662036587e71
Date: Thu Feb 13 10:33:29 2025
ap...@google.com <ap...@google.com> #16
Project: r8
Branch: 8.9
Author: Christoffer Adamsen <
Link:
Reproduce field propagation issue with ServiceLoader
Expand for full commit details
Reproduce field propagation issue with ServiceLoader
Bug: b/389737060
Change-Id: Id850448f68b999194bc0380dfca625f4f68bc31b
Files:
- A
src/test/java/com/android/tools/r8/ir/optimize/membervaluepropagation/DefaultFieldValueJoinerWithServiceLoaderTest.java
Hash: a76d3e8637b5280dcc972ed9fabc74bb503cc30c
Date: Thu Feb 13 10:33:24 2025
ap...@google.com <ap...@google.com> #17
This should now be fixed in R8 8.7.36, 8.8.36 and 8.9.28.
ap...@google.com <ap...@google.com> #18
Project: r8
Branch: 8.8
Author: Christoffer Adamsen <
Link:
Version 8.8.36
Expand for full commit details
Version 8.8.36
Bug: b/389737060
Change-Id: I9ac9a6eda36030b2569bf6839f9b55257f0d2888
Files:
- M
src/main/java/com/android/tools/r8/Version.java
Hash: d228eeda266e288da18698a2fa464fc97b0303c3
Date: Thu Feb 13 12:31:37 2025
ap...@google.com <ap...@google.com> #19
Project: r8
Branch: 8.8
Author: Christoffer Adamsen <
Link:
Fix call to addDataResources in test
Expand for full commit details
Fix call to addDataResources in test
This was added in 8.9.
Bug: b/389737060
Change-Id: I604550f0c0034256f71c03874eeb4798f7079f18
Files:
- M
src/test/java/com/android/tools/r8/ir/optimize/membervaluepropagation/DefaultFieldValueJoinerWithServiceLoaderTest.java
Hash: 58502e8fa34f0abe33a254671faf1b74e0668c86
Date: Thu Feb 13 12:30:57 2025
ap...@google.com <ap...@google.com> #20
Project: r8
Branch: 8.7
Author: Christoffer Adamsen <
Link:
Version 8.7.36
Expand for full commit details
Version 8.7.36
Bug: b/389737060
Change-Id: Ib57157e3ca8863dcb097a3aa0a1e840c546a4392
Files:
- M
src/main/java/com/android/tools/r8/Version.java
Hash: de384a5950a14b2244dc74819fffd0306cae7065
Date: Thu Feb 13 12:28:52 2025
ap...@google.com <ap...@google.com> #21
Project: r8
Branch: 8.7
Author: Christoffer Adamsen <
Link:
Fix call to addDataResources in test
Expand for full commit details
Fix call to addDataResources in test
This was added in 8.9.
Bug: b/389737060
Change-Id: I04d342dc297474d141362290f9ccf22c48332446
Files:
- M
src/test/java/com/android/tools/r8/ir/optimize/membervaluepropagation/DefaultFieldValueJoinerWithServiceLoaderTest.java
Hash: 981af34dd96a316d0c11972d80ce31ab301ec6c1
Date: Thu Feb 13 12:28:09 2025
ap...@google.com <ap...@google.com> #22
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 Meerkat Feature Drop | 2024.3.2 Beta 1
- Android Gradle Plugin 8.10.0-beta01
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!
ch...@google.com <ch...@google.com> #23
The fixes for this issue are now also available in:
- Android Studio Meerkat | 2024.3.1 Patch 1
- Android Gradle Plugin 8.9.1
We encourage you to try the latest update.
If you notice further issues or have questions, please file a new bug report.
ap...@google.com <ap...@google.com> #24
Project: r8
Branch: 8.7
Author: Christoffer Adamsen <
Link:
Account for T::new expressions in default field value joiner
Expand for full commit details
Account for T::new expressions in default field value joiner
Bug: b/397737234
Change-Id: Iea344f54fa5a8ac40739a51da5d7e6679d5964b8
Files:
- M
src/main/java/com/android/tools/r8/optimize/argumentpropagation/propagation/DefaultFieldValueJoiner.java
- M
src/test/java/com/android/tools/r8/ir/optimize/membervaluepropagation/DefaultFieldValueJoinerWithLambdaAllocationTest.java
Hash: facb83cda9b23e96d13acfb6e61edfe77b754c56
Date: Thu Mar 06 12:47:29 2025
ap...@google.com <ap...@google.com> #25
Project: r8
Branch: 8.7
Author: Christoffer Adamsen <
Link:
Fix BootstrapMethodError from invalid class merging
Expand for full commit details
Fix BootstrapMethodError from invalid class merging
Bug: b/397737234
Change-Id: Icacf51f06017c50b3448610e8493a225c225c40d
Files:
- M
src/main/java/com/android/tools/r8/horizontalclassmerging/PolicyScheduler.java
- A
src/main/java/com/android/tools/r8/horizontalclassmerging/policies/NoMethodHandleFromLambda.java
- M
src/main/java/com/android/tools/r8/shaking/Enqueuer.java
- M
src/test/java/com/android/tools/r8/ir/optimize/membervaluepropagation/DefaultFieldValueJoinerWithLambdaAllocationTest.java
Hash: f84fe96b65408bc0b38dbed81b95ef3cc8f998af
Date: Thu Mar 06 12:45:35 2025
ap...@google.com <ap...@google.com> #26
Project: r8
Branch: 8.7
Author: Christoffer Adamsen <
Link:
Reproduce inadequate value propagation in presence of T::new expressions
Expand for full commit details
Reproduce inadequate value propagation in presence of T::new expressions
Bug: b/397737234
Change-Id: Ia6cbb0ef3366125420afbdfcf3a8f0d228cc2004
Files:
- A
src/test/java/com/android/tools/r8/ir/optimize/membervaluepropagation/DefaultFieldValueJoinerWithLambdaAllocationTest.java
Hash: 2c63d92a87eafc74b45cba8a5a8f3a013130c653
Date: Thu Mar 06 12:45:27 2025
ap...@google.com <ap...@google.com> #27
Project: r8
Branch: 8.7
Author: Christoffer Adamsen <
Link:
Version 8.7.37
Expand for full commit details
Version 8.7.37
Bug: b/397737234
Change-Id: If19c362aff21345ea0eba68ee01174265aefae4e
Files:
- M
src/main/java/com/android/tools/r8/Version.java
Hash: 9dd430e92787edf015ce4dbfe5ddb309999758f5
Date: Thu Mar 06 12:47:39 2025
ap...@google.com <ap...@google.com> #28
Project: r8
Branch: 8.10
Author: Rico Wind <
Link:
Fix BootstrapMethodError from invalid class merging
Expand for full commit details
Fix BootstrapMethodError from invalid class merging
Bug: b/397737234
Change-Id: Icacf51f06017c50b3448610e8493a225c225c40d
Files:
- M
src/main/java/com/android/tools/r8/horizontalclassmerging/PolicyScheduler.java
- A
src/main/java/com/android/tools/r8/horizontalclassmerging/policies/NoMethodHandleFromLambda.java
- M
src/main/java/com/android/tools/r8/shaking/Enqueuer.java
- M
src/test/java/com/android/tools/r8/ir/optimize/membervaluepropagation/DefaultFieldValueJoinerWithLambdaAllocationTest.java
Hash: ad501b1308e3c0d0206bea8111a799f459492135
Date: Mon Mar 10 11:24:46 2025
ap...@google.com <ap...@google.com> #29
Project: r8
Branch: 8.10
Author: Rico Wind <
Link:
Reproduce inadequate value propagation in presence of T::new expressions
Expand for full commit details
Reproduce inadequate value propagation in presence of T::new expressions
Bug: b/397737234
Change-Id: Ia6cbb0ef3366125420afbdfcf3a8f0d228cc2004
Files:
- A
src/test/java/com/android/tools/r8/ir/optimize/membervaluepropagation/DefaultFieldValueJoinerWithLambdaAllocationTest.java
Hash: b62d995efb1143edee9b2589f3a22f27f1bdd10f
Date: Mon Mar 10 11:24:41 2025
ap...@google.com <ap...@google.com> #30
Project: r8
Branch: 8.10
Author: Rico Wind <
Link:
Account for T::new expressions in default field value joiner
Expand for full commit details
Account for T::new expressions in default field value joiner
Bug: b/397737234
Change-Id: Iea344f54fa5a8ac40739a51da5d7e6679d5964b8
Files:
- M
src/main/java/com/android/tools/r8/optimize/argumentpropagation/propagation/DefaultFieldValueJoiner.java
- M
src/test/java/com/android/tools/r8/ir/optimize/membervaluepropagation/DefaultFieldValueJoinerWithLambdaAllocationTest.java
Hash: 56515ee2eca6931b432a0bf373e6d90a486670e3
Date: Mon Mar 10 11:24:54 2025
ap...@google.com <ap...@google.com> #31
Project: r8
Branch: 8.10
Author: Rico Wind <
Link:
Version 8.10.16
Expand for full commit details
Version 8.10.16
Bug: b/397737234
Change-Id: I8aa6795562027e7b1ecf22d684385b872cd92f86
Files:
- M
src/main/java/com/android/tools/r8/Version.java
Hash: 77b6af4095578d5ccc62cb8730ba1b9555f059b7
Date: Mon Mar 10 11:25:00 2025
an...@google.com <an...@google.com> #32
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 Meerkat Feature Drop | 2024.3.2 Beta 1
- Android Gradle Plugin 8.10.0-beta01
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> #33
The fixes for this issue are now also available in:
- Android Studio Meerkat | 2024.3.1 Patch 1
- Android Gradle Plugin 8.9.1
We encourage you to try the latest update.
If you notice further issues or have questions, please file a new bug report.
Description
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.lang.Boolean.booleanValue()' on a null object reference
at BI.a(chromium-TTWebView.apk-default-694900001:14)
at org.chromium.android_webview.s.a(chromium-WebView.apk-default-694900001:7)
at org.chromium.android_webview.AwContents.onContainerViewChanged(chromium-WebView.apk-default-694900001:35)
at org.chromium.android_webview.AwContents.<init>(chromium-WebView.apk-default-694900001:5171)
at com.android.webview.chromium.WebViewChromium.b(chromium-WebView.apk-default-694900001:28)
at com.android.webview.chromium.E.run(chromium-WebView.apk-default-694900001:1)
at DJ.a(chromium-WebView.apk-default-694900001:37)
source code:(
public void onViewFocusChanged(boolean gainFocus) {
if (mHasViewFocus != null && mHasViewFocus == gainFocus) return;
mHasViewFocus = gainFocus;
onFocusChanged();
// Stylus Writing
if (mWebContents.getStylusWritingHandler() != null) {
mWebContents.getStylusWritingHandler().onFocusChanged(gainFocus);
}
}
check classfile and find ''"mHasViewFocus != null" is removed. But dex is normal. Then binary-search r8 commit and find the root cause is this commit: