Giter VIP home page Giter VIP logo

Comments (6)

cs01 avatar cs01 commented on July 3, 2024

Turns out the pipe is broken because gdb segfaults and the process exits (becomes defunct/zombie). The segfault only occurs when debugging a rust program under pygdbmi, not when running directly from gdb's commandline, or debugging any other language.

The dmesg log shows

[ 4467.187888] gdb[13609]: segfault at 0 ip 00000000006489ed sp 00007ffc0a0ce260 error 4 in gdb[400000+617000]

Running again with strace output logged yields this as the last line.

ptrace(PTRACE_GETREGSET, 14037, NT_X86_XSTATE, [{0x7ffe8bb4ee20, 832}]) = 0
--- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0} ---
+++ killed by SIGSEGV +++

See attached file gdb_strace.txt for the full strace log.

Tagging @o11c in case you have any ideas on steps forward.

from gdbgui.

fschutt avatar fschutt commented on July 3, 2024

Interesting. Didn't expect a segfault to be the reason. Will be watching this.

from gdbgui.

cs01 avatar cs01 commented on July 3, 2024

The segfault occurs in -data-list-register-values x regardless of whether it's run as a subprocess or not. The bug was fixed in gdb's [git repository](git clone git://sourceware.org/git/binutils-gdb.git), commit b96645f1a1e608 "Add support for untagged unions in Rust".

The HEAD of gdb's master branch does not have this bug, so the next gdb release (version 8) should have this issue fixed. For now, I will add a warning to gdbgui, and disable the -data-list-register-values x if gdbgui was able to determine rust source files were used to compile the executable.

Bug filed with gdb: https://sourceware.org/bugzilla/show_bug.cgi?id=21450

from gdbgui.

cs01 avatar cs01 commented on July 3, 2024

@sharazam I added logic to prevent gdbgui from fetching register values when using gdb 7.12.x and debugging a Rust executable, which avoids the segfault. gdbgui also displays a warning to users that this is occurring. If you ever get tired of the TUI and want to try gdbgui again, you can upgrade it and it should work for your rust program.

from gdbgui.

o11c avatar o11c commented on July 3, 2024

Can you still fetch the values using -var-create $registername?

from gdbgui.

cs01 avatar cs01 commented on July 3, 2024

Doesn't seem to be valid syntax:

-var-create rax
-var-create: Usage: NAME FRAME EXPRESSION.

however info registers works

info registers
rax 0x7fffffffdfd0
 140737488347088

rbx 0x0
 0

rcx 0x604028
 6307880

from gdbgui.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.