Bug P4
Status Update
Comments
ke...@google.com <ke...@google.com> #2
Some related mappings.
io.fabric.sdk.android.services.common.ExecutorUtils -> d.a.a.a.a.b.x:
...
958:958:java.lang.Object kotlin.jvm.internal.TypeIntrinsics.beforeCheckcastToFunctionOfArity(java.lang.Object,int):341 -> a
959:959:java.lang.Object kotlin.jvm.internal.TypeIntrinsics.beforeCheckcastToFunctionOfArity(java.lang.Object,int):342:342 -> a
...
20:20:void kotlin.jvm.internal.TypeIntrinsics.throwCce(java.lang.String):26:26 -> b
20:20:void kotlin.jvm.internal.TypeIntrinsics.throwCce(java.lang.Object,java.lang.String):22 -> b
which means, this line:https://github.com/JetBrains/kotlin/blob/master/libraries/stdlib/jvm/runtime/kotlin/jvm/internal/TypeIntrinsics.java#L342 is inlined to io.fabric's report generating routine.
io.fabric.sdk.android.services.common.ExecutorUtils -> d.a.a.a.a.b.x:
...
958:958:java.lang.Object kotlin.jvm.internal.TypeIntrinsics.beforeCheckcastToFunctionOfArity(java.lang.Object,int):341 -> a
959:959:java.lang.Object kotlin.jvm.internal.TypeIntrinsics.beforeCheckcastToFunctionOfArity(java.lang.Object,int):342:342 -> a
...
20:20:void kotlin.jvm.internal.TypeIntrinsics.throwCce(java.lang.String):26:26 -> b
20:20:void kotlin.jvm.internal.TypeIntrinsics.throwCce(java.lang.Object,java.lang.String):22 -> b
which means, this line:
ne...@gmail.com <ne...@gmail.com> #3
For the record.
Same result with R8 1.5.33
I tested to fully remove Crashlytics + fabric and same crash occurs but of course with different inlining:
Caused by: java.lang.ClassCastException: ta cannot be cast to kotlin.jvm.functions.Function1
at e.f.b.k.b(Intrinsics.java:5)
at e.f.b.k.a(Intrinsics.java:1034)
at c.f.a.c.b.a.b.f.a(EventBus.kt:12)
at k.a.a.a.l.l.onResume(BaseMenuActivity.kt:44)
at xxxxxxxStartActivity.onResume(StartActivity.kt:1)
at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1413)
at android.app.Activity.performResume(Activity.java:7292)
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3803)
at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3843)
at android.app.servertransaction.ResumeActivityItem.execute(ResumeActivityItem.java:51)
at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:145)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:70)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1823)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:198)
at android.app.ActivityThread.main(ActivityThread.java:6729)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:876)
kotlin.jvm.internal.Intrinsics -> e.f.b.k:
But this one have a million lines after mapping to -> a and -> b
New APK and mapping sent to Jinseong.
Same result with R8 1.5.33
I tested to fully remove Crashlytics + fabric and same crash occurs but of course with different inlining:
Caused by: java.lang.ClassCastException: ta cannot be cast to kotlin.jvm.functions.Function1
at e.f.b.k.b(Intrinsics.java:5)
at e.f.b.k.a(Intrinsics.java:1034)
at c.f.a.c.b.a.b.f.a(EventBus.kt:12)
at k.a.a.a.l.l.onResume(BaseMenuActivity.kt:44)
at xxxxxxxStartActivity.onResume(StartActivity.kt:1)
at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1413)
at android.app.Activity.performResume(Activity.java:7292)
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3803)
at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3843)
at android.app.servertransaction.ResumeActivityItem.execute(ResumeActivityItem.java:51)
at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:145)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:70)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1823)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:198)
at android.app.ActivityThread.main(ActivityThread.java:6729)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:876)
kotlin.jvm.internal.Intrinsics -> e.f.b.k:
But this one have a million lines after mapping to -> a and -> b
New APK and mapping sent to Jinseong.
zv...@swc.co.il <zv...@swc.co.il> #4
As far as I understand the issue so far, when we merge Kotlin's FunctionX instances into a lambda group, we define it as a sub class of kotlin Lambda and call its constructor with a proper arity. For example, that `ta` is collecting mergeable instances of Function1, which literally inputs one argument and has a lambda function, invoke(Object). The issue is, in the generated lambda group <init>, I saw that arity is set as 0, not 1. Then, before hitting the direct type match (https://github.com/JetBrains/kotlin/blob/master/libraries/stdlib/jvm/runtime/kotlin/jvm/internal/TypeIntrinsics.java#L264 ), it's matched with FunctionBase (a subtype of Lambda) first, and tried to retrieve the arity, where now at runtime that merged group returned a wrong arity. Manually over-writing that arity to the correct one made that type free from casting exceptions. (There are more lambda groups with wrong arities, so the report saw a similar cast exception with a different type.)
It's quite not trivial to reproduce the issue locally. To understand where such arity can go wrong, I add some logging (to R8 1.5). Also, instead of using the size of parameters of the representative method (which could be altered, e.g., via unused argument removal), I change it to use the arity from Kotlin FunctionX interface name directly. See the attached diff.txt.
Tolriq, could you try the attached r8.jar? For logging messages, you can email it to me. Also, hope the resulting apk doesn't crash at runtime. And if so, that would be the potential fix, but I still want to reproduce the issue locally. Thanks!
buildscript {
dependencies {
classpath files($PATH_TO_R8_JAR) // Must be before the Gradle Plugin for Android.
classpath 'com.android.tools.build:gradle:X.Y.Z' // Your current AGP version.
}
}
It's quite not trivial to reproduce the issue locally. To understand where such arity can go wrong, I add some logging (to R8 1.5). Also, instead of using the size of parameters of the representative method (which could be altered, e.g., via unused argument removal), I change it to use the arity from Kotlin FunctionX interface name directly. See the attached diff.txt.
Tolriq, could you try the attached r8.jar? For logging messages, you can email it to me. Also, hope the resulting apk doesn't crash at runtime. And if so, that would be the potential fix, but I still want to reproduce the issue locally. Thanks!
buildscript {
dependencies {
classpath files($PATH_TO_R8_JAR) // Must be before the Gradle Plugin for Android.
classpath 'com.android.tools.build:gradle:X.Y.Z' // Your current AGP version.
}
}
fr...@gmail.com <fr...@gmail.com> #5
Oops, the jar attached at comment #4 has been built from ToT (1.6.2-dev). Please try this one (or both :D)
ke...@google.com <ke...@google.com> #6
I doubt anyone work on Week-End but quickly tested with the 1.5 version and now have strange crash instead of previous one:)
2019-05-25 11:14:11.115 29479-29577/? E/AndroidRuntime: FATAL EXCEPTION: AppUpdateService
java.lang.AbstractMethodError: abstract method "void b4.h.a.e.a.c.l.a()"
at b4.h.a.e.a.c.l.run(Unknown Source:0)
at android.os.Handler.handleCallback(Handler.java:874)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loop(Looper.java:198)
at android.os.HandlerThread.run(HandlerThread.java:65)
Will do complete tests and send logs later today.
2019-05-25 11:14:11.115 29479-29577/? E/AndroidRuntime: FATAL EXCEPTION: AppUpdateService
java.lang.AbstractMethodError: abstract method "void b4.h.a.e.a.c.l.a()"
at b4.h.a.e.a.c.l.run(Unknown Source:0)
at android.os.Handler.handleCallback(Handler.java:874)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loop(Looper.java:198)
at android.os.HandlerThread.run(HandlerThread.java:65)
Will do complete tests and send logs later today.
Description
maybe is a Duplicate of 176032263 or 176408468.
I'm using V3 GA API, i've been using the same script for 3 years and it has always worked very fast.
Now the response is very slow, sometimes i get Limit quota error and sometimes is fast like in the past
I also tried another account linked to the same ids (account)...same issue.
In console developer i see
we are below the limit quota
and this message in Quota "Quota exceeded error count (3 h) - Queries per day"
average latency: 3 min, Latency - 99th percentile: 8 min
Expected Behavior:
API respond as before
Steps to Reproduce:
an example of a query
report = new gapi.analytics.report.Data({
query: {
'ids': 'ga:XXXXXXXX',
'start-date': '2020-05-22,
'end-date': 'yesterday',
'metrics': 'ga:pageviews',
'dimensions': 'ga:yearMonth',
'filters':'ga:pagePath=~(Rustico)|(Rustic)|(Landhäuser)|(Старинные);ga:pagePath=~(Umbria)|(Umbria)|(Umbrien)|(Умбрия)',
'sort':'ga:yearMonth'
}
});
Thank you
best regards
Francesco