-
Notifications
You must be signed in to change notification settings - Fork 273
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
timely::CommunicationConfig::Cluster
: Syscall param socketcall.sendto(msg) points to uninitialised byte(s)
#399
Comments
I'm sorry, I don't know enough about valgrind to know if there is a problem. The writer that is being flushed is pre-allocated with spare capacity, which means that a fair hunk of its buffer will be uninitialized let mut writer = ::std::io::BufWriter::with_capacity(1 << 16, writer); Subsequently, we only write in byte slices, writer.write_all(&bytes[..]).expect("Write failure in send_loop."); though admittedly they get populated in weird (unsafe) ways. So, it's possible that there is uninitialized memory on the other end of the pointer passed in, in the allocated region, because |
Thanks for your reply. I'm no valgrind expert either, and tend to just adding print statements once it reports something. I'm not sure whether I understand the first possibility you mentioned. But I believe it is the second one anyway, after I added some of those prints to let thread_name = std::thread::current().name().unwrap().to_string();
for idx in 0..bytes.len() {
println!("{} attempt to write byte #{}...", thread_name, idx);
std::io::stdout().flush().expect("flush error");
println!("{} write byte #{}: {:?}", thread_name, idx, bytes[idx]); // line 200
std::io::stdout().flush().expect("flush error");
}
writer.write_all(&bytes[..]).expect("Write failure in send_loop."); Now this produces outputs like
meaning that byte 108 of (the line numbers in the stacktrace may differ from yours as my editor did some reformatting) Full console output: https://pastebin.com/hTtzwgDJ |
I meanwhile found out that using timely = { version = "0.12.0", features=["bincode"] } in |
I'd recommend using that if it works for you. It uses a more "safe" serialization mechanism. @antiguru took a brief peek (I don't want to speak for him) and saw the uninit bytes in padding, but we haven't gotten to reproducing the error. You mention having a crash; is that something you can share? |
Hello,
I am experimenting with timely dataflow, and adapted one of the examples from the docs to use a
timely::CommunicationConfig::Cluster
.main.rs
:Cargo.toml
:When I execute it with valgrind,
I see errors like this:
Uninitialized bytes sounds bad to me, and even if this example does not crash, I believe this to be the cause for a segfault I see in a more complex application using timely::Cluster.
(I have checked it with rust 1.53 stable and rust 1.55 nightly)
Am I doing something wrong, or is this a bug?
Thanks.
edit: added braces to valgrind calls
The text was updated successfully, but these errors were encountered: