Status Update
Comments
ra...@google.com <ra...@google.com> #2
1. Have you saw crash in real device or only in simulators?
2. Do you use dynamic feature for language ID?
db...@digitalfleet.com <db...@digitalfleet.com> #3
Tested on Android 12 Emulator with custom executor, but cannot repro this issue.
ra...@google.com <ra...@google.com> #4
-
Second crash in the description is from a real device. Experienced it myself on two different Xiaomi phones, plus lots of crashes from users in the Google Play console.
-
Dynamic features are not used in the application.
As a wild guess, I have downgraded build tools from 31.0.0 to 30.0.3, compileSdk from 31 to 30, and moved all work with Language ID to the service in a separate process (just to be sure that crash can kill secondary process instead of main). This combination is in beta for 2 days by now and I don't see any SIGSEGV crashes.
db...@digitalfleet.com <db...@digitalfleet.com> #5
Hmm, I feel the crash might be something related to separate/secondary process.
I also changed compileSdk and targetSDK to 31 but still cannot repro this issue.
ra...@google.com <ra...@google.com> #6
On the contrary, there was no separate process before, when crashes started.
In the new build (with the aforementioned changes) I can see SIGSEGV crash, but only one instead of dozens and it has a bit different backtrace:
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR)
liblanguage_id_jni.so (offset 0x11e000)
backtrace:
#00 pc 000000000003c7c0 /data/app/azagroup.reedy-mF7zTu2bv_ELlbFArwNgqA==/split_config.arm64_v8a.apk!lib/arm64-v8a/liblanguage_id_jni.so (offset 0x11e000)
#00 pc 000000000003b960 /data/app/azagroup.reedy-mF7zTu2bv_ELlbFArwNgqA==/split_config.arm64_v8a.apk!lib/arm64-v8a/liblanguage_id_jni.so (offset 0x11e000)
#00 pc 000000000003bb48 /data/app/azagroup.reedy-mF7zTu2bv_ELlbFArwNgqA==/split_config.arm64_v8a.apk!lib/arm64-v8a/liblanguage_id_jni.so (offset 0x11e000)
#00 pc 000000000003bafc /data/app/azagroup.reedy-mF7zTu2bv_ELlbFArwNgqA==/split_config.arm64_v8a.apk!lib/arm64-v8a/liblanguage_id_jni.so (offset 0x11e000)
#00 pc 0000000000036c98 /data/app/azagroup.reedy-mF7zTu2bv_ELlbFArwNgqA==/split_config.arm64_v8a.apk!lib/arm64-v8a/liblanguage_id_jni.so (offset 0x11e000)
#00 pc 0000000000032714 /data/app/azagroup.reedy-mF7zTu2bv_ELlbFArwNgqA==/split_config.arm64_v8a.apk!lib/arm64-v8a/liblanguage_id_jni.so (offset 0x11e000)
#00 pc 0000000000031cac /data/app/azagroup.reedy-mF7zTu2bv_ELlbFArwNgqA==/split_config.arm64_v8a.apk!lib/arm64-v8a/liblanguage_id_jni.so (offset 0x11e000)
#00 pc 0000000000057438 /data/app/azagroup.reedy-mF7zTu2bv_ELlbFArwNgqA==/oat/arm64/base.odex (offset 0x57000)
ra...@google.com <ra...@google.com> #7
FYI, ML Kit launched a new language ID SDK in the latest release, which uses a new language ID model.
Could you try the new SDK version(17.0.0) to check if you can still repro this native crash? Thanks!
ra...@google.com <ra...@google.com> #8
Thank you, I'll try it and check.
Description
Version used: 2.3.4
Devices/Android versions reproduced on: Android Studio
On the latest version getting the following lint error this issue does not occur on 2.3.3. All of my periodic jobs intervals are at least 30 minutes.
lint-results-debug.xml
```
<issue
id="LintError"
severity="Error"
message="Unexpected failure during lint analysis of MyWorkManagerWrapper.java (this is a bug in lint or one of the libraries it depends on)

Message: null cannot be cast to non-null type kotlin.Long

The crash seems to involve the detector `androidx.work.lint.InvalidPeriodicWorkRequestIntervalDetector`.
You can try disabling it with something like this:
 android {
 lintOptions {
 disable "InvalidPeriodicWorkRequestInterval"
 }
 }

Stack: `TypeCastException:InvalidPeriodicWorkRequestIntervalDetector.visitConstructor(InvalidPeriodicWorkRequestIntervalDetector.kt:70)←UElementVisitor$DelegatingPsiVisitor.visitNewExpression(UElementVisitor.kt:1099)←UElementVisitor$DelegatingPsiVisitor.visitCallExpression(UElementVisitor.kt:1063)←UCallExpression$DefaultImpls.accept(UCallExpression.kt:99)←UCallExpressionEx$DefaultImpls.accept(UCallExpression.kt:-1)←JavaConstructorUCallExpression.accept(javaUCallExpressions.kt:123)←UQualifiedReferenceExpression$DefaultImpls.accept(UQualifiedReferenceExpression.kt:47)←JavaUCompositeQualifiedExpression.accept(JavaUCompositeQualifiedExpression.kt:23)`

You can set environment variable `LINT_PRINT_STACKTRACE=true` to dump a full stacktrace to stdout."
category="Lint"
priority="10"
summary="Lint Failure"
explanation="This issue type represents a problem running lint itself. Examples include failure to find bytecode for source files (which means certain detectors could not be run), parsing errors in lint configuration files, etc.

These errors are not errors in your own code, but they are shown to make it clear that some checks were not completed.">
<location
file="FILE_PATH/MyWorkManagerWrapper.java"/>
</issue>
```
Sample Code:
```
workRequest = new PeriodicWorkRequest.Builder(CustomWorker.class, workerType.interval, workerType.timeUnit).build();
workManager.enqueueUniquePeriodicWork(workerType.uniqueName, workerType.workPolicy, workRequest);
```
```
public enum PeriodicWorkerType {
PERIODIC_JOB("PERIODIC_JOB_V1", 30, TimeUnit.Minutes, ExistingPeriodicWorkPolicy.KEEP),
public final String uniqueName;
public final long interval;
public final TimeUnit timeUnit;
public final ExistingPeriodicWorkPolicy workPolicy;
PeriodicWorkerType(String uniqueName, long interval, TimeUnit timeUnit, ExistingPeriodicWorkPolicy workPolicy) {
this.uniqueName = uniqueName;
this.interval = interval;
this.timeUnit = timeUnit;
this.workPolicy = workPolicy;
}
}
```
If this is a bug in the library, we would appreciate if you could attach:
- Sample project to trigger the issue.
- A screenrecord or screenshots showing the issue (if UI related).