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

Simple VideoStreamPlayback causes thread panic #709

Closed
Tracked by #713
funatsufumiya opened this issue May 12, 2024 · 4 comments · Fixed by #736
Closed
Tracked by #713

Simple VideoStreamPlayback causes thread panic #709

funatsufumiya opened this issue May 12, 2024 · 4 comments · Fixed by #736
Labels
bug c: ffi Low-level components and interaction with GDExtension API

Comments

@funatsufumiya
Copy link

funatsufumiya commented May 12, 2024

I just created VideoStreamPlayback as just simple as possible (with dummy data), causes thread error.
https://github.com/funatsufumiya/godot_test_video_stream

First error shows use the "experimental-threads" feature, but when enabled it, still panic occurs when some audio IOThread interrupted.

thread '<unnamed>' panicked at /xxx/.cargo/git/checkouts/gdext-76630c89719e160c/8163134/godot-ffi/src/binding/single_threaded.rs:100:13:
assertion `left == right` failed: attempted to access binding from different thread than main thread; this is UB - use the "experimental-threads" feature.
  left: ThreadId(1)
 right: ThreadId(2)
thread '<unnamed>' panicked at /xxx/.cargo/git/checkouts/gdext-76630c89719e160c/8163134/godot-core/src/storage/multi_threaded.rs:59:13:
Gd<T>::bind() failed, already bound; T = godot_test_video_stream::TestVideoStreamPlayback.
  Make sure to use `self.base_mut()` or `self.base()` instead of `self.to_gd()` when possible.
  Details: cannot borrow while accessible mutable borrow exists.
@Bromeon
Copy link
Member

Bromeon commented May 13, 2024

First error shows use the "experimental-threads" feature, but when enabled it, still panic occurs when some audio IOThread interrupted.

Can you elaborate on this error? I assume the panic is different?

@Bromeon Bromeon added bug c: ffi Low-level components and interaction with GDExtension API labels May 13, 2024
@funatsufumiya
Copy link
Author

funatsufumiya commented May 13, 2024

@Bromeon
Probably the reason of the panic is the same. But I don't know what is happening behind, maybe some audio event about video processing, while this example doesn't treat any audios or real video decoding (just template).

@funatsufumiya
Copy link
Author

Thank you very much for fixing this bug. I confirmed it and updated my example's Cargo.lock: https://github.com/funatsufumiya/godot_test_video_stream

@Bromeon
Copy link
Member

Bromeon commented Jun 11, 2024

Thanks for testing, glad to hear it works!
The credits really go to @TitanNano who has done an amazing job with the script instance APIs! 💪

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug c: ffi Low-level components and interaction with GDExtension API
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants