Skip to content

Tests for kotlinx-coroutines-debug module fail on OpenJDK 17 due to changed internals #3700

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

Closed
FenstonSingel opened this issue Apr 5, 2023 · 1 comment
Labels

Comments

@FenstonSingel
Copy link
Contributor

When running on OpenJDK 17 (and down to OpenJDK 14 according to my checks of corresponding sources), RunningThreadStackMergeTest fails on testStackMergeWithContext, testStackMergeEscapeSuspendMethod, and testMergeThroughInvokeSuspend. The reason is a change in OpenJDK's java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject. This change results in a stack dump that differs from expected one by three new frames:

Coroutine "coroutine#X":StandaloneCoroutine{Active}@ADDR, state: RUNNING at
[email protected]/jdk.internal.misc.Unsafe.park(Native Method)
at [email protected]/java.util.concurrent.locks.LockSupport.park(LockSupport.java:341)
+NEW+ at [email protected]/java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionNode.block(AbstractQueuedSynchronizer.java:506)
+NEW+ at [email protected]/java.util.concurrent.ForkJoinPool.unmanagedBlock(ForkJoinPool.java:3463)
+NEW+ at [email protected]/java.util.concurrent.ForkJoinPool.managedBlock(ForkJoinPool.java:3434)
at [email protected]/java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1623)
at [email protected]/java.util.concurrent.CyclicBarrier.dowait(CyclicBarrier.java:236)
at [email protected]/java.util.concurrent.CyclicBarrier.await(CyclicBarrier.java:364)

(nb: line numbers most probably also differ, but that's not really that relevant)

@FenstonSingel FenstonSingel changed the title Tests for kotlinx-coroutines-debug module fail on OpenJDK 17 due to change internals Tests for kotlinx-coroutines-debug module fail on OpenJDK 17 due to changed internals Apr 5, 2023
@FenstonSingel
Copy link
Contributor Author

At the moment this issue only becomes visible after eliminating #3701 first.

qwwdfsad added a commit that referenced this issue Apr 25, 2023
We do rely on java.util.concurrent primitives for rendezvous in tests,
but we cannot rely on their internal stacktraces in tests, thus filtering them out from test data.

Otherwise, tests outcome depends on the underlying JDK version

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

No branches or pull requests

1 participant