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

Crossbeam channels trigger valgrind errors #23077

Open
jdm opened this issue Mar 21, 2019 · 3 comments
Open

Crossbeam channels trigger valgrind errors #23077

jdm opened this issue Mar 21, 2019 · 3 comments
Labels
I-safety Some piece of code violates memory safety guarantees.

Comments

@jdm
Copy link
Member

jdm commented Mar 21, 2019

Two examples from https://paste.sh/LwlXNbkD#GFVUcztjTpQbNpZoVKg4SDmI:

==130127== Thread 43 WRRenderBackend#:
==130127== Conditional jump or move depends on uninitialised value(s)
==130127==    at 0x95D09AA: crossbeam_epoch::internal::Global::collect (internal.rs:189)
==130127==    by 0x957E156: crossbeam_epoch::internal::Local::pin (internal.rs:379)
==130127==    by 0x9551625: crossbeam_epoch::collector::LocalHandle::pin (collector.rs:72)
==130127==    by 0x95550E7: crossbeam_epoch::default::pin::{{closure}} (default.rs:23)
==130127==    by 0x9555097: crossbeam_epoch::default::with_handle::{{closure}} (default.rs:42)
==130127==    by 0x955668D: <std::thread::local::LocalKey<T>>::try_with (local.rs:300)
==130127==    by 0x9554F72: crossbeam_epoch::default::with_handle (default.rs:42)
==130127==    by 0x63530B9: crossbeam_epoch::default::pin (default.rs:23)
==130127==    by 0x634717E: <crossbeam_channel::flavors::list::Channel<T>>::start_send (list.rs:161)
==130127==    by 0x6347DB8: <crossbeam_channel::flavors::list::Channel<T>>::send (list.rs:381)
==130127==    by 0x634E381: <crossbeam_channel::channel::Sender<T>>::send (channel.rs:416)
==130127==    by 0x634F347: compositing::compositor_thread::CompositorProxy::send (compositor_thread.rs:31)
==130127== 
==130127== Conditional jump or move depends on uninitialised value(s)
==130127==    at 0x95D4A2F: core::ptr::real_drop_in_place (ptr.rs:193)
==130127==    by 0x95D09D0: crossbeam_epoch::internal::Global::collect (internal.rs:192)
==130127==    by 0x957E156: crossbeam_epoch::internal::Local::pin (internal.rs:379)
==130127==    by 0x9551625: crossbeam_epoch::collector::LocalHandle::pin (collector.rs:72)
==130127==    by 0x95550E7: crossbeam_epoch::default::pin::{{closure}} (default.rs:23)
==130127==    by 0x9555097: crossbeam_epoch::default::with_handle::{{closure}} (default.rs:42)
==130127==    by 0x955668D: <std::thread::local::LocalKey<T>>::try_with (local.rs:300)
==130127==    by 0x9554F72: crossbeam_epoch::default::with_handle (default.rs:42)
==130127==    by 0x63530B9: crossbeam_epoch::default::pin (default.rs:23)
==130127==    by 0x634717E: <crossbeam_channel::flavors::list::Channel<T>>::start_send (list.rs:161)
==130127==    by 0x6347DB8: <crossbeam_channel::flavors::list::Channel<T>>::send (list.rs:381)
==130127==    by 0x634E381: <crossbeam_channel::channel::Sender<T>>::send (channel.rs:416)

@stjepang Have you noticed this happening before?

@jdm jdm added the I-safety Some piece of code violates memory safety guarantees. label Mar 21, 2019
@ghost
Copy link

ghost commented Mar 22, 2019

I haven't noticed this before, thanks for reporting! I'll open an issue in the crossbeam repo and dig into the problem.

To be more precise, looks like the problem is actually in crossbeam-epoch rather than crossbeam-channel. Note that if you update the crossbeam-channel dependency to the latest version, the problem will go away for you since the latest version doesn't use crossbeam-epoch anymore.

@atouchet
Copy link
Contributor

crossbeam-channel was updated in #23288 which removed the crossbeam-epoch 0.6 dependency. Is this fixed now?

@jonhoo
Copy link

jonhoo commented Feb 17, 2020

Alternatively, some unsoundness was also fixed in crossbeam-rs/crossbeam#458, which is about to land on crates.io (in crossbeam-rs/crossbeam#474). Hopefully that should fix this, and if so, we can close crossbeam-rs/crossbeam#347 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I-safety Some piece of code violates memory safety guarantees.
Projects
None yet
Development

No branches or pull requests

3 participants