Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

runtime: gdb fails to wait for new child #60553

Closed
prattmic opened this issue Jun 1, 2023 · 3 comments
Closed

runtime: gdb fails to wait for new child #60553

prattmic opened this issue Jun 1, 2023 · 3 comments
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@prattmic
Copy link
Member

prattmic commented Jun 1, 2023

#!watchflakes
post <- pkg == "runtime" && test == "TestGdbBacktrace" && (`waiting for new child: No child processes`)

https://build.golang.org/log/c0a5543211386b919f5b5311ccadc8afa54cd79e

--- FAIL: TestGdbBacktrace (2323.65s)
    runtime-gdb_test.go:83: gdb version 10.1
    runtime-gdb_test.go:468: GDB command timed out after 38m43.017693938s: /usr/bin/gdb -nx -batch -iex add-auto-load-safe-path /workdir/go/src/runtime -ex set startup-with-shell off -ex break main.eee -ex run -ex backtrace -ex continue /workdir/tmp/TestGdbBacktrace2238907183/001/a.exe
    runtime-gdb_test.go:473: gdb output:
        Loading Go Runtime support.
        Breakpoint 1 at 0x80a2830: file /workdir/tmp/TestGdbBacktrace2238907183/001/main.go, line 17.
        [New LWP 532860]
        [New LWP 532862]
        [New LWP 532864]
        [New LWP 532865]

        Thread 1 "a.exe" hit Breakpoint 1, main.eee (~r0=<optimized out>) at /workdir/tmp/TestGdbBacktrace2238907183/001/main.go:17
        17	func eee() bool { return true }
        #0  main.eee (~r0=<optimized out>) at /workdir/tmp/TestGdbBacktrace2238907183/001/main.go:17
        #1  0x080a280f in main.ddd (~r0=<optimized out>) at /workdir/tmp/TestGdbBacktrace2238907183/001/main.go:14
        #2  0x080a27da in main.ccc (~r0=<optimized out>) at /workdir/tmp/TestGdbBacktrace2238907183/001/main.go:11
        #3  0x080a27aa in main.bbb (~r0=<optimized out>) at /workdir/tmp/TestGdbBacktrace2238907183/001/main.go:8
        #4  0x080a277a in main.aaa (~r0=<optimized out>) at /workdir/tmp/TestGdbBacktrace2238907183/001/main.go:5
        #5  0x080a286a in main.main () at /workdir/tmp/TestGdbBacktrace2238907183/001/main.go:22
        waiting for new child: No child processes.
    runtime-gdb_test.go:488: gdb exited with error: signal: killed

It seems to be this issue: https://github.com/bminor/binutils-gdb/blob/f38f7ef965553d5f8a78eba934bb9b192be39c61/gdb/linux-nat.c#L1857. After a clone, gdb fails to find the new child. It seems that either the kernel already killed it, or there is a race where PTRACE_EVENT_CLONE is sent before the child is waitable.

@gopherbot gopherbot added the compiler/runtime Issues related to the Go compiler and/or runtime. label Jun 1, 2023
@mknyszek mknyszek added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Jun 1, 2023
@mknyszek mknyszek added this to the Backlog milestone Jun 1, 2023
@gopherbot
Copy link
Contributor

Change https://go.dev/cl/499975 mentions this issue: runtime: update skips for TestGdbBacktrace

@bcmills
Copy link
Contributor

bcmills commented Jun 1, 2023

Is there an upstream issue for this? The only similar one I could find is https://sourceware.org/bugzilla/show_bug.cgi?id=7166, but that seems too old to be plausible.

(I did see https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=730444, but it includes an assertion failure that isn't present in the linked test log.)

@prattmic
Copy link
Member Author

prattmic commented Jun 1, 2023

Not that I could find. We could file one I suppose, but we should probably try to get a repro first (this has only happened twice).

@golang golang locked and limited conversation to collaborators May 31, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
Archived in project
Development

No branches or pull requests

4 participants