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: TestGdbConst output mismatch #22012

Closed
alexbrainman opened this issue Sep 25, 2017 · 7 comments

Comments

Projects
None yet
5 participants
@alexbrainman
Copy link
Member

commented Sep 25, 2017

What version of Go are you using (go version)?

go version devel +45395b5ad6 Mon Sep 25 08:54:28 2017 +0000 windows/amd64

Does this issue reproduce with the latest release?

It does not.

What operating system and processor architecture are you using (go env)?

set GOARCH=amd64
set GOBIN=
set GOEXE=.exe
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOOS=windows
set GOPATH=c:\users\alex\dev
set GORACE=
set GOROOT=c:\users\alex\dev\go
set GOTOOLDIR=c:\users\alex\dev\go\pkg\tool\windows_amd64
set GCCGO=gccgo
set CC=gcc
set GOGCCFLAGS=-m64 -mthreads -fmessage-length=0 -fdebug-prefix-map=C:\Users\Alex\AppData\Local\Temp\go-build558249031=/tmp/go-build -gno-record-gcc-switches
set CXX=g++
set CGO_ENABLED=1
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
set PKG_CONFIG=pkg-config

What did you do?

go test -v -run=TestGdbConst runtime

What did you expect to see?

PASS

What did you see instead?

=== RUN TestGdbConst
--- FAIL: TestGdbConst (0.49s)
runtime-gdb_test.go:55: gdb version 7.8
runtime-gdb_test.go:436: output "No symbol "startup" in current context.\r\nBreakpoint 1 at 0x44d004: file C:/Users/Alex/AppData/Local/Temp/go-build229403255/main.go, line 9.\r\n[New Thread 9736.0x2280]\r\n[New Thread 9736.0x165c]\r\n[New Thread 9736.0x1e70]\r\n[New Thread 9736.0x824]\r\nwarning: Can not parse XML library list; XML support was disabled at compile time\r\n[New Thread 9736.0x63c]\r\n[New Thread 9736.0x228]\r\n[New Thread 9736.0x2220]\r\n[New Thread 9736.0x27e0]\r\n\r\nBreakpoint 1, main.main () at C:/Users/Alex/AppData/Local/Temp/go-build229403255/main.go:9\r\n9\t\tprintln("hello world")\r\n$1 = 42\r\n$2 = 18446744073709551615\r\n$3 = -1\r\n$4 = 1 '\001'\r\n"
runtime-gdb_test.go:439: output mismatch
FAIL
exit status 1
FAIL runtime 0.591s

@alexbrainman

This comment has been minimized.

Copy link
Member Author

commented Sep 25, 2017

Looks like new test by @aarzilli expects gdb output strings delimited by \n, while my gdb delimits them by \r\n. Leaving it for others to decide how to adjust this if condition.

Alex

@aarzilli

This comment has been minimized.

Copy link
Contributor

commented Sep 25, 2017

Are the windows try-bots not running gdb tests or is there a way to make gdb on windows terminate lines with \n only?

@gopherbot

This comment has been minimized.

Copy link

commented Sep 25, 2017

Change https://golang.org/cl/65850 mentions this issue: runtime: fix TestGdbConst on windows

@alexbrainman

This comment has been minimized.

Copy link
Member Author

commented Sep 25, 2017

Are the windows try-bots not running gdb tests

Quite possible ( @andybons or @johnsonj do you know if windows trybots have gdb installed? Do any of runtime/runtime-gdb_test.go tests run on trybots? ). TestGdbConst calls checkGdbVersion which calls t.Skip if gdb is not found and for other reasons.

is there a way to make gdb on windows terminate lines with \n only?

I would not know. Why don't we remove all \r from gdb output before comparing it with "sgot" variable? I can make that change, if you agree. Or you can do it yourself.

Alex

@aarzilli

This comment has been minimized.

Copy link
Contributor

commented Sep 25, 2017

I went the other way with the CL because I was worried about the lone '\r' terminator being still alive somewhere, but maybe that's unfounded.

@johnsonj

This comment has been minimized.

Copy link
Member

commented Sep 25, 2017

@alexbrainman Just checked and it looks like no. Great catch 👍

I've filed and self assigned #22021

@alexbrainman

This comment has been minimized.

Copy link
Member Author

commented Sep 25, 2017

I've filed and self assigned #22021

Sounds like a plan. Thank you.

Alex

@golang golang locked and limited conversation to collaborators Sep 25, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.