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

x/build: Add gdb to Windows Builders #22021

Open
johnsonj opened this issue Sep 25, 2017 · 8 comments
Open

x/build: Add gdb to Windows Builders #22021

johnsonj opened this issue Sep 25, 2017 · 8 comments
Labels
Builders x/build issues (builders, bots, dashboards) NeedsFix The path to resolution is known, but the work has not been done. OS-Windows
Milestone

Comments

@johnsonj
Copy link
Contributor

As observed in #22012 the Windows builders do not have gdb causing them to skip any gdb related test.

Add gdb to these packages

@johnsonj johnsonj added Builders x/build issues (builders, bots, dashboards) OS-Windows labels Sep 25, 2017
@johnsonj johnsonj self-assigned this Sep 25, 2017
@gopherbot gopherbot added this to the Unreleased milestone Sep 25, 2017
@alexbrainman
Copy link
Member

@johnsonj while you at it ...

2 out of 5 gdb tests are skipped on my computer:

c:\Users\Alex\dev\go\src>go test -v -run=TestGdb runtime
=== RUN   TestGdbPython
=== RUN   TestGdbPythonCgo
=== RUN   TestGdbBacktrace
=== RUN   TestGdbAutotmpTypes
=== RUN   TestGdbConst
--- SKIP: TestGdbPython (0.05s)
        runtime-gdb_test.go:55: gdb version 7.8
        runtime-gdb_test.go:70: skipping due to lack of python gdb support: Python scripting is not supported in this copy of GDB.
--- SKIP: TestGdbPythonCgo (0.04s)
        runtime-gdb_test.go:55: gdb version 7.8
        runtime-gdb_test.go:70: skipping due to lack of python gdb support: Python scripting is not supported in this copy of GDB.
--- PASS: TestGdbBacktrace (0.51s)
        runtime-gdb_test.go:55: gdb version 7.8
--- PASS: TestGdbAutotmpTypes (0.54s)
        runtime-gdb_test.go:55: gdb version 7.8
--- PASS: TestGdbConst (0.54s)
        runtime-gdb_test.go:55: gdb version 7.8
        runtime-gdb_test.go:436: output "No symbol \"startup\" in current context.\nBreakpoint 1 at 0x44d004: file C:/Users/Alex/AppData/Local/Temp/go-build263992595/main.go, line 9.\n[New Thread 6644.0x2228]\n[New Thread 6644.0x6a8]\n[New Thread 6644.0x2938]\n[New Thread 6644.0x135c]\nwarning: Can not parse XML library list; XML support was disabled at compile time\n[New Thread 6644.0x1dd4]\n[New Thread 6644.0x2258]\n[New Thread 6644.0x239c]\n[New Thread 6644.0x1a9c]\n\nBreakpoint 1, main.main () at C:/Users/Alex/AppData/Local/Temp/go-build263992595/main.go:9\n9\t\tprintln(\"hello world\")\n$1 = 42\n$2 = 18446744073709551615\n$3 = -1\n$4 = 1 '\\001'\n"
PASS
ok      runtime 0.649s

c:\Users\Alex\dev\go\src>

I suspect it would be hard to make skipped tests run. As far as I remember I tried some time ago and failed. Do not spent too much time on it if you cannot.

Alex

@alexbrainman
Copy link
Member

@johnsonj when selecting what gdb version to run, just be aware that gdb 7.9.1 fails with our tests - see #24743 for details.

Alex

@gopherbot
Copy link
Contributor

Change https://go.dev/cl/470596 mentions this issue: runtime: set procid on Windows

@qmuntal
Copy link
Contributor

qmuntal commented Feb 23, 2023

@thanm @dmitshur if approved, CL 470596 will unskip all gdb test on Windows. I've tried with gdb 12.1 and all tests passes. Is it time to add gdb to Windows builders?

I'm particularly interested on this because I want to add some CGO unwinding tests as part of #58378, and they ideally should also run on Windows using gdb and SEH (once #57302 is done).

@thanm
Copy link
Contributor

thanm commented Feb 23, 2023

Is it time to add gdb to Windows builders?

Seems ok to me on principle. What distribution/vintage of GDB 12 did you use for your testing?

@thanm
Copy link
Contributor

thanm commented Feb 23, 2023

Note to self: while we are installing GDB, it would probably also be a good idea to install Delve as well (right now I don't think there are any tests that use delve that run on windows, but this could change).

@qmuntal
Copy link
Contributor

qmuntal commented Feb 23, 2023

Is it time to add gdb to Windows builders?

Seems ok to me on principle. What distribution/vintage of GDB 12 did you use for your testing?

The one you get from running choco install mingw --version=12.2.0. Which installs this under the hood: https://github.com/brechtsanders/winlibs_mingw/releases/tag/12.2.0-14.0.6-10.0.0-ucrt-r2

$ gcc --version
gcc.exe (MinGW-W64 x86_64-ucrt-posix-seh, built by Brecht Sanders) 12.2.0
Copyright (C) 2022 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ gdb --version
GNU gdb (GDB for MinGW-W64 x86_64, built by Brecht Sanders) 12.1
Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

@dmitshur dmitshur added the NeedsFix The path to resolution is known, but the work has not been done. label Feb 23, 2023
gopherbot pushed a commit that referenced this issue Feb 27, 2023
The runtime-gdb.py script needs procid to be set in order to
map a goroutine ID with an OS thread. The Go runtime is not currently
setting that variable on Windows, so TestGdbPython (and friends) can't
succeed.

This CL initializes procid and unskips gdb tests on Windows.

Fixes #22687
Updates #21380
Updates #22021

Change-Id: Icd1d9fc1764669ed1bf04f53d17fadfd24ac3f30
Reviewed-on: https://go-review.googlesource.com/c/go/+/470596
Reviewed-by: Alex Brainman <[email protected]>
Reviewed-by: Dmitri Shuralyov <[email protected]>
TryBot-Result: Gopher Robot <[email protected]>
Reviewed-by: Bryan Mills <[email protected]>
Run-TryBot: Quim Muntal <[email protected]>
@gopherbot
Copy link
Contributor

Change https://go.dev/cl/473116 mentions this issue: runtime: skip TestGdbPanic on Windows

gopherbot pushed a commit that referenced this issue Mar 3, 2023
TestGdbPanic expects crash() to raise a SIGABRT signal interceptable
by gdb, but Windows doesn't have signals.

Windows builders haven't caught this failing test because they still
don't have gdb installed (tracked in #22021).

Change-Id: I7c7f2523a54d61aea0a9821c4db7c79e58a7217c
Reviewed-on: https://go-review.googlesource.com/c/go/+/473116
Reviewed-by: Dmitri Shuralyov <[email protected]>
Run-TryBot: Quim Muntal <[email protected]>
Reviewed-by: Bryan Mills <[email protected]>
TryBot-Result: Gopher Robot <[email protected]>
Auto-Submit: Quim Muntal <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Builders x/build issues (builders, bots, dashboards) NeedsFix The path to resolution is known, but the work has not been done. OS-Windows
Projects
None yet
Development

No branches or pull requests

6 participants