New issue
Advanced search Search tips

Issue 827464 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner:
Closed: Apr 2018
Cc:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 3
Type: Bug



Sign in to add a comment

Upgrade Proguard to 6.0.2

Project Member Reported by agrieve@chromium.org, Mar 30 2018

Issue description

There's a new version of ProGuard out!

Sadly, I tried to upgrade to it and a bot failed (bug 827285).

Repro'ing was quite easy:

bin/run_cronet_test_instrumentation_apk --fast-local-dev -f "*Fixed*testWriteAfterRequestFailed*"

After much logging & debugging, I found the steps were:

03-29 22:31:34.219 12987 13005 W Andrew  : write(): 10
03-29 22:31:34.219 12987 13005 W Andrew  : checkNotClosed: false false
03-29 22:31:34.219 12987 13005 W Andrew  : ensureBufferHasRemaining: true
03-29 22:31:34.219 12987 13005 W Andrew  : uploadIfComplete
03-29 22:31:34.220 12987 13005 W Andrew  : write(): 1799990
03-29 22:31:34.220 12987 13005 W Andrew  : checkNotClosed: false false
03-29 22:31:34.220 12987 13005 W Andrew  : ensureBufferHasRemaining: true
03-29 22:31:34.220 12987 13005 W Andrew  : ensureBufferHasRemaining: false
03-29 22:31:37.221 12987 13005 W Andrew  : checkNotClosed: false false
03-29 22:31:37.221 12987 13005 W Andrew  : uploadBufferInternal before.
03-29 22:31:37.247 12987 13024 W Andrew  : onError: net::ERR_CONNECTION_REFUSED
03-29 22:31:37.248 12987 13024 W Andrew  : failWithException 1
03-29 22:31:37.248 12987 13024 W Andrew  : failWithException 2
03-29 22:31:37.248 12987 13024 W Andrew  : failWithException 4 - true
03-29 22:31:37.249 12987 13024 W Andrew  : sched onNativeAdapterDestroyed = true
03-29 22:31:37.250 12987 13005 W Andrew  : running onNativeAdapterDestroyed = true
03-29 22:31:37.251 12987 13005 W Andrew  : setRequestCompleted (exception=true)
03-29 22:31:37.252 12987 13005 W Andrew  : uploadBufferInternal after.
vvvv These three should not happen! vvv
03-29 22:40:32.628 15341 15356 W Andrew  : ensureBufferHasRemaining: false
03-29 22:40:32.628 15341 15356 W Andrew  : checkNotClosed: true false
03-29 22:40:32.629 15341 15356 W Test    : ught exception: : java.io.IOException

Found that the issue is that Proguard completely removed the call to checkNoException() that happens in uploadBufferInternal(). I verified this by looking at the dexdump of the apk. 

The method looks like:
    protected void checkNoException() throws IOException {
        if (mException != null) {
            throw mException;
        }
    }

And note that mException is set by setRequestCompleted(), which is included in the logs above, so it's not like ProGuard thinks that it's never being set.

No idea why ProGuard is optimizing it away.



I tried adding the -android flag to proguard, but it didn't help any. Perhaps there's another broken optimization for Proguard that we need to disable if we go ahead with the upgrade. I'll probably just abandon the update instead (there's no pressing need to update it).
 
Status: WontFix (was: Started)
Owner: tikuta@chromium.org
Status: Assigned (was: WontFix)
Summary: Upgrade Proguard to 6.0.2 (was: Upgrade Proguard to 6.0.1)
Looks like 6.0.2 may have fixed the issue.
Status: WontFix (was: Assigned)
6.0.2 also failed in the same test.
https://ci.chromium.org/buildbot/tryserver.chromium.android/android_cronet_tester/3603

Sign in to add a comment