Skip to content

StackOverflowError when trying to select onSend and onReceive on the same channel #1411

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
qwwdfsad opened this issue Aug 5, 2019 · 0 comments
Assignees
Labels

Comments

@qwwdfsad
Copy link
Collaborator

qwwdfsad commented Aug 5, 2019

Steps to reproduce:

@Test
fun foo() = runBlocking {
    val c = Channel<Int>()
    select<Unit> {
        c.onSend(42) {
            println("Sent")
        }
        c.onReceive {
            println("R $it")
        }
    }
}
@qwwdfsad qwwdfsad added the bug label Aug 5, 2019
elizarov added a commit that referenced this issue Aug 7, 2019
* Instead of StackOverflowError we throw IllegalStateException and leave
  the channel in the original state.

Fixes #1411
elizarov added a commit that referenced this issue Aug 7, 2019
* Instead of StackOverflowError we throw IllegalStateException and leave
  the channel in the original state.

Fixes #1411
elizarov added a commit that referenced this issue Aug 7, 2019
* Instead of StackOverflowError we throw IllegalStateException and leave
  the channel in the original state.

Fixes #1411
elizarov added a commit that referenced this issue Aug 7, 2019
* Instead of StackOverflowError we throw IllegalStateException and leave
  the channel in the original state.

Fixes #1411
qwwdfsad pushed a commit that referenced this issue Aug 21, 2019
* Instead of StackOverflowError we throw IllegalStateException and leave
  the channel in the original state.

Fixes #1411
elizarov added a commit that referenced this issue Aug 22, 2019
* onSend/onReceive clauses on the same channel: Instead of
  StackOverflowError we throw IllegalStateException and leave
  the channel in the original state.
* Fix SOE in select with "opposite channels" stress-test. The fix is
  based on the sequential numbering of atomic select operation.
  Deadlock is detected and the operation with the lower sequential
  number is aborted and restarted (with a larger number).

Fixes #504
Fixes #1411
elizarov added a commit that referenced this issue Aug 23, 2019
* onSend/onReceive clauses on the same channel: Instead of
  StackOverflowError we throw IllegalStateException and leave
  the channel in the original state.
* Fix SOE in select with "opposite channels" stress-test. The fix is
  based on the sequential numbering of atomic select operation.
  Deadlock is detected and the operation with the lower sequential
  number is aborted and restarted (with a larger number).

Fixes #504
Fixes #1411
elizarov added a commit that referenced this issue Aug 30, 2019
* onSend/onReceive clauses on the same channel: Instead of
  StackOverflowError we throw IllegalStateException and leave
  the channel in the original state.
* Fix SOE in select with "opposite channels" stress-test. The fix is
  based on the sequential numbering of atomic select operation.
  Deadlock is detected and the operation with the lower sequential
  number is aborted and restarted (with a larger number).

* TODO:NOTE: SelectDeadlockLFStressTest does not pass and is disabled.
  !!! DO NOT MERGE !!!

Fixes #504
Fixes #1411
elizarov added a commit that referenced this issue Sep 6, 2019
* onSend/onReceive clauses on the same channel: Instead of
  StackOverflowError we throw IllegalStateException and leave
  the channel in the original state.
* Fix SOE in select with "opposite channels" stress-test. The fix is
  based on the sequential numbering of atomic select operation.
  Deadlock is detected and the operation with the lower sequential
  number is aborted and restarted (with a larger number).

* TODO:NOTE: SelectDeadlockLFStressTest does not pass and is disabled.
  !!! DO NOT MERGE !!!

Fixes #504
Fixes #1411
elizarov added a commit that referenced this issue Sep 6, 2019
* onSend/onReceive clauses on the same channel: Instead of
  StackOverflowError we throw IllegalStateException and leave
  the channel in the original state.
* Fix SOE in select with "opposite channels" stress-test. The fix is
  based on the sequential numbering of atomic select operation.
  Deadlock is detected and the operation with the lower sequential
  number is aborted and restarted (with a larger number).

* TODO:NOTE: SelectDeadlockLFStressTest does not pass and is disabled.
  !!! DO NOT MERGE !!!

Fixes #504
Fixes #1411
elizarov added a commit that referenced this issue Sep 7, 2019
* onSend/onReceive clauses on the same channel: Instead of
  StackOverflowError we throw IllegalStateException and leave
  the channel in the original state.
* Fix SOE in select with "opposite channels" stress-test. The fix is
  based on the sequential numbering of atomic select operation.
  Deadlock is detected and the operation with the lower sequential
  number is aborted and restarted (with a larger number).

* TODO:NOTE: SelectDeadlockLFStressTest does not pass and is disabled.
  !!! DO NOT MERGE !!!

Fixes #504
Fixes #1411
elizarov added a commit that referenced this issue Sep 7, 2019
* onSend/onReceive clauses on the same channel: Instead of
  StackOverflowError we throw IllegalStateException and leave
  the channel in the original state.
* Fix SOE in select with "opposite channels" stress-test. The fix is
  based on the sequential numbering of atomic select operation.
  Deadlock is detected and the operation with the lower sequential
  number is aborted and restarted (with a larger number).

Fixes #504
Fixes #1411
elizarov added a commit that referenced this issue Sep 10, 2019
* onSend/onReceive clauses on the same channel: Instead of
  StackOverflowError we throw IllegalStateException and leave
  the channel in the original state.
* Fix SOE in select with "opposite channels" stress-test. The fix is
  based on the sequential numbering of atomic select operation.
  Deadlock is detected and the operation with the lower sequential
  number is aborted and restarted (with a larger number).

Fixes #504
Fixes #1411
elizarov added a commit that referenced this issue Sep 10, 2019
* onSend/onReceive clauses on the same channel: Instead of
  StackOverflowError we throw IllegalStateException and leave
  the channel in the original state.
* Fix SOE in select with "opposite channels" stress-test. The fix is
  based on the sequential numbering of atomic select operation.
  Deadlock is detected and the operation with the lower sequential
  number is aborted and restarted (with a larger number).

Fixes #504
Fixes #1411
elizarov added a commit that referenced this issue Sep 19, 2019
* onSend/onReceive clauses on the same channel: Instead of
  StackOverflowError we throw IllegalStateException and leave
  the channel in the original state.
* Fix SOE in select with "opposite channels" stress-test. The fix is
  based on the sequential numbering of atomic select operation.
  Deadlock is detected and the operation with the lower sequential
  number is aborted and restarted (with a larger number).

Fixes #504
Fixes #1411
elizarov added a commit that referenced this issue Sep 21, 2019
* onSend/onReceive clauses on the same channel: Instead of
  StackOverflowError we throw IllegalStateException and leave
  the channel in the original state.
* Fix SOE in select with "opposite channels" stress-test. The fix is
  based on the sequential numbering of atomic select operation.
  Deadlock is detected and the operation with the lower sequential
  number is aborted and restarted (with a larger number).

Fixes #504
Fixes #1411
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

2 participants