GDB hangs when debugging exe compiled with 1.9nightly under Windows

f421466
Opened by Liqueur Librazy at 2022-01-17 16:19:40

When I debugging this , the gdb hanged. Later I found whenever the GDB stepping out a function, it hangs. qq 20160323171401

The mininum code to reproduce the issue is listed below fn b()->i32{ return 0; } fn a(){ b(); } fn main() { a(); }

qq 20160323171942

  1. Did you try the latest gdb? Rust is a powerful language but not that powerful :)

    Ctrl + C or D doesn't work?

    Taylor Trump at 2016-03-23 17:14:17

  2. I tried the latest version of gdb I could find ubder windows (7.9.1) GDB hangs responseless with a high CPU usage.

    Liqueur Librazy at 2016-03-24 02:57:03

  3. I noticed the version but it's not the last. It's a windows gdb bug.

    No problems on Linux, using gdb 7.10:

    Breakpoint 1, test::b () at test.rs:2
    2       { return 0; 
    (gdb) n
    3       } 
    (gdb) n
    test::a () at test.rs:6
    6        } 
    (gdb) n
    test::main () at test.rs:9
    9       }
    (gdb) n
    0x7f5590e0 in sys_common::unwind::try::try_fn::h16350519717893879347 ()
    (gdb) n
    Single stepping until exit from function _ZN10sys_common6unwind3try6try_fn21h16350519717893879347E,
    which has no line number information.
    0x7f559b30 in sys_common::unwind::inner_try::h68379cb749d9bf889Bt ()
    (gdb) n
    Single stepping until exit from function _ZN10sys_common6unwind9inner_try20h68379cb749d9bf889BtE,
    which has no line number information.
    0x7f558e48 in rt::lang_start::h17fda765239b3705kgA ()
    (gdb) n
    Single stepping until exit from function _ZN2rt10lang_start20h17fda765239b3705kgAE,
    which has no line number information.
    0x7f557c04 in main ()
    (gdb) n
    Single stepping until exit from function main,
    which has no line number information.
    __libc_start_main (main=0x7f557bc4 <main>, argc=1, argv=0xbeffef64, init=<optimized out>, 
        fini=0x7f56b999 <__libc_csu_fini>, rtld_fini=0xb6fea4c5 <_dl_fini>, stack_end=0xbeffef64)
        at libc-start.c:321
    321     libc-start.c: No such file or directory.
    [Inferior 1 (process 19920) exited normally]
    

    Taylor Trump at 2016-03-24 11:15:35

  4. I tried GDB(Cygwin 7.10.1-1) 7.10.1, same problem as 7.9.1. Don't know it is whether gdb or rustc to blame

    Liqueur Librazy at 2016-03-24 16:04:57

  5. Gdb should be able to handle broken programs. Does the test binary work as expected on its own?

    Taylor Trump at 2016-03-24 16:11:54

  6. I'm also experiencing this bug with GDB on Windows in Cygwin; it appears to happen when "step"-ing or "next"-ing over a closing brace in a function. The workaround is to use "fin" instead. Is there already an issue open at GDB/Cygwin/whoever should own it? I doubt this is a Rust issue.

    Zachary Neely at 2016-09-07 17:33:28

  7. Is anyone still seeing this behavior on the latest rusts/gdbs?

    Steve Klabnik at 2019-03-16 15:02:00