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

cmd/compile: windows 386 compile crashes #16674

Closed
brydavis opened this issue Aug 11, 2016 · 23 comments
Closed

cmd/compile: windows 386 compile crashes #16674

brydavis opened this issue Aug 11, 2016 · 23 comments
Labels
FrozenDueToAge OS-Windows WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Milestone

Comments

@brydavis
Copy link

brydavis commented Aug 11, 2016

  1. What version of Go are you using (go version)? 1.6.3 x386 (although no issue for older versions like 1.3.3 x386; no issues for 64-bit version of 1.6.3). Unfortunately, circumstances require that I use 32-bit in order to connect to legacy database...
  2. What operating system and processor architecture are you using (go env)?
    Windows 64, however I have to use x386 version of Go due to legacy database that is 32-bit
  3. What did you do?
    Tried to compile a simple program (like "hello world" simple). Since I don't have admin rights on this machine, had to download / use binary Go compiler. So, I have to build with a command like c:\go\bin\go.exe build. This has worked with previous versions of Go. Here's the error message I get when I try building : go build command-line-arguments: c:\go\pkg\tool\windows_386\compile.exe: exit status 1073741855
  4. What did you expect to see?
    No error
  5. What did you see instead?
    Using version 1.6:
    go build command-line-arguments: c:\go\pkg\tool\windows_386\compile.exe: exit status 1073741855

Take away: There is some issue with Windows x386 version that did not exist previously. Thanks!

@brydavis brydavis changed the title New Build Error on Windows New Build Error on Windows for Go x386 Aug 11, 2016
@quentinmit
Copy link
Contributor

Can you try using the 64-bit compiler to make a 32-bit binary? Set the GOARCH environment variable to 386 before invoking go build.

Marking as Go1.8 since this is not a regression in 1.7.

@quentinmit quentinmit added this to the Go1.8 milestone Aug 11, 2016
@quentinmit quentinmit changed the title New Build Error on Windows for Go x386 cmd/compile: windows 386 compile crashes Aug 11, 2016
@quentinmit
Copy link
Contributor

Also, can you please provide the complete output of the "go env" as the template requests? (Assuming that doesn't itself crash.) Thanks.

@brydavis
Copy link
Author

brydavis commented Aug 11, 2016

SOLUTION

env GOARCH=386 \go\bin\go.exe build or env GOARCH=386 go build

I tested by recompiling a database app with and without the env GOARCH=386 prefix. (Again, note that I need 32-bit app so it could connect to legacy database). It worked with the prefix! I was able to query the database (an old IBM product... we're migrating next year).

Thanks for the tip, @quentinmit.

@brydavis
Copy link
Author

Here's the env info too.

set GOARCH=amd64
set GOBIN=
set GOEXE=.exe
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOOS=windows
set GOPATH=
set GORACE=
set GOROOT=c:\go
set GOTOOLDIR=c:\go\pkg\tool\windows_amd64
set GO15VENDOREXPERIMENT=1
set CC=gcc
set GOGCCFLAGS=-m64 -mthreads -fmessage-length=0
set CXX=g++
set CGO_ENABLED=1

@brydavis
Copy link
Author

Closing issue

@quentinmit
Copy link
Contributor

I'm glad the workaround worked for you, but we'd still like to find out if there is something wrong with the 386 Go binaries. Can you see if the 1.7rc6 386 binaries also crash on your machine?

@quentinmit quentinmit reopened this Aug 13, 2016
@hirochachacha
Copy link
Contributor

What version of Windows are you using? I could not reproduce it on my Windows 10.

@brydavis
Copy link
Author

brydavis commented Aug 14, 2016

I'll test if 1.7rc6 works.

Running on Windows 7 Enterprise (64-bit).

@brydavis
Copy link
Author

Plot thickens...

I downloaded 1.7rc6 386 binaries and attempted to compile a couple programs (both simple and complex). Here' s error message:

go tool: no such tool "compile"

Hope this helps.

@hirochachacha
Copy link
Contributor

I suspect that $GOROOT doesn't match newly installed location.
Can you check output of go env is correct? If no, please set environmental variable manually, then retry it.

@brydavis
Copy link
Author

brydavis commented Aug 15, 2016

"I suspect that $GOROOT doesn't match newly installed location."

As previously stated, I do not have admin rights on this computer, thus am unable to set system environments (aside from an annoying %go% user environment variable). There is a workaround (see above) for compiling to 32-bit from another version.

I use binaries on this computer, thus building via /go/bin/go.exe build. This works in all other circumstances (e.g. 1.6.3 windows 64-bit), except for 386 compilers somewhere after version 1.3~. So, if $GOROOT value is the issue, it's only an issue for 386 versions after version 1.3~.

Please see above for go env output.

@hirochachacha
Copy link
Contributor

Your go env is strange. If you use 386 version of Go, $GOARCH should be 386.
Are you sure you are using downloaded binary?

@brydavis
Copy link
Author

That's probably the output from the 64-bit binary (original issue was with 386; I'll change above comment when I have a chance). Since I'm using binaries, GOARCH willl be whatever default is... For example, the binary for 1.7rc6 386 is GOARCH=386.

@hirochachacha
Copy link
Contributor

Did you extract zip file to C:\Go?

@brydavis
Copy link
Author

Yes, extracted from zip.

@hirochachacha
Copy link
Contributor

Are you using an unix-like shell?

@hirochachacha
Copy link
Contributor

(I can't see env command on my cmd.exe)

@brydavis
Copy link
Author

env works fine on both terminal apps I use (including cmd.exe)

@hirochachacha
Copy link
Contributor

hirochachacha commented Aug 15, 2016

Hmm, does $GOTOOLDIR exist on filesystem? (e.g "C:\Go\pkg\tool\windows_386")

@brydavis
Copy link
Author

Yep, that folder exists

@hirochachacha
Copy link
Contributor

hirochachacha commented Aug 15, 2016

can you invoke compile.exe x.go in that directory? (x.go is your source code)

@brydavis
Copy link
Author

@hirochachacha, are you able to replicate the error messages?

@hirochachacha
Copy link
Contributor

hirochachacha commented Aug 16, 2016

I can replicate go tool: no such tool "compile" by setting wrong $GOROOT.

I cannot replicate go build command-line-arguments: c:\go\pkg\tool\windows_386\compile.exe: exit status 1073741855. I want to know that If you run compile.exe directly on Go 1.7, you will get same error as on Go 1.6.3.

Because two error messages indicate different issue.

@bradfitz bradfitz added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Sep 9, 2016
@bradfitz bradfitz modified the milestones: Go1.8Maybe, Go1.8 Sep 9, 2016
@rsc rsc closed this as completed Oct 20, 2016
@golang golang locked and limited conversation to collaborators Oct 20, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge OS-Windows WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

6 participants