question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ChannelAtomicCancelStressTest fails with CoroutinesInternalError caused by ClassCastException

See original GitHub issue

https://teamcity.jetbrains.com/viewLog.html?buildId=2565122&buildTypeId=KotlinTools_KotlinxCoroutines_BuildWindows ChannelAtomicCancelStressTest.testAtomicCancelStress[RendezvousChannel]

kotlinx.coroutines.CoroutinesInternalError: Fatal exception in coroutines machinery for CancellableContinuation(DispatchedContinuation[ThreadPoolDispatcher[2, ChannelAtomicCancelStressTest], Continuation at kotlinx.coroutines.channels.ChannelAtomicCancelStressTest$launchReceiver$1.invokeSuspend(ChannelAtomicCancelStressTest.kt:135)@7015c908]){CancelledContinuation[kotlinx.coroutines.JobCancellationException: Job was cancelled; job="coroutine#563998":StandaloneCoroutine{Cancelled}@7ed2297a]}@7aeda278. Please read KDoc to 'handleFatalException' method and report this incident to maintainers
	at kotlinx.coroutines.DispatchedTask.handleFatalException$kotlinx_coroutines_core(DispatchedTask.kt:86)
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:57)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.ClassCastException: kotlin.coroutines.jvm.internal.CompletedContinuation cannot be cast to kotlinx.coroutines.DispatchedContinuation
	at kotlinx.coroutines.CoroutineDispatcher.releaseInterceptedContinuation(CoroutineDispatcher.kt:106)
	at kotlin.coroutines.jvm.internal.ContinuationImpl.releaseIntercepted(ContinuationImpl.kt:118)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:39)
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:192)
	... 7 more

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:13 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
debajcommented, Mar 10, 2020

The above crash log is reproducible in kotlinx.coroutines version 1.3.3 and 1.3.4

0reactions
elizarovcommented, Jul 2, 2020

Recent versions of coroutines are not compatible with older versions of Kotlin.

Read more comments on GitHub >

github_iconTop Results From Across the Web

JVM / IR: ClassCastException caused by runBlocking awaiting ...
Though Kotlin shows error when using Result as return type it was working good for us until we introduced coroutines.
Read more >
Explanation of ClassCastException in Java - Stack Overflow
Cat c = (Dog) a; // Will cause a compiler error for type mismatch; ... A class cast exception is thrown by Java...
Read more >
Handling the ClassCastException Runtime Exception in Java
The ClassCastException in Java happens when the JVM tries to cast an object to a class (or in some instances, an interface) and...
Read more >
PM80589: JAVA.LANG.CLASSCASTEXCEPTION AFTER AN ...
Error description​​ A ClassCastException occurs after an application restart because WebSphere Application Server continues to hold references to the application.
Read more >
Explanation of ClassCastException in Java - Baeldung
We might expect a ClassCastException here, but in fact, we get a compilation error: “incompatible types: Frog cannot be converted to Mammal” ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found