sunjay / turtle

Create Animated Drawings in Rust
http://turtle.rs
Mozilla Public License 2.0
559 stars 54 forks source link

Bug: turtle crashes when using std::env, only fixed on current git. #210

Closed CoffeeImpliesCode closed 3 years ago

CoffeeImpliesCode commented 3 years ago

When compiling a program using turtle as well as std::env, an unnamed thread panics because of failed IPC on Manjaro Linux (kernel version 5.8.11-1). Minimal example:

use turtle::Turtle;
use std::env;

fn main() {
    for a in env::args() {
        println!("{}", a);
    }
    let mut turtle = Turtle::new();
}

I reproduced this with the crates.io version as well as the website-linked git version, only the current git version runs correctly. Here the panic:

    Finished dev [unoptimized + debuginfo] target(s) in 3.07s
     Running `target/debug/hilbert`
target/debug/hilbert
thread '<unnamed>' panicked at 'bug: failed to read response from renderer process', /home/fl0wless/.cargo/git/checkouts/turtle-7d4ec58877c500b9/bf64b83/src/messenger.rs:41:69
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

The same bug with direct invocation and as release build. I don't know if this happens on other platforms, it would be great if those repos were updated.

sunjay commented 3 years ago

Thanks for reporting this! This is actually expected behavior. Please see the start function in the docs for a way to resolve the issue: https://docs.rs/turtle/1.0.0-rc.3/turtle/fn.start.html

Let me know if you have any other questions :)

CoffeeImpliesCode commented 3 years ago

Thanks, just wanted you to know if this behaviour was unknown.

sunjay commented 3 years ago

I appreciate the report. Hope that got it resolved. :)