Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CompatDx producting excessive "stack map table" warnings #15751

Open
Bencodes opened this issue Jun 27, 2022 · 8 comments
Open

CompatDx producting excessive "stack map table" warnings #15751

Bencodes opened this issue Jun 27, 2022 · 8 comments
Assignees
Labels
P2 We'll consider working on this in future. (Assignee optional) team-Android Issues for Android team type: bug

Comments

@Bencodes
Copy link
Contributor

Description of the bug:

After updating to rolling release 6.0.0-pre.20220526.1, CompatDx produces a massive amount of "stack map table" warnings.

Warning in bazel-out/darwin_arm64-dbg/bin/apps/entertainment/bin_devRelease_proguard.jar:com/google/android/exoplayer2/upstream/cache/CacheDataSource.class at Lcom/google/android/exoplayer2/upstream/cache/CacheDataSource;getResponse
Headers()Ljava/util/Map;:
Expected stack map table for method with non-linear control flow.
Warning in bazel-out/darwin_arm64-dbg/bin/apps/entertainment/bin_devRelease_proguard.jar:com/google/android/exoplayer2/upstream/cache/CacheDataSource.class at Lcom/google/android/exoplayer2/upstream/cache/CacheDataSource;close()V:
Expected stack map table for method with non-linear control flow.
Warning in bazel-out/darwin_arm64-dbg/bin/apps/entertainment/bin_devRelease_proguard.jar:com/lyft/protocgenlyftandroid/googlecommoncompanions/AnyDTOTypeAdapterFactory.class at Lcom/lyft/protocgenlyftandroid/googlecommoncompanions/An
yDTOTypeAdapterFactory;create(Lcom/google/gson/d;Lcom/google/gson/b/a;)Lcom/google/gson/n;:
Expected stack map table for method with non-linear control flow.
Warning in bazel-out/darwin_arm64-dbg/bin/apps/entertainment/bin_devRelease_proguard.jar:pb/api/endpoints/stripe/CardWireProto$a.class at Lpb/api/endpoints/stripe/CardWireProto$a;a(Lcom/squareup/wire/n;)Lpb/api/endpoints/stripe/Card
WireProto;:
Expected stack map table for method with non-linear control flow.
Warning in bazel-out/darwin_arm64-dbg/bin/apps/entertainment/bin_devRelease_proguard.jar:androidx/appcompat/widget/de.class at Landroidx/appcompat/widget/de;d(Landroid/database/Cursor;)V:
Expected stack map table for method with non-linear control flow.
Warning in bazel-out/darwin_arm64-dbg/bin/apps/entertainment/bin_devRelease_proguard.jar:pb/api/endpoints/v1/mapping_reports/LocalizedLocationDTOTypeAdapterFactory.class at Lpb/api/endpoints/v1/mapping_reports/LocalizedLocationDTOTy
peAdapterFactory;create(Lcom/google/gson/d;Lcom/google/gson/b/a;)Lcom/google/gson/n;:
Expected stack map table for method with non-linear control flow.
Warning in bazel-out/darwin_arm64-dbg/bin/apps/entertainment/bin_devRelease_proguard.jar:androidx/appcompat/widget/de.class at Landroidx/appcompat/widget/de;b(Ljava/lang/CharSequence;)Ljava/lang/CharSequence;:
Expected stack map table for method with non-linear control flow.
Warning in bazel-out/darwin_arm64-dbg/bin/apps/entertainment/bin_devRelease_proguard.jar:androidx/appcompat/widget/de.class at Landroidx/appcompat/widget/de;a(Landroid/widget/TextView;Ljava/lang/CharSequence;)V:
Expected stack map table for method with non-linear control flow.
Warning in bazel-out/darwin_arm64-dbg/bin/apps/entertainment/bin_devRelease_proguard.jar:androidx/appcompat/widget/de.class at Landroidx/appcompat/widget/de;e(Landroid/database/Cursor;)Landroid/graphics/drawable/Drawable;:
Expected stack map table for method with non-linear control flow.
Warning in bazel-out/darwin_arm64-dbg/bin/apps/entertainment/bin_devRelease_proguard.jar:androidx/appcompat/widget/de.class at Landroidx/appcompat/widget/de;f(Landroid/database/Cursor;)Landroid/graphics/drawable/Drawable;:
Expected stack map table for method with non-linear control flow.
Warning in bazel-out/darwin_arm64-dbg/bin/apps/entertainment/bin_devRelease_proguard.jar:androidx/appcompat/widget/de.class at Landroidx/appcompat/widget/de;a(Landroid/widget/ImageView;Landroid/graphics/drawable/Drawable;I)V:
Expected stack map table for method with non-linear control flow.
Warning in bazel-out/darwin_arm64-dbg/bin/apps/entertainment/bin_devRelease_proguard.jar:androidx/appcompat/widget/de.class at Landroidx/appcompat/widget/de;a(Ljava/lang/String;)Landroid/graphics/drawable/Drawable;:
Expected stack map table for method with non-linear control flow.

What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

# Enable experimental d8 merger
build --define=android_dexmerger_tool=d8_dexmerger
build --define=android_incremental_dexing_tool=d8_dexbuilder
build --define=android_standalone_dexing_tool=d8_compat_dx

Which operating system are you running Bazel on?

Mac OS

What is the output of bazel info release?

6.0.0-pre.20220526.1

If bazel info release returns development version or (@non-git), tell us how you built Bazel.

No response

What's the output of git remote get-url origin; git rev-parse master; git rev-parse HEAD ?

No response

Have you found anything relevant by searching the web?

No response

Any other information, logs, or outputs that you want to share?

No response

@Bencodes
Copy link
Contributor Author

This was originally reported here but has been broken out into a new issue specifically reporting the warnings.

@ted-xie
Copy link
Contributor

ted-xie commented Jul 7, 2022

From some quick internet sleuthing, it looks like these warning can be produced when the ClassWriter instance doesn't have ClassWriter.COMPUTE_FRAMES set. I see a bunch of references to ClassWriter and associated flags (COMPUTE_FRAMES, COMPUTE_MAXS) in the desugarer code but none for the dexer somehow. Needs more investigation. @Bencodes did you see this warning pop up with the legacy dexer?

@Bencodes
Copy link
Contributor Author

Bencodes commented Jul 7, 2022

@ted-xie not that i'm aware of but we haven't used the dx, nor does it actually work in our codebase. We hit errors like these #15742 (comment)

@Bencodes
Copy link
Contributor Author

Bencodes commented Jul 7, 2022

If it helps, I did a bisect to figure out which version of R8/D8 this issue was introduced in and found that the switch from version 2.1.96 (builds with with no warnings) to 2.2.64 (console gets spammed with warnings) is where it started happening. Note: I was only looking at major and not minor releases so skipped over 2.2.60.

@ted-xie
Copy link
Contributor

ted-xie commented Jul 7, 2022

Thanks, Ben. I tried to git-diff those two tags in the r8 repo and there was way too much to look at; I'll try to come up with some bisect automation to make this easier.

@Bencodes
Copy link
Contributor Author

Bencodes commented Aug 2, 2022

Just to refine this search a bit more in case it helps, it seems like the stack map issues were introduced in 2.2.60.

@ted-xie ted-xie added P2 We'll consider working on this in future. (Assignee optional) and removed untriaged labels Aug 3, 2022
@ted-xie
Copy link
Contributor

ted-xie commented Aug 3, 2022

Thanks, Ben. I'm marking this P2 for now; I'll try to jump back on this after a few more things clear off my plate.

@Bencodes
Copy link
Contributor Author

@ted-xie to quickly circle back here - this doesn't seem to be an issue using R8 instead of Proguard.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P2 We'll consider working on this in future. (Assignee optional) team-Android Issues for Android team type: bug
Projects
None yet
Development

No branches or pull requests

4 participants