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

misc/cgo/test: test fails on go1.3.2 #8813

Closed
alexbrainman opened this issue Sep 26, 2014 · 12 comments
Closed

misc/cgo/test: test fails on go1.3.2 #8813

alexbrainman opened this issue Sep 26, 2014 · 12 comments

Comments

@alexbrainman
Copy link
Member

GOOS/GOARCH is windows/386

# ..\misc\cgo\test
# _/C_/go/root/misc/cgo/test
C:\DOCUME~1\brainman\LOCALS~1\Temp\go-build340188987\_\C_\go\root\misc\cgo\test\_test\_obj_test\issue7978.cgo2.o:
In function `issue7978c':
C:/go/root/misc/cgo/test/issue7978.go:18: undefined reference to `__sync_fetch_and_add_4'
C:/go/root/misc/cgo/test/issue7978.go:21: undefined reference to `__sync_fetch_and_add_4'
C:/go/root/misc/cgo/test/issue7978.go:25: undefined reference to `__sync_fetch_and_add_4'
collect2: ld returned 1 exit status
FAIL    _/C_/go/root/misc/cgo/test [build failed]

C:\go\root\src>hg id
85518b1d6f8d (release-branch.go1.3) go1.3.2/release
@alexbrainman
Copy link
Member Author

@rsc
Copy link
Contributor

rsc commented Sep 30, 2014

Comment 2:

The link error is easy: the mingw being used is too old, and a newer one must be used if
you want to run the tests. Updating would probably bring fewer gcc bugs too.
But the builders have the new enough mingw and are still seeing failures when the test
executes. I am co-opting this issue for that problem, which I do not understand.
Here is an execution failure.
http://build.golang.org/log/9668ce8fb8053933ba0782562a271078b9205811
The runtime frames are missing.
The runtime frames are controlled by setting the GOTRACEBACK environment variable to 2.
The run.bat script does this when running misc/cgo/test.
The test itself checks os.Getenv("GOTRACEBACK") == "2" before starting the test.
So %GOTRACEBACK% *is* 2, but the runtime is still not printing frames.
It looks to me like on Windows the runtime uses env_posix.go but should
really be using a Windows-specific implementation of getenv.
Like on Plan 9, I don't believe the environment is just handed to the process on startup.
Instead the getenv implementation should do what syscall.Getenv does.
(Perhaps there are ASCII versions that can be used to avoid the UTF-16 decoding.)
Great story, except that somehow this test is passing at tip.
Why does runtime.getenv work on Windows at tip but apparently not work on the 1.3
release branch?

Labels changed: added release-go1.3.3.

Status changed to Accepted.

@alexbrainman
Copy link
Member Author

Comment 3:

I will investigate, if you like.
Alex

@rsc
Copy link
Contributor

rsc commented Sep 30, 2014

Comment 4:

Please do. Thank you!

@alexbrainman
Copy link
Member Author

Comment 5:

> ... Why does runtime.getenv work on Windows at tip but apparently not work on the 1.3
release branch?
release version iterates over syscall.envs (that is not set on windows), while tip uses
runtime.envs that is set in os_windows.c.
Do you want me to continue?
Alex

@rsc
Copy link
Contributor

rsc commented Sep 30, 2014

Comment 6:

runtime.envs at tip is supposed to be the same as syscall.envs in 1.3.
In particular, in 1.3, os_windows.c's runtime.goenvs sets up syscall.envs.
It's a bit confusing, which is part of why tip now uses runtime vars for everything.
I see the problem now. traceback_cache is not reset after parsing envs on Windows, like
it in goenvs_unix.
Thank you.

@alexbrainman
Copy link
Member Author

Comment 7:

You are right, I am wrong. As always. :-)
Alex

@rsc
Copy link
Contributor

rsc commented Sep 30, 2014

Comment 8:

Well, you were right that syscall.envs is not set on windows at the time that it is
consulted. That's the problem. Thank you very much.

@alexbrainman
Copy link
Member Author

Comment 9:

Any time.
Alex

@rsc
Copy link
Contributor

rsc commented Sep 30, 2014

Comment 10:

CL 152760043 should help.

@gopherbot
Copy link

Comment 11:

CL https://golang.org/cl/152760043 mentions this issue.

@rsc
Copy link
Contributor

rsc commented Sep 30, 2014

Comment 12:

This issue was closed by revision 6ee8ec277a21.

Status changed to Fixed.

@rsc rsc added this to the Go1.3.3 milestone Apr 14, 2015
rsc added a commit that referenced this issue May 11, 2015
…lan 9

Only Unix was resetting the traceback_cache variable
after initializing the environment. Reset it on all systems
by resetting in parsedebugvars.

Fixes #8813.

LGTM=adg, alex.brainman
R=golang-codereviews, adg, alex.brainman
CC=golang-codereviews, iant, r
https://golang.org/cl/152760043
@golang golang locked and limited conversation to collaborators Jun 25, 2016
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants