Skip to content

gdb crashes when printing a vector before it is defined #32954

Closed
@dlrobertson

Description

@dlrobertson

When debugging something like the following with rust-gdb

fn main() {
    let x: Vec<i32> = Vec::new();
}

And doing something silly like the following

$ rust-gdb ./test
(gdb) br main
(gdb) frame
#0   test::main () at test.rs:2
2            let mut x: Vec<i32> = Vec::new();
(gdb) print x # printing x before it is defined

gdb freezes and will eventually be killed (on another of my machines a Python Exception is raised). This didn't occur with primitives (integer, slice, &str), but Python Exceptions were raised with Option, String, etc., but Vec was the only one that caused gdb to crash. Probably not too important since checking the values of items before they are defined is not useful.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-debuginfoArea: Debugging information in compiled programs (DWARF, PDB, etc.)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions