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

Sentry 6.7.0 causes StackOverflow when linting OSS Licences Plugin #2364

Closed
barry-irvine opened this issue Nov 15, 2022 · 12 comments · Fixed by #2578
Closed

Sentry 6.7.0 causes StackOverflow when linting OSS Licences Plugin #2364

barry-irvine opened this issue Nov 15, 2022 · 12 comments · Fixed by #2578
Labels
Platform: Android Type: Bug Something isn't working

Comments

@barry-irvine
Copy link

Integration

sentry-android

Build System

Gradle

AGP Version

7.3.1

Proguard

Enabled

Version

6.7.0

Steps to Reproduce

The project build.gradle has the following dependency

classpath "com.google.android.gms:oss-licenses-plugin:0.10.5"

The app module build.gradle has the following plugin enabled:

id 'com.google.android.gms.oss-licenses-plugin'

and adds the following implementation:

implementation "com.google.android.gms:play-services-oss-licenses:17.0.0"

I then run

./gradlew lintRelease

Expected Result

App lints successfully

Actual Result

I get the following error

Execution failed for task ':app:releaseOssLicensesTask'.
> java.lang.StackOverflowError (no error message)
@romtsn
Copy link
Member

romtsn commented Nov 15, 2022

Hey, thanks for the report. Could you share how do you define the sentry dependency? Also, are you using our Sentry Android Gradle plugin?

@barry-irvine
Copy link
Author

Yep. Using your plugin:

id 'io.sentry.android.gradle' version '3.3.0' // Nov 2022

And adding:

     implementation "io.sentry:sentry-android:6.7.0"
     implementation "io.sentry:sentry-android-okhttp:6.7.0"

@barry-irvine
Copy link
Author

I should also mention that it works fine with Sentry 6.6.0 and no other dependencies/versions being changed.

@romtsn
Copy link
Member

romtsn commented Nov 15, 2022

interesting. Do you keep the gradle plugin version at 3.3.0 when downgrading sentry deps to 6.6.0?

@barry-irvine
Copy link
Author

barry-irvine commented Nov 15, 2022 via email

@romtsn
Copy link
Member

romtsn commented Nov 16, 2022

One more question - do you use jetpack compose in your app?

@barry-irvine
Copy link
Author

Yes. Currently using Compose 1.2.0 with Compiler 1.3.2 and various accompanist libraries

@romtsn
Copy link
Member

romtsn commented Nov 17, 2022

alright, I think I know what the problem is. You can try to mitigate it by disabling auto-installation in the plugin configuration

sentry {
  autoInstallation.enabled = false
}

We'll try to fix it in the meantime

@romtsn romtsn added Type: Bug Something isn't working and removed waiting for feedback labels Nov 17, 2022
@barry-irvine
Copy link
Author

Any news on this? You said the effort was small and now you're saying there's a bug between 6.6.0 and 6.8.0 but still no fix for this. If I disable the auto installation then the chances are that it will get forgotten when this code actually does work...

@Melle010
Copy link

Hi, I also get this StackOverflowError when I include the Android Glance library which uses Jetpack Compose internally:

Cause: java.lang.StackOverflowError
	at com.google.common.cache.LocalCache$Segment.setValue(LocalCache.java:2009)
	at com.google.common.cache.LocalCache$Segment.storeLoadedValue(LocalCache.java:3158)
	at com.google.common.cache.LocalCache$Segment.getAndRecordStats(LocalCache.java:2318)
	at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2279)
	at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2155)
	at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2045)
	at com.google.common.cache.LocalCache.get(LocalCache.java:3962)
	at com.google.common.cache.LocalCache$LocalManualCache.get(LocalCache.java:4859)
	at org.gradle.internal.resources.AbstractResourceLockRegistry.getOrRegisterResourceLock(AbstractResourceLockRegistry.java:45)
	at org.gradle.internal.work.DefaultWorkerLeaseService$WorkerLeaseLockRegistry.getResourceLock(DefaultWorkerLeaseService.java:351)
	at org.gradle.internal.work.DefaultWorkerLeaseService.getWorkerLease(DefaultWorkerLeaseService.java:93)
	at org.gradle.internal.work.DefaultWorkerLeaseService.getWorkerLease(DefaultWorkerLeaseService.java:100)
	at org.gradle.internal.work.DefaultWorkerLeaseService.getWorkerLease(DefaultWorkerLeaseService.java:55)
	at org.gradle.internal.operations.DefaultBuildOperationQueue.<init>(DefaultBuildOperationQueue.java:56)
	at org.gradle.internal.operations.DefaultBuildOperationQueueFactory.create(DefaultBuildOperationQueueFactory.java:31)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.executeInParallel(DefaultBuildOperationExecutor.java:132)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.runAll(DefaultBuildOperationExecutor.java:102)
	at org.gradle.api.internal.artifacts.ivyservice.resolveengine.artifact.ParallelResolveArtifactSet$VisitingSet.visit(ParallelResolveArtifactSet.java:66)
	at org.gradle.api.internal.artifacts.DefaultResolvedDependency.sort(DefaultResolvedDependency.java:129)
	at org.gradle.api.internal.artifacts.DefaultResolvedDependency.getModuleArtifacts(DefaultResolvedDependency.java:107)
	at org.gradle.api.internal.artifacts.DefaultResolvedDependency.getAllModuleArtifacts(DefaultResolvedDependency.java:113)
	at org.gradle.api.internal.artifacts.DefaultResolvedDependency.getAllModuleArtifacts(DefaultResolvedDependency.java:115)
	at org.gradle.api.internal.artifacts.DefaultResolvedDependency.getAllModuleArtifacts(DefaultResolvedDependency.java:115)
	at org.gradle.api.internal.artifacts.DefaultResolvedDependency.getAllModuleArtifacts(DefaultResolvedDependency.java:115)
...

It helped to disable auto installation for Sentry, but a bugfix would be great so we can use the auto installation feature again.

@EmDee
Copy link

EmDee commented Feb 20, 2023

@romtsn any updates here?

@romtsn
Copy link
Member

romtsn commented Mar 1, 2023

hey, apologies for holding this off for so long, I've just opened up a PR (#2578) which fixes the issue, so it should be resolved in the upcoming release of the Gradle plugin.

Also, added an integration test for the gradle plugin to make sure we do not break this again in the future getsentry/sentry-android-gradle-plugin#442. Thanks everyone for the patience!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Platform: Android Type: Bug Something isn't working
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

5 participants