Skip to content

Thread can outilve the main state #68

@therustmonk

Description

@therustmonk

This code takes segfault:

extern crate lua;
use lua::*;
fn main() {
    let mut thread = {
        let mut state = State::new();
        state.new_thread()
    };
    thread.do_string(r#"print("Hello, segfault!")"#);
}

Output:

$ cargo run
    Finished debug [unoptimized + debuginfo] target(s) in 0.0 secs
     Running `target\debug\lua-fail.exe`
error: Process didn't exit successfully: `target\debug\lua-fail.exe` (exit code: 3221225477)
Segmentation fault

This was found with #65.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions