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

App Crash due to java.lang.StackOverflowError: stack size 1037KB #2541

Closed
mhmdJalal opened this issue Feb 19, 2021 · 1 comment
Closed

App Crash due to java.lang.StackOverflowError: stack size 1037KB #2541

mhmdJalal opened this issue Feb 19, 2021 · 1 comment

Comments

@mhmdJalal
Copy link

hi, we are using coroutines on our project,
we get the following error report on firebase

Fatal Exception: java.lang.StackOverflowError: stack size 1037KB
       at kotlinx.coroutines.android.HandlerContext.getImmediate(HandlerDispatcher.kt:105)
       at kotlinx.coroutines.MainCoroutineDispatcher.toStringInternalImpl(MainCoroutineDispatcher.kt:64)
       at kotlinx.coroutines.android.HandlerContext.toString(HandlerDispatcher.kt:152)
       at java.lang.String.valueOf(String.java:2827)
       at java.lang.StringBuilder.append(StringBuilder.java:132)
       at kotlinx.coroutines.internal.DispatchedContinuation.toString(DispatchedContinuation.kt:251)
       at kotlinx.coroutines.DebugStringsKt.toDebugString(DebugStrings.kt:16)
       at kotlinx.coroutines.CancellableContinuationImpl.toString(CancellableContinuationImpl.kt:506)
       at java.lang.String.valueOf(String.java:2827)
       at java.lang.StringBuilder.append(StringBuilder.java:132)
       at kotlinx.coroutines.ResumeAwaitOnCompletion.toString(JobSupport.kt:1414)
       at java.lang.String.valueOf(String.java:2827)
       at java.lang.StringBuilder.append(StringBuilder.java:132)
       at kotlinx.coroutines.DisposeOnCancel.toString(CancellableContinuation.kt:385)
       at java.lang.String.valueOf(String.java:2827)
       at java.lang.StringBuilder.append(StringBuilder.java:132)
       at kotlinx.coroutines.CompletedContinuation.toString(:22)
       at java.lang.String.valueOf(String.java:2827)
       at java.lang.StringBuilder.append(StringBuilder.java:132)
       at kotlinx.coroutines.CancellableContinuationImpl.toString(CancellableContinuationImpl.kt:506)
       at java.lang.String.valueOf(String.java:2827)
       at java.lang.StringBuilder.append(StringBuilder.java:132)
       at kotlinx.coroutines.ResumeAwaitOnCompletion.toString(JobSupport.kt:1414)
       at java.lang.String.valueOf(String.java:2827)
       at java.lang.StringBuilder.append(StringBuilder.java:132)
       at kotlinx.coroutines.DisposeOnCancel.toString(CancellableContinuation.kt:385)
       at java.lang.String.valueOf(String.java:2827)
       at java.lang.StringBuilder.append(StringBuilder.java:132)
       at kotlinx.coroutines.CompletedContinuation.toString(:22)
       at java.lang.String.valueOf(String.java:2827)
       at java.lang.StringBuilder.append(StringBuilder.java:132)
       at kotlinx.coroutines.CancellableContinuationImpl.toString(CancellableContinuationImpl.kt:506)
       at java.lang.String.valueOf(String.java:2827)
       at java.lang.StringBuilder.append(StringBuilder.java:132)
       at kotlinx.coroutines.ResumeAwaitOnCompletion.toString(JobSupport.kt:1414)
       at java.lang.String.valueOf(String.java:2827)
       at java.lang.StringBuilder.append(StringBuilder.java:132)
       at kotlinx.coroutines.DisposeOnCancel.toString(CancellableContinuation.kt:385)
       at java.lang.String.valueOf(String.java:2827)
       at java.lang.StringBuilder.append(StringBuilder.java:132)
       at kotlinx.coroutines.CompletedContinuation.toString(:22)
       at java.lang.String.valueOf(String.java:2827)
       at java.lang.StringBuilder.append(StringBuilder.java:132)
       at kotlinx.coroutines.CancellableContinuationImpl.toString(CancellableContinuationImpl.kt:506)
       at java.lang.String.valueOf(String.java:2827)
       at java.lang.StringBuilder.append(StringBuilder.java:132)
       at kotlinx.coroutines.ResumeAwaitOnCompletion.toString(JobSupport.kt:1414)
       at java.lang.String.valueOf(String.java:2827)
       at java.lang.StringBuilder.append(StringBuilder.java:132)
       at kotlinx.coroutines.DisposeOnCancel.toString(CancellableContinuation.kt:385)
       at java.lang.String.valueOf(String.java:2827)
       at java.lang.StringBuilder.append(StringBuilder.java:132)
       at kotlinx.coroutines.CompletedContinuation.toString(:22)
       at java.lang.String.valueOf(String.java:2827)
       at java.lang.StringBuilder.append(StringBuilder.java:132)
       at kotlinx.coroutines.CancellableContinuationImpl.toString(CancellableContinuationImpl.kt:506)
       at java.lang.String.valueOf(String.java:2827)
       at java.lang.StringBuilder.append(StringBuilder.java:132)
       at kotlinx.coroutines.ResumeAwaitOnCompletion.toString(JobSupport.kt:1414)
       at java.lang.String.valueOf(String.java:2827)
       at java.lang.StringBuilder.append(StringBuilder.java:132)
       at kotlinx.coroutines.DisposeOnCancel.toString(CancellableContinuation.kt:385)
       at java.lang.String.valueOf(String.java:2827)
       at java.lang.StringBuilder.append(StringBuilder.java:132)
       at kotlinx.coroutines.CompletedContinuation.toString(:22)
       at java.lang.String.valueOf(String.java:2827)
       at java.lang.StringBuilder.append(StringBuilder.java:132)
       at kotlinx.coroutines.CancellableContinuationImpl.toString(CancellableContinuationImpl.kt:506)
       at java.lang.String.valueOf(String.java:2827)
       at java.lang.StringBuilder.append(StringBuilder.java:132)
       at kotlinx.coroutines.ResumeAwaitOnCompletion.toString(JobSupport.kt:1414)
       at java.lang.String.valueOf(String.java:2827)
       at java.lang.StringBuilder.append(StringBuilder.java:132)
       at kotlinx.coroutines.DisposeOnCancel.toString(CancellableContinuation.kt:385)
       at java.lang.String.valueOf(String.java:2827)
       at java.lang.StringBuilder.append(StringBuilder.java:132)
       at kotlinx.coroutines.CompletedContinuation.toString(:22)
       at java.lang.String.valueOf(String.java:2827)
       at java.lang.StringBuilder.append(StringBuilder.java:132)
       at kotlinx.coroutines.CancellableContinuationImpl.toString(CancellableContinuationImpl.kt:506)
       at java.lang.String.valueOf(String.java:2827)
       at java.lang.StringBuilder.append(StringBuilder.java:132)
       at kotlinx.coroutines.ResumeAwaitOnCompletion.toString(JobSupport.kt:1414)
       at java.lang.String.valueOf(String.java:2827)
       at java.lang.StringBuilder.append(StringBuilder.java:132)
       at kotlinx.coroutines.DisposeOnCancel.toString(CancellableContinuation.kt:385)
       at java.lang.String.valueOf(String.java:2827)
       at java.lang.StringBuilder.append(StringBuilder.java:132)
       at kotlinx.coroutines.CompletedContinuation.toString(:22)
       at java.lang.String.valueOf(String.java:2827)
       at java.lang.StringBuilder.append(StringBuilder.java:132)
       at kotlinx.coroutines.CancellableContinuationImpl.toString(CancellableContinuationImpl.kt:506)
       at java.lang.String.valueOf(String.java:2827)
       at java.lang.StringBuilder.append(StringBuilder.java:132)
       at kotlinx.coroutines.ResumeAwaitOnCompletion.toString(JobSupport.kt:1414)
       at java.lang.String.valueOf(String.java:2827)
       at java.lang.StringBuilder.append(StringBuilder.java:132)
       at kotlinx.coroutines.DisposeOnCancel.toString(CancellableContinuation.kt:385)
       at java.lang.String.valueOf(String.java:2827)
       at java.lang.StringBuilder.append(StringBuilder.java:132)
       at kotlinx.coroutines.CompletedContinuation.toString(:22)
       at java.lang.String.valueOf(String.java:2827)
       at java.lang.StringBuilder.append(StringBuilder.java:132)
       at kotlinx.coroutines.CancellableContinuationImpl.toString(CancellableContinuationImpl.kt:506)
       at java.lang.String.valueOf(String.java:2827)
       at java.lang.StringBuilder.append(StringBuilder.java:132)
       at kotlinx.coroutines.ResumeAwaitOnCompletion.toString(JobSupport.kt:1414)
       at java.lang.String.valueOf(String.java:2827)
       at java.lang.StringBuilder.append(StringBuilder.java:132)
       at kotlinx.coroutines.DisposeOnCancel.toString(CancellableContinuation.kt:385)
       at java.lang.String.valueOf(String.java:2827)
       at java.lang.StringBuilder.append(StringBuilder.java:132)
       at kotlinx.coroutines.CompletedContinuation.toString(:22)
       at java.lang.String.valueOf(String.java:2827)
       at java.lang.StringBuilder.append(StringBuilder.java:132)
       at kotlinx.coroutines.CancellableContinuationImpl.toString(CancellableContinuationImpl.kt:506)
       at java.lang.String.valueOf(String.java:2827)
       at java.lang.StringBuilder.append(StringBuilder.java:132)
       at kotlinx.coroutines.ResumeAwaitOnCompletion.toString(JobSupport.kt:1414)
       at java.lang.String.valueOf(String.java:2827)
       at java.lang.StringBuilder.append(StringBuilder.java:132)
       at kotlinx.coroutines.DisposeOnCancel.toString(CancellableContinuation.kt:385)
       at java.lang.String.valueOf(String.java:2827)
       at java.lang.StringBuilder.append(StringBuilder.java:132)
       at kotlinx.coroutines.CompletedContinuation.toString(:22)
       at java.lang.String.valueOf(String.java:2827)
       at java.lang.StringBuilder.append(StringBuilder.java:132)
       at kotlinx.coroutines.CancellableContinuationImpl.toString(CancellableContinuationImpl.kt:506)
       at java.lang.String.valueOf(String.java:2827)
       at java.lang.StringBuilder.append(StringBuilder.java:132)
       at kotlinx.coroutines.ResumeAwaitOnCompletion.toString(JobSupport.kt:1414)
       at java.lang.String.valueOf(String.java:2827)
       at java.lang.StringBuilder.append(StringBuilder.java:132)
       at kotlinx.coroutines.JobSupport.notifyCompletion(JobSupport.kt:1536)
       at kotlinx.coroutines.JobSupport.completeStateFinalization(JobSupport.kt:323)
       at kotlinx.coroutines.JobSupport.finalizeFinishingState(JobSupport.kt:240)
       at kotlinx.coroutines.JobSupport.tryMakeCompletingSlowPath(JobSupport.kt:903)
       at kotlinx.coroutines.JobSupport.tryMakeCompleting(JobSupport.kt:860)
       at kotlinx.coroutines.JobSupport.makeCompleting$kotlinx_coroutines_core(JobSupport.kt:803)
       at kotlinx.coroutines.CompletableDeferredImpl.complete(CompletableDeferred.kt:92)
       at com.jakewharton.retrofit2.adapter.kotlin.coroutines.CoroutineCallAdapterFactory$ResponseCallAdapter$adapt$2.onResponse(CoroutineCallAdapterFactory.kt:134)
       at retrofit2.OkHttpCall$1.onResponse(OkHttpCall.java:150)
       at com.google.firebase.perf.network.InstrumentOkHttpEnqueueCallback.onResponse(InstrumentOkHttpEnqueueCallback.java:69)
       at okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.kt:504)
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
       at java.lang.Thread.run(Thread.java:764)

Previously I used Coroutines version 1.3.7 nothing happened, then after I updated to version 1.4.1 Firebase reported several devices such as Xiaomi Redmi 5 Plus and Xiaomi Redmi Note 6 Pro crashing.

thank you, hope you can help us solve this problem

@qwwdfsad
Copy link
Member

This seems to be #2371 that has been fixed in 1.4.2. Please update and see if the issue is resolved

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants