Comments (6)
I think an improvement would be to use Dart SDK for the tests. It's a matter of fetching the stable flutter SDK and adding it to the path. I'll look into a PR for this next week.
from allo-isolate.
Not sure, maybe we should create a minimal reproducible sample, probably without allo-isolate and with only a few lines of Rust code, first?
from allo-isolate.
@shekohex I'm busy with something else right now. I'll get back to it at some point in the near future.
from allo-isolate.
RUSTFLAGS="-Z sanitizer=thread" cargo test --target x86_64-unknown-linux-gnu
Generates
running 1 test
==================
WARNING: ThreadSanitizer: data race (pid=656544)
Read of size 8 at 0x7b440000ff48 by main thread:
#0 memcpy /rustc/llvm/src/llvm-project/compiler-rt/lib/tsan/rtl/../../sanitizer_common/sanitizer_common_interceptors.inc:899:5 (containers-95dfae78259d34e8+0x2bbce) (BuildId: 6990138284dae2b99720eab3ad5e608927e4a2e1)
#1 core::mem::maybe_uninit::MaybeUninit$LT$T$GT$::assume_init::h7baa46083098b9c1 /rustc/8796e7a9cfd4c5c4f1de15ec1c53994ddf288665/library/core/src/mem/mod.rs:918:22 (containers-95dfae78259d34e8+0xfb814) (BuildId: 6990138284dae2b99720eab3ad5e608927e4a2e1)
#2 core::ptr::read::ha43e8013e7942876 /rustc/8796e7a9cfd4c5c4f1de15ec1c53994ddf288665/library/core/src/ptr/mod.rs:1119:9 (containers-95dfae78259d34e8+0xfb814)
#3 core::mem::replace::h262549728b00dc7e /rustc/8796e7a9cfd4c5c4f1de15ec1c53994ddf288665/library/core/src/mem/mod.rs:918:22 (containers-95dfae78259d34e8+0xfb814)
#4 core::option::Option$LT$T$GT$::take::hac5d89d859cc5556 /rustc/8796e7a9cfd4c5c4f1de15ec1c53994ddf288665/library/std/src/sync/mpsc/mpsc_queue.rs:96:27 (containers-95dfae78259d34e8+0xfb814)
#5 std::sync::mpsc::mpsc_queue::Queue$LT$T$GT$::pop::hc87cfb6facd10966 /rustc/8796e7a9cfd4c5c4f1de15ec1c53994ddf288665/library/std/src/sync/mpsc/mpsc_queue.rs:96:27 (containers-95dfae78259d34e8+0xfb814)
#6 core::ops::function::FnOnce::call_once::h0850fbae2694fbcc /rustc/8796e7a9cfd4c5c4f1de15ec1c53994ddf288665/library/core/src/ops/function.rs:251:5 (containers-95dfae78259d34e8+0xf0a8e) (BuildId: 6990138284dae2b99720eab3ad5e608927e4a2e1)
#7 std::sys_common::backtrace::__rust_begin_short_backtrace::h79c71d051db4cf07 /rustc/8796e7a9cfd4c5c4f1de15ec1c53994ddf288665/library/std/src/sys_common/backtrace.rs:122:18 (containers-95dfae78259d34e8+0xf46d1) (BuildId: 6990138284dae2b99720eab3ad5e608927e4a2e1)
#8 std::rt::lang_start::_$u7b$$u7b$closure$u7d$$u7d$::h1311a497100d83e7 /rustc/8796e7a9cfd4c5c4f1de15ec1c53994ddf288665/library/std/src/rt.rs:166:18 (containers-95dfae78259d34e8+0xe85be) (BuildId: 6990138284dae2b99720eab3ad5e608927e4a2e1)
#9 core::ops::function::impls::_$LT$impl$u20$core..ops..function..FnOnce$LT$A$GT$$u20$for$u20$$RF$F$GT$::call_once::hcf0f452e35b42714 /rustc/8796e7a9cfd4c5c4f1de15ec1c53994ddf288665/library/core/src/ops/function.rs:286:13 (containers-95dfae78259d34e8+0x15dc0a) (BuildId: 6990138284dae2b99720eab3ad5e608927e4a2e1)
#10 std::panicking::try::do_call::h9076463b86fc98c2 /rustc/8796e7a9cfd4c5c4f1de15ec1c53994ddf288665/library/std/src/panicking.rs:464:40 (containers-95dfae78259d34e8+0x15dc0a)
#11 std::panicking::try::h59a38c38fab81132 /rustc/8796e7a9cfd4c5c4f1de15ec1c53994ddf288665/library/std/src/panicking.rs:428:19 (containers-95dfae78259d34e8+0x15dc0a)
#12 std::panic::catch_unwind::h024c7f29e5fae637 /rustc/8796e7a9cfd4c5c4f1de15ec1c53994ddf288665/library/std/src/panic.rs:137:14 (containers-95dfae78259d34e8+0x15dc0a)
#13 std::rt::lang_start_internal::_$u7b$$u7b$closure$u7d$$u7d$::h1bc9c4aefbf9b583 /rustc/8796e7a9cfd4c5c4f1de15ec1c53994ddf288665/library/std/src/rt.rs:148:48 (containers-95dfae78259d34e8+0x15dc0a)
#14 std::panicking::try::do_call::hf630db2c23823f3c /rustc/8796e7a9cfd4c5c4f1de15ec1c53994ddf288665/library/std/src/panicking.rs:464:40 (containers-95dfae78259d34e8+0x15dc0a)
#15 std::panicking::try::h5c6c892f05382366 /rustc/8796e7a9cfd4c5c4f1de15ec1c53994ddf288665/library/std/src/panicking.rs:428:19 (containers-95dfae78259d34e8+0x15dc0a)
#16 std::panic::catch_unwind::h893ebad4c00d9e60 /rustc/8796e7a9cfd4c5c4f1de15ec1c53994ddf288665/library/std/src/panic.rs:137:14 (containers-95dfae78259d34e8+0x15dc0a)
#17 std::rt::lang_start_internal::h2fa3ed5bcd048bb3 /rustc/8796e7a9cfd4c5c4f1de15ec1c53994ddf288665/library/std/src/rt.rs:148:20 (containers-95dfae78259d34e8+0x15dc0a)
#18 main <null> (containers-95dfae78259d34e8+0xadc2c) (BuildId: 6990138284dae2b99720eab3ad5e608927e4a2e1)
Previous write of size 8 at 0x7b440000ff48 by thread T1:
#0 memcpy /rustc/llvm/src/llvm-project/compiler-rt/lib/tsan/rtl/../../sanitizer_common/sanitizer_common_interceptors.inc:899:5 (containers-95dfae78259d34e8+0x2bbce) (BuildId: 6990138284dae2b99720eab3ad5e608927e4a2e1)
#1 std::sync::mpsc::mpsc_queue::Node$LT$T$GT$::new::h794c6c797f182eb0 /rustc/8796e7a9cfd4c5c4f1de15ec1c53994ddf288665/library/std/src/sync/mpsc/mpsc_queue.rs:56:80 (containers-95dfae78259d34e8+0xfbdaa) (BuildId: 6990138284dae2b99720eab3ad5e608927e4a2e1)
#2 std::sync::mpsc::mpsc_queue::Queue$LT$T$GT$::push::h9b783077498e467d /rustc/8796e7a9cfd4c5c4f1de15ec1c53994ddf288665/library/std/src/sync/mpsc/mpsc_queue.rs:71:21 (containers-95dfae78259d34e8+0xfbdaa)
#3 std::sync::mpsc::shared::Packet$LT$T$GT$::send::h83d999d53debc6e7 /rustc/8796e7a9cfd4c5c4f1de15ec1c53994ddf288665/library/std/src/sync/mpsc/shared.rs:167:9 (containers-95dfae78259d34e8+0xfbdaa)
#4 std::sync::mpsc::Sender$LT$T$GT$::send::h908fe1b76313dabc /rustc/8796e7a9cfd4c5c4f1de15ec1c53994ddf288665/library/std/src/sync/mpsc/mod.rs:830:45 (containers-95dfae78259d34e8+0xfbdaa)
Location is heap block of size 264 at 0x7b440000ff00 allocated by thread T1:
#0 malloc /rustc/llvm/src/llvm-project/compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp:667:5 (containers-95dfae78259d34e8+0x206b1) (BuildId: 6990138284dae2b99720eab3ad5e608927e4a2e1)
#1 alloc::alloc::alloc::h078c1608a61bbb7e /rustc/8796e7a9cfd4c5c4f1de15ec1c53994ddf288665/library/alloc/src/alloc.rs:177:73 (containers-95dfae78259d34e8+0xfbd5c) (BuildId: 6990138284dae2b99720eab3ad5e608927e4a2e1)
#2 alloc::alloc::Global::alloc_impl::h2da59902eb29a0d4 /rustc/8796e7a9cfd4c5c4f1de15ec1c53994ddf288665/library/alloc/src/alloc.rs:177:73 (containers-95dfae78259d34e8+0xfbd5c)
#3 _$LT$alloc..alloc..Global$u20$as$u20$core..alloc..Allocator$GT$::allocate::h8982b6cfb9978320 /rustc/8796e7a9cfd4c5c4f1de15ec1c53994ddf288665/library/alloc/src/alloc.rs:326:11 (containers-95dfae78259d34e8+0xfbd5c)
#4 alloc::alloc::exchange_malloc::h422ed970359c9d8a /rustc/8796e7a9cfd4c5c4f1de15ec1c53994ddf288665/library/alloc/src/alloc.rs:326:11 (containers-95dfae78259d34e8+0xfbd5c)
#5 std::sync::mpsc::mpsc_queue::Node$LT$T$GT$::new::h794c6c797f182eb0 /rustc/8796e7a9cfd4c5c4f1de15ec1c53994ddf288665/library/std/src/sync/mpsc/mpsc_queue.rs:56:23 (containers-95dfae78259d34e8+0xfbd5c)
#6 std::sync::mpsc::mpsc_queue::Queue$LT$T$GT$::push::h9b783077498e467d /rustc/8796e7a9cfd4c5c4f1de15ec1c53994ddf288665/library/std/src/sync/mpsc/mpsc_queue.rs:71:21 (containers-95dfae78259d34e8+0xfbd5c)
#7 std::sync::mpsc::shared::Packet$LT$T$GT$::send::h83d999d53debc6e7 /rustc/8796e7a9cfd4c5c4f1de15ec1c53994ddf288665/library/std/src/sync/mpsc/shared.rs:167:9 (containers-95dfae78259d34e8+0xfbd5c)
#8 std::sync::mpsc::Sender$LT$T$GT$::send::h908fe1b76313dabc /rustc/8796e7a9cfd4c5c4f1de15ec1c53994ddf288665/library/std/src/sync/mpsc/mod.rs:830:45 (containers-95dfae78259d34e8+0xfbd5c)
Thread T1 'tests::can_run_valgrind_main' (tid=656547, finished) created by main thread at:
#0 pthread_create /rustc/llvm/src/llvm-project/compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp:1022:3 (containers-95dfae78259d34e8+0x21a7d) (BuildId: 6990138284dae2b99720eab3ad5e608927e4a2e1)
#1 std::sys::unix::thread::Thread::new::h045c7dac122bb76d /rustc/8796e7a9cfd4c5c4f1de15ec1c53994ddf288665/library/std/src/sys/unix/thread.rs:87:19 (containers-95dfae78259d34e8+0x16d920) (BuildId: 6990138284dae2b99720eab3ad5e608927e4a2e1)
#2 core::ops::function::FnOnce::call_once::h0850fbae2694fbcc /rustc/8796e7a9cfd4c5c4f1de15ec1c53994ddf288665/library/core/src/ops/function.rs:251:5 (containers-95dfae78259d34e8+0xf0a8e) (BuildId: 6990138284dae2b99720eab3ad5e608927e4a2e1)
#3 std::sys_common::backtrace::__rust_begin_short_backtrace::h79c71d051db4cf07 /rustc/8796e7a9cfd4c5c4f1de15ec1c53994ddf288665/library/std/src/sys_common/backtrace.rs:122:18 (containers-95dfae78259d34e8+0xf46d1) (BuildId: 6990138284dae2b99720eab3ad5e608927e4a2e1)
#4 std::rt::lang_start::_$u7b$$u7b$closure$u7d$$u7d$::h1311a497100d83e7 /rustc/8796e7a9cfd4c5c4f1de15ec1c53994ddf288665/library/std/src/rt.rs:166:18 (containers-95dfae78259d34e8+0xe85be) (BuildId: 6990138284dae2b99720eab3ad5e608927e4a2e1)
#5 core::ops::function::impls::_$LT$impl$u20$core..ops..function..FnOnce$LT$A$GT$$u20$for$u20$$RF$F$GT$::call_once::hcf0f452e35b42714 /rustc/8796e7a9cfd4c5c4f1de15ec1c53994ddf288665/library/core/src/ops/function.rs:286:13 (containers-95dfae78259d34e8+0x15dc0a) (BuildId: 6990138284dae2b99720eab3ad5e608927e4a2e1)
#6 std::panicking::try::do_call::h9076463b86fc98c2 /rustc/8796e7a9cfd4c5c4f1de15ec1c53994ddf288665/library/std/src/panicking.rs:464:40 (containers-95dfae78259d34e8+0x15dc0a)
#7 std::panicking::try::h59a38c38fab81132 /rustc/8796e7a9cfd4c5c4f1de15ec1c53994ddf288665/library/std/src/panicking.rs:428:19 (containers-95dfae78259d34e8+0x15dc0a)
#8 std::panic::catch_unwind::h024c7f29e5fae637 /rustc/8796e7a9cfd4c5c4f1de15ec1c53994ddf288665/library/std/src/panic.rs:137:14 (containers-95dfae78259d34e8+0x15dc0a)
#9 std::rt::lang_start_internal::_$u7b$$u7b$closure$u7d$$u7d$::h1bc9c4aefbf9b583 /rustc/8796e7a9cfd4c5c4f1de15ec1c53994ddf288665/library/std/src/rt.rs:148:48 (containers-95dfae78259d34e8+0x15dc0a)
#10 std::panicking::try::do_call::hf630db2c23823f3c /rustc/8796e7a9cfd4c5c4f1de15ec1c53994ddf288665/library/std/src/panicking.rs:464:40 (containers-95dfae78259d34e8+0x15dc0a)
#11 std::panicking::try::h5c6c892f05382366 /rustc/8796e7a9cfd4c5c4f1de15ec1c53994ddf288665/library/std/src/panicking.rs:428:19 (containers-95dfae78259d34e8+0x15dc0a)
#12 std::panic::catch_unwind::h893ebad4c00d9e60 /rustc/8796e7a9cfd4c5c4f1de15ec1c53994ddf288665/library/std/src/panic.rs:137:14 (containers-95dfae78259d34e8+0x15dc0a)
#13 std::rt::lang_start_internal::h2fa3ed5bcd048bb3 /rustc/8796e7a9cfd4c5c4f1de15ec1c53994ddf288665/library/std/src/rt.rs:148:20 (containers-95dfae78259d34e8+0x15dc0a)
#14 main <null> (containers-95dfae78259d34e8+0xadc2c) (BuildId: 6990138284dae2b99720eab3ad5e608927e4a2e1)
SUMMARY: ThreadSanitizer: data race /rustc/8796e7a9cfd4c5c4f1de15ec1c53994ddf288665/library/core/src/mem/mod.rs:918:22 in core::mem::maybe_uninit::MaybeUninit$LT$T$GT$::assume_init::h7baa46083098b9c1
==================
test tests::can_run_valgrind_main ... ok
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.07s
ThreadSanitizer: reported 1 warnings
from allo-isolate.
Any idea @fzyzcjy about sanitizers here? also @jwinarske please note that our test dart VM is not actual VM we just mimic the behaviour of the actual VM. Nonetheless, looks like most of these errors are from running that test here https://github.com/sunshine-protocol/allo-isolate/blob/master/tests/containers.rs#L243-L245 and not sure where we spawn new threads or using channels?
from allo-isolate.
Hello @jwinarske, did you find any new updates on that?
from allo-isolate.
Related Issues (19)
- Custom types from library result in: `Cell<bool>` cannot be shared between threads safely HOT 2
- Directly find out Dart_PostCObject function pointer, instead of manually letting Dart to call Rust's store_dart_post_cobject? HOT 2
- Publish a new version? HOT 4
- Support `Float32List`? (Can make a PR) HOT 5
- Streaming data HOT 3
- Passing structs through an isolate.post() HOT 2
- Support Vec<Box<XXX>>
- Implicit zero copy on `Vec<u8>` HOT 9
- The official website, Sunshine.foundation, says that domain is being sold... HOT 3
- when zero-copy is enabled, shall we mark `ZeroCopyBuffer` as deprecated, and provide a NonZeroCopyBuffer HOT 6
- Is memory copy involved when sending `Uint8List` from Dart to Rust? HOT 2
- bug: DartCObject does not handle cases except Int8/Uint8, making memory leak HOT 2
- Is there any way to run a Rust function on Dart VM shutdown? HOT 2
- bug: Cannot use allo-isolate in two libraries with static linking because of symbol name duplication HOT 4
- Program seems to panic when dropping vectors HOT 1
- bug: Memory leak using Dart_PostCObject because need to consider the return value is true or false HOT 4
- bug: critical DOUBLE-FREE problem for all calls to post() HOT 4
- How is the library tested? (I cannot run it via Valgrind + real Dart) HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from allo-isolate.