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

JoinHandle polled after completion #6402

Closed
lifeRobot opened this issue Mar 14, 2024 · 5 comments
Closed

JoinHandle polled after completion #6402

lifeRobot opened this issue Mar 14, 2024 · 5 comments
Labels
A-tokio Area: The main tokio crate C-bug Category: This is a bug. M-task Module: tokio/task

Comments

@lifeRobot
Copy link

Version
tokio 1.36.0

Platform
Windows Server2012 R2
Windows 11

Description
I don't know which part of the code is problematic, but my program is experiencing panic!

error msg

thread 'tokio-runtime-worker' panicked at C:\Users\admin\.cargo\registry\src\ind
ex.crates.io-6f17d22bba15001f\tokio-1.36.0\src\runtime\task\core.rs:375:22:
JoinHandle polled after completion
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread 'tokio-runtime-worker' panicked at C:\Users\admin\.cargo\registry\src\ind
ex.crates.io-6f17d22bba15001f\tokio-1.36.0\src\runtime\task\state.rs:461:9:
assertion failed: prev.ref_count() >= 1
stack backtrace:
   0:     0x7ff764f82e92 - <unknown>
   1:     0x7ff764f9e2dd - <unknown>
   2:     0x7ff764f7f2a1 - <unknown>
   3:     0x7ff764f82cba - <unknown>
   4:     0x7ff764f84f09 - <unknown>
   5:     0x7ff764f84bc5 - <unknown>
   6:     0x7ff764f85434 - <unknown>
   7:     0x7ff764f852cb - <unknown>
   8:     0x7ff764f83539 - <unknown>
   9:     0x7ff764f84fd2 - <unknown>
  10:     0x7ff7651c61d7 - <unknown>
  11:     0x7ff7651c62b2 - <unknown>
  12:     0x7ff764eeada2 - <unknown>
  13:     0x7ff76477caeb - <unknown>
  14:     0x7ff7647812cd - <unknown>
  15:     0x7ff76494d27b - <unknown>
  16:     0x7ff764f0fb77 - <unknown>
  17:     0x7ff764eea03c - <unknown>
  18:     0x7ff764ed25ce - <unknown>
  19:     0x7ff764e833a1 - <unknown>
  20:     0x7fffe9bf1030 - <unknown>
  21:     0x7fffe9bf4a52 - is_exception_typeof
  22:     0x7fffe9bfe7f4 - _C_specific_handler
  23:     0x7fffe9bf3cc8 - is_exception_typeof
  24:     0x7fffe9bff131 - _CxxFrameHandler3
  25:     0x7ffff7b52fbd - _chkstk
  26:     0x7ffff7b150ec - RtlUnwindEx
  27:     0x7fffe9bfecbe - _C_specific_handler
  28:     0x7fffe9bf2955 - is_exception_typeof
  29:     0x7fffe9bf2d81 - is_exception_typeof
  30:     0x7fffe9bf3dc4 - is_exception_typeof
  31:     0x7fffe9bff131 - _CxxFrameHandler3
  32:     0x7ffff7b52f3d - _chkstk
  33:     0x7ffff7b14557 - RtlRaiseException
  34:     0x7ffff7b1377d - RtlRaiseException
  35:     0x7ffff4f4873c - RaiseException
  36:     0x7fffe9bf6220 - CxxThrowException
  37:     0x7ff764f8c5de - <unknown>
  38:     0x7ff764f85799 - <unknown>
  39:     0x7ff764f8549d - <unknown>
  40:     0x7ff764f852cb - <unknown>
  41:     0x7ff764f83539 - <unknown>
  42:     0x7ff764f84fd2 - <unknown>
  43:     0x7ff7651c61d7 - <unknown>
  44:     0x7ff7648ca8b4 - <unknown>
  45:     0x7ff7648c6732 - <unknown>
  46:     0x7ff76477eb54 - <unknown>
  47:     0x7ff76494b06e - <unknown>
  48:     0x7ff764f0fb45 - <unknown>
  49:     0x7ff764e828aa - <unknown>
  50:     0x7ff764e82b89 - <unknown>
  51:     0x7ff764e81c5d - <unknown>
  52:     0x7ff764e81a58 - <unknown>
  53:     0x7ff764e853ff - <unknown>
  54:     0x7ff764e7f2b3 - <unknown>
  55:     0x7ff764e878f6 - <unknown>
  56:     0x7ff764e89b13 - <unknown>
  57:     0x7ff764e871bb - <unknown>
  58:     0x7ff764e7f4eb - <unknown>
  59:     0x7ff764e84f36 - <unknown>
  60:     0x7ff764e857e6 - <unknown>
  61:     0x7ff764e85cd3 - <unknown>
  62:     0x7ff764e8494b - <unknown>
  63:     0x7ff764f0fa96 - <unknown>
  64:     0x7ff764f11e82 - <unknown>
  65:     0x7ff764f020da - <unknown>
  66:     0x7ff764f01eb4 - <unknown>
  67:     0x7ff764f01825 - <unknown>
  68:     0x7ff764f01525 - <unknown>
  69:     0x7ff764f3976b - <unknown>
  70:     0x7ff764f08cb6 - <unknown>
  71:     0x7ff764f27d72 - <unknown>
  72:     0x7ff764f26b0e - <unknown>
  73:     0x7ff764f08c73 - <unknown>
  74:     0x7ff764f013e1 - <unknown>
  75:     0x7ff764ef6382 - <unknown>
  76:     0x7ff764f011ac - <unknown>
  77:     0x7ff764f0109e - <unknown>
  78:     0x7ff764f04feb - <unknown>
  79:     0x7ff764f240db - <unknown>
  80:     0x7ff764f23fc8 - <unknown>
  81:     0x7ff764f263df - <unknown>
  82:     0x7ff764f16ad3 - <unknown>
  83:     0x7ff764f3be96 - <unknown>
  84:     0x7ff764f3ca93 - <unknown>
  85:     0x7ff764f3ba5b - <unknown>
  86:     0x7ff764edbfdb - <unknown>
  87:     0x7ff764f26236 - <unknown>
  88:     0x7ff764f25766 - <unknown>
  89:     0x7ff764f25653 - <unknown>
  90:     0x7ff764f0fd1b - <unknown>
  91:     0x7ff764f0fa96 - <unknown>
  92:     0x7ff764f11f38 - <unknown>
  93:     0x7ff764f12325 - <unknown>
  94:     0x7ff764f13ff6 - <unknown>
  95:     0x7ff764f13d91 - <unknown>
  96:     0x7ff764eccbd9 - <unknown>
  97:     0x7ff764f29861 - <unknown>
  98:     0x7ff764f16a91 - <unknown>
  99:     0x7ff764f3bfa5 - <unknown>
 100:     0x7ff764f3ca93 - <unknown>
 101:     0x7ff764f3b724 - <unknown>
 102:     0x7ff764f29684 - <unknown>
 103:     0x7ff764ecd6de - <unknown>
 104:     0x7ff764f89dbc - <unknown>
 105:     0x7ffff5381412 - BaseThreadInitThunk
 106:     0x7ffff7ad5504 - RtlUserThreadStart

@lifeRobot lifeRobot added A-tokio Area: The main tokio crate C-bug Category: This is a bug. labels Mar 14, 2024
@Darksonn Darksonn added the M-task Module: tokio/task label Mar 14, 2024
@Darksonn
Copy link
Contributor

The panic message "JoinHandle polled after completion" means that you tried to use a JoinHandle after you already got the value from it.

This can happen when used together with tokio::select! in a loop, where the JoinHandle triggers, and then afterwards, the tokio::select! tries to wait on the JoinHandle again.

@Darksonn Darksonn closed this as not planned Won't fix, can't repro, duplicate, stale Mar 22, 2024
@Darksonn
Copy link
Contributor

Closing because the panic message reveals an issue in your code. It's not an issue in Tokio.

@Darksonn
Copy link
Contributor

Actually, this also has the assertion failed: prev.ref_count() >= 1 panic.

@Darksonn Darksonn reopened this Mar 22, 2024
@Darksonn
Copy link
Contributor

Please move discussion to #6424.

@Darksonn Darksonn closed this as not planned Won't fix, can't repro, duplicate, stale Mar 22, 2024
@Noah-Kennedy
Copy link
Contributor

@lifeRobot please hop over to the new issue if you can, we are looking for more information from folks to try and narrow down what it might be.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-tokio Area: The main tokio crate C-bug Category: This is a bug. M-task Module: tokio/task
Projects
None yet
Development

No branches or pull requests

3 participants