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: several tests are failing on windows-arm64-aws builder due to redeclaration warnings (upgraded to errors in testing) #46502

Closed
dmitshur opened this issue Jun 1, 2021 · 17 comments · Fixed by ferrmin/go#80
Labels
arch-arm64 FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done. OS-Windows
Milestone

Comments

@dmitshur
Copy link
Contributor

dmitshur commented Jun 1, 2021

--- FAIL: TestCgoDLLImports (19.82s)
    crash_test.go:54: building testprogcgo []: exit status 1
        # runtime/testdata/testprogcgo
        In file included from _cgo_export.c:4:
        cgo-gcc-export-header-prolog:43:35: warning: redeclaration of 'GoNop' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration]
        aprof.go:13:14: note: previous declaration is here
        cgo-gcc-export-header-prolog:44:35: warning: redeclaration of 'goBigStack1' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration]
        bigstack_windows.go:9:13: note: previous declaration is here
        go build runtime/testdata/testprogcgo: C compiler warning promoted to error on Go builders

[...]

FAIL
FAIL	runtime	66.604s
More Failing Tests in runtime

Here are the other failing test in runtime, all with the same problem:

--- FAIL: TestCgoPanicDeadlock (17.25s)
    crash_test.go:54: building testprogcgo []: exit status 1
        # runtime/testdata/testprogcgo
        In file included from _cgo_export.c:4:
        cgo-gcc-export-header-prolog:43:35: warning: redeclaration of 'GoNop' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration]
        aprof.go:13:14: note: previous declaration is here
        cgo-gcc-export-header-prolog:44:35: warning: redeclaration of 'goBigStack1' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration]
        bigstack_windows.go:9:13: note: previous declaration is here
        go build runtime/testdata/testprogcgo: C compiler warning promoted to error on Go builders
        
--- FAIL: TestCgoTracebackContext (17.25s)
    crash_test.go:54: building testprogcgo []: exit status 1
        # runtime/testdata/testprogcgo
        In file included from _cgo_export.c:4:
        cgo-gcc-export-header-prolog:43:35: warning: redeclaration of 'GoNop' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration]
        aprof.go:13:14: note: previous declaration is here
        cgo-gcc-export-header-prolog:44:35: warning: redeclaration of 'goBigStack1' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration]
        bigstack_windows.go:9:13: note: previous declaration is here
        go build runtime/testdata/testprogcgo: C compiler warning promoted to error on Go builders
        
--- FAIL: TestCgoCCodeSIGPROF (17.24s)
    crash_test.go:54: building testprogcgo []: exit status 1
        # runtime/testdata/testprogcgo
        In file included from _cgo_export.c:4:
        cgo-gcc-export-header-prolog:43:35: warning: redeclaration of 'GoNop' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration]
        aprof.go:13:14: note: previous declaration is here
        cgo-gcc-export-header-prolog:44:35: warning: redeclaration of 'goBigStack1' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration]
        bigstack_windows.go:9:13: note: previous declaration is here
        go build runtime/testdata/testprogcgo: C compiler warning promoted to error on Go builders
        
--- FAIL: TestCgoCheckBytes (0.00s)
    crash_cgo_test.go:188: building testprogcgo []: exit status 1
        # runtime/testdata/testprogcgo
        In file included from _cgo_export.c:4:
        cgo-gcc-export-header-prolog:43:35: warning: redeclaration of 'GoNop' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration]
        aprof.go:13:14: note: previous declaration is here
        cgo-gcc-export-header-prolog:44:35: warning: redeclaration of 'goBigStack1' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration]
        bigstack_windows.go:9:13: note: previous declaration is here
        go build runtime/testdata/testprogcgo: C compiler warning promoted to error on Go builders
        
--- FAIL: TestBigStackCallbackCgo (0.00s)
    crash_test.go:54: building testprogcgo []: exit status 1
        # runtime/testdata/testprogcgo
        In file included from _cgo_export.c:4:
        cgo-gcc-export-header-prolog:43:35: warning: redeclaration of 'GoNop' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration]
        aprof.go:13:14: note: previous declaration is here
        cgo-gcc-export-header-prolog:44:35: warning: redeclaration of 'goBigStack1' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration]
        bigstack_windows.go:9:13: note: previous declaration is here
        go build runtime/testdata/testprogcgo: C compiler warning promoted to error on Go builders
        
--- FAIL: TestCgoExternalThreadPanic (0.00s)
    crash_test.go:54: building testprogcgo []: exit status 1
        # runtime/testdata/testprogcgo
        In file included from _cgo_export.c:4:
        cgo-gcc-export-header-prolog:43:35: warning: redeclaration of 'GoNop' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration]
        aprof.go:13:14: note: previous declaration is here
        cgo-gcc-export-header-prolog:44:35: warning: redeclaration of 'goBigStack1' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration]
        bigstack_windows.go:9:13: note: previous declaration is here
        go build runtime/testdata/testprogcgo: C compiler warning promoted to error on Go builders
        
--- FAIL: TestCgoTraceback (0.00s)
    crash_test.go:54: building testprogcgo []: exit status 1
        # runtime/testdata/testprogcgo
        In file included from _cgo_export.c:4:
        cgo-gcc-export-header-prolog:43:35: warning: redeclaration of 'GoNop' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration]
        aprof.go:13:14: note: previous declaration is here
        cgo-gcc-export-header-prolog:44:35: warning: redeclaration of 'goBigStack1' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration]
        bigstack_windows.go:9:13: note: previous declaration is here
        go build runtime/testdata/testprogcgo: C compiler warning promoted to error on Go builders
        
--- FAIL: TestCgoCrashHandler (0.00s)
    crash_test.go:54: building testprogcgo []: exit status 1
        # runtime/testdata/testprogcgo
        In file included from _cgo_export.c:4:
        cgo-gcc-export-header-prolog:43:35: warning: redeclaration of 'GoNop' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration]
        aprof.go:13:14: note: previous declaration is here
        cgo-gcc-export-header-prolog:44:35: warning: redeclaration of 'goBigStack1' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration]
        bigstack_windows.go:9:13: note: previous declaration is here
        go build runtime/testdata/testprogcgo: C compiler warning promoted to error on Go builders

Source: https://storage.googleapis.com/go-build-log/986587f4/windows-arm64-aws_fcda3dac.log from CL 323990.

There's also a test in cmd/link that builds testprogcgo with the same problem:

--- FAIL: TestDWARF (0.00s)
    --- FAIL: TestDWARF/testprogcgo (33.77s)
        dwarf_test.go:94: go build -o C:\Users\gopher\AppData\Local\Temp\TestDWARF_testprogcgo649726619\001\testprogcgo.exe ../../runtime/testdata/testprogcgo: exit status 1
            # runtime/testdata/testprogcgo
            In file included from _cgo_export.c:4:
            cgo-gcc-export-header-prolog:43:35: warning: redeclaration of 'GoNop' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration]
            aprof.go:13:14: note: previous declaration is here
            cgo-gcc-export-header-prolog:44:35: warning: redeclaration of 'goBigStack1' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration]
            bigstack_windows.go:9:13: note: previous declaration is here
            go build runtime/testdata/testprogcgo: C compiler warning promoted to error on Go builders
FAIL
FAIL	cmd/link	35.289s

Source: https://storage.googleapis.com/go-build-log/0f330f99/windows-arm64-aws_80fa3b05.log from CL 323993.

This is possibly connected to the builder using a newer version of the C toolchain, as discussed in #46406.

Note these are warnings if run locally, but the build system upgrade warnings during test execution into to failures.

CC @rsc, @golang/release, @zx2c4.

@dmitshur dmitshur added OS-Windows NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. arch-arm64 labels Jun 1, 2021
@dmitshur dmitshur added this to the Go1.17 milestone Jun 1, 2021
@ianlancetaylor
Copy link
Contributor

Likely related to https://golang.org/cl/262797 for #30674. CC @qmuntal . That said that CL is in the 1.15 and 1.16 releases and I don't recall seeing any complaints.

@gopherbot
Copy link

Change https://golang.org/cl/323991 mentions this issue: runtime: skip tests that build testprogcgo on windows/arm64

@cherrymui
Copy link
Member

That said that CL is in the 1.15 and 1.16 releases and I don't recall seeing any complaints.

Maybe only Windows/ARM64 uses clang-based C toolchain which warns that, whereas previously Windows/AMD64 and 386 use GCC which doesn't warn that?

@qmuntal
Copy link
Contributor

qmuntal commented Jun 4, 2021

Maybe only Windows/ARM64 uses clang-based C toolchain which warns that, whereas previously Windows/AMD64 and 386 use GCC which doesn't warn that?

I checked that hypothesis and it is right, for the case of a function declared in the C preamble and also exported in Go we are currently adding two declarations in the C export header, one with dllexport and the other without. Clearly, GCC does not complain about that, although I haven't found any reference on the web explaining why it doesn't.

A solution would be to prepend dllexport in the C preamble function if it doesn't contain it and is exported in Go. I can take a stab at this issue, as it can be tested using mingw toolchain.

@qmuntal
Copy link
Contributor

qmuntal commented Jun 4, 2021

Digging a little bit deeper, clang emit a warning and not an error because redeclaring a function with __declspec(dllexport) or __declspec(dllimport) is "technically" fine as long as the function is not used between both declarations. See https://reviews.llvm.org/D5087 for more info.

My understanding is that the C export header cannot contain any function call, only function declarations, so it would be safe to ignore this warning using -Wno-dll-attribute-on-redeclaration, as it is already happening with other warnings:

go/src/cmd/cgo/gcc.go

Lines 1615 to 1623 in 0214440

if p.GccIsClang {
c = append(c,
"-ferror-limit=0",
// Apple clang version 1.7 (tags/Apple/clang-77) (based on LLVM 2.9svn)
// doesn't have -Wno-unneeded-internal-declaration, so we need yet another
// flag to disable the warning. Yes, really good diagnostics, clang.
"-Wno-unknown-warning-option",
"-Wno-unneeded-internal-declaration",
"-Wno-unused-function",

Doing this would simplify the cgo code that generates the C export header, as implementing the solution I was proposing in the previous comment is not straight forward.

@alexbrainman
Copy link
Member

it would be safe to ignore this warning using -Wno-dll-attribute-on-redeclaration, as it is already happening with other warnings:

SGTM. But I am not an expert here so defer to Go Team.

Alex

@rsc
Copy link
Contributor

rsc commented Jun 8, 2021

I rewrote a bunch of tests not to depend on this kind of redeclaration. Are these new?

@cherrymui
Copy link
Member

The test doesn't seem new to me.

@gopherbot
Copy link

Change https://golang.org/cl/326310 mentions this issue: cmd/internal/sys: mark windows/arm64 as c-shared-capable

@dmitshur
Copy link
Contributor Author

dmitshur commented Jun 10, 2021

In my local testing on a Surface Pro X device, this issue reproduces only when GO_BUILDER_NAME is set to a non-empty string (which is the case on builders). It requires clearing out the build cache (go clean -cache) after successful invocations to cause the testprogcgo program to be rebuilt.

So, this passes:

$ GO_BUILDER_NAME='' go test -count=1 -v -run='TestCgoDLLImports' runtime

And this reproduces the test failure:

$ go clean -cache  # so the testprogcgo program is built from source again
$ GO_BUILDER_NAME='foo' go test -count=1 -v -run='TestCgoDLLImports' runtime

For some reason, compilation warnings (which are upgraded to errors on builders) aren't printed even with -v flag.

It's possible Russ did not run into this since setting a non-empty GO_BUILDER_NAME during local development is rarely done, and there's no indication of a problem otherwise (that seems like a bug in itself).

@toothrot
Copy link
Contributor

After creating a fresh builder image with llvm-mingw-20201020, I can also confirm that the tests fail similarly, reinforcing @dmitshur's work.

Test output
2021/06/10 13:39:30 Running src/all.bat ...
:: Running C:\workdir\go\src\all.bat with args ["C:\\workdir\\go\\src\\all.bat"] and env ["GOBUILDEXIT=1" "=C:=C:\\golang" "ALLUSERSPROFILE=C:\\ProgramData" "APPDATA=C:\\Users\\gopher\\AppData\\Roaming" "CommonProgramFiles=C:\\Program Files\\Common Files" "CommonProgramFiles(Arm)=C:\\Program Files (Arm)\\Common Files" "CommonProgramFiles(x86)=C:\\Program Files (x86)\\Common Files" "CommonProgramW6432=C:\\Program Files\\Common Files" "COMPUTERNAME=DESKTOP-0285N7P" "ComSpec=C:\\WINDOWS\\system32\\cmd.exe" "DriverData=C:\\Windows\\System32\\Drivers\\DriverData" "FPS_BROWSER_APP_PROFILE_STRING=Internet Explorer" "FPS_BROWSER_USER_PROFILE_STRING=Default" "GOROOT_BOOTSTRAP=C:\\workdir\\go1.4" "HOMEDRIVE=C:" "HOMEPATH=\\Users\\gopher" "LOCALAPPDATA=C:\\Users\\gopher\\AppData\\Local" "LOGONSERVER=\\\\DESKTOP-0285N7P" "NUMBER_OF_PROCESSORS=4" "OneDrive=C:\\Users\\gopher\\OneDrive" "OS=Windows_NT" "PATH=C:\\WINDOWS\\system32;C:\\WINDOWS;C:\\WINDOWS\\System32\\Wbem;C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\;C:\\WINDOWS\\System32\\OpenSSH\\;C:\\Users\\gopher\\AppData\\Local\\Microsoft\\WindowsApps;;C:\\godep\\llvm-aarch64\\bin" "PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC" "PROCESSOR_ARCHITECTURE=ARM64" "PROCESSOR_IDENTIFIER=ARMv8 (64-bit) Family 8 Model D08 Revision   3, QEMU" "PROCESSOR_LEVEL=3336" "PROCESSOR_REVISION=0003" "ProgramData=C:\\ProgramData" "ProgramFiles=C:\\Program Files" "ProgramFiles(Arm)=C:\\Program Files (Arm)" "ProgramFiles(x86)=C:\\Program Files (x86)" "ProgramW6432=C:\\Program Files" "PROMPT=$P$G" "PSModulePath=C:\\Program Files\\WindowsPowerShell\\Modules;C:\\WINDOWS\\system32\\WindowsPowerShell\\v1.0\\Modules" "PUBLIC=C:\\Users\\Public" "SESSIONNAME=Console" "SystemDrive=C:" "SystemRoot=C:\\WINDOWS" "TEMP=C:\\Users\\gopher\\AppData\\Local\\Temp" "TMP=C:\\Users\\gopher\\AppData\\Local\\Temp" "USERDOMAIN=DESKTOP-0285N7P" "USERDOMAIN_ROAMINGPROFILE=DESKTOP-0285N7P" "USERNAME=gopher" "USERPROFILE=C:\\Users\\gopher" "windir=C:\\WINDOWS" "GO_STAGE0_NET_DELAY=200ms" "GO_STAGE0_DL_DELAY=200ms" "WORKDIR=C:\\workdir" "GO_BUILDER_NAME=windows-arm64-aws" "GOARCH=arm64"] in dir C:\workdir\go\src

Building Go cmd/dist using C:\workdir\go1.4
Building Go toolchain1 using C:\workdir\go1.4.
Building Go bootstrap cmd/go (go_bootstrap) using Go toolchain1.
Building Go toolchain2 using go_bootstrap and Go toolchain1.
Building Go toolchain3 using go_bootstrap and Go toolchain2.
Building packages and commands for windows/arm64.


##### Testing packages.
ok  	archive/tar	3.027s
ok  	archive/zip	3.231s
ok  	bufio	0.411s
ok  	bytes	4.397s
ok  	compress/bzip2	0.598s
ok  	compress/flate	6.302s
ok  	compress/gzip	1.684s
ok  	compress/lzw	0.581s
ok  	compress/zlib	2.021s
ok  	container/heap	0.111s
ok  	container/list	0.122s
ok  	container/ring	0.227s
ok  	context	0.181s
ok  	crypto	0.179s
ok  	crypto/aes	0.139s
ok  	crypto/cipher	0.218s
ok  	crypto/des	0.187s
ok  	crypto/dsa	0.282s
ok  	crypto/ecdsa	0.305s
ok  	crypto/ed25519	0.417s
ok  	crypto/ed25519/internal/edwards25519	15.843s
ok  	crypto/ed25519/internal/edwards25519/field	6.483s
ok  	crypto/elliptic	0.399s
ok  	crypto/elliptic/internal/fiat	0.164s
ok  	crypto/hmac	0.143s
ok  	crypto/internal/subtle	0.147s
ok  	crypto/md5	0.093s
ok  	crypto/rand	0.196s
ok  	crypto/rc4	0.221s
ok  	crypto/rsa	0.600s
ok  	crypto/sha1	0.197s
ok  	crypto/sha256	0.100s
ok  	crypto/sha512	0.117s
ok  	crypto/subtle	0.160s
ok  	crypto/tls	6.782s
ok  	crypto/x509	3.573s
ok  	database/sql	0.826s
ok  	database/sql/driver	0.098s
ok  	debug/dwarf	0.882s
ok  	debug/elf	0.805s
ok  	debug/gosym	0.200s
ok  	debug/macho	0.567s
ok  	debug/pe	29.372s
ok  	debug/plan9obj	0.483s
ok  	embed/internal/embedtest	0.085s
ok  	encoding/ascii85	0.091s
ok  	encoding/asn1	0.189s
ok  	encoding/base32	0.282s
ok  	encoding/base64	0.147s
ok  	encoding/binary	0.118s
ok  	encoding/csv	0.130s
ok  	encoding/gob	0.132s
ok  	encoding/hex	0.196s
ok  	encoding/json	0.710s
ok  	encoding/pem	0.142s
ok  	encoding/xml	0.141s
ok  	errors	0.143s
ok  	expvar	0.163s
ok  	flag	0.512s
ok  	fmt	0.350s
ok  	go/ast	0.131s
ok  	go/build	33.051s
ok  	go/build/constraint	0.141s
ok  	go/constant	0.117s
ok  	go/doc	3.544s
ok  	go/format	0.106s
ok  	go/importer	0.746s
ok  	go/internal/gccgoimporter	0.802s
ok  	go/internal/gcimporter	4.894s
ok  	go/internal/srcimporter	18.667s
ok  	go/parser	0.487s
ok  	go/printer	0.917s
ok  	go/scanner	0.093s
ok  	go/token	0.125s
ok  	go/types	119.284s
ok  	hash	0.093s
ok  	hash/adler32	0.099s
ok  	hash/crc32	0.092s
ok  	hash/crc64	0.118s
ok  	hash/fnv	0.139s
ok  	hash/maphash	0.220s
ok  	html	0.108s
ok  	html/template	0.822s
ok  	image	0.866s
ok  	image/color	0.107s
ok  	image/draw	0.191s
ok  	image/gif	0.967s
ok  	image/jpeg	1.238s
ok  	image/png	1.065s
ok  	index/suffixarray	0.550s
ok  	internal/abi	1.108s
ok  	internal/cpu	0.122s
ok  	internal/execabs	0.109s
ok  	internal/fmtsort	0.149s
ok  	internal/itoa	0.146s
ok  	internal/poll	0.136s
ok  	internal/profile	0.125s
ok  	internal/reflectlite	0.209s
ok  	internal/singleflight	0.106s
ok  	internal/syscall/windows	0.239s
ok  	internal/syscall/windows/registry	0.138s
ok  	internal/trace	0.791s
ok  	internal/unsafeheader	0.085s
ok  	internal/xcoff	0.444s
ok  	io	0.162s
ok  	io/fs	0.159s
ok  	io/ioutil	0.297s
ok  	log	0.154s
ok  	math	0.099s
ok  	math/big	2.820s
ok  	math/bits	0.094s
ok  	math/cmplx	0.133s
ok  	math/rand	0.603s
ok  	mime	0.228s
ok  	mime/multipart	0.531s
ok  	mime/quotedprintable	0.109s
ok  	net	230.598s
ok  	net/http	25.548s
ok  	net/http/cgi	1.216s
ok  	net/http/cookiejar	0.232s
ok  	net/http/fcgi	0.263s
ok  	net/http/httptest	4.773s
ok  	net/http/httptrace	0.147s
ok  	net/http/httputil	0.409s
ok  	net/http/internal	0.102s
ok  	net/http/internal/ascii	0.139s
ok  	net/http/pprof	5.424s
ok  	net/internal/socktest	0.105s
ok  	net/mail	0.174s
ok  	net/rpc	0.148s
ok  	net/rpc/jsonrpc	0.101s
ok  	net/smtp	0.123s
ok  	net/textproto	0.094s
ok  	net/url	0.166s
ok  	os	15.082s
ok  	os/exec	26.249s
ok  	os/signal	6.288s
ok  	os/user	0.279s
ok  	path	0.147s
ok  	path/filepath	4.650s
ok  	plugin	0.082s
ok  	reflect	4.039s
ok  	regexp	0.633s
ok  	regexp/syntax	0.684s
--- FAIL: TestCgoDLLImports (40.16s)
    crash_test.go:54: building testprogcgo []: exit status 1
        # runtime/testdata/testprogcgo
        In file included from _cgo_export.c:4:
        cgo-gcc-export-header-prolog:43:35: warning: redeclaration of 'GoNop' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration]
        aprof.go:13:14: note: previous declaration is here
        cgo-gcc-export-header-prolog:44:35: warning: redeclaration of 'goBigStack1' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration]
        bigstack_windows.go:9:13: note: previous declaration is here
        go build runtime/testdata/testprogcgo: C compiler warning promoted to error on Go builders
        
--- FAIL: TestCgoTracebackContext (32.70s)
    crash_test.go:54: building testprogcgo []: exit status 1
        # runtime/testdata/testprogcgo
        In file included from _cgo_export.c:4:
        cgo-gcc-export-header-prolog:43:35: warning: redeclaration of 'GoNop' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration]
        aprof.go:13:14: note: previous declaration is here
        cgo-gcc-export-header-prolog:44:35: warning: redeclaration of 'goBigStack1' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration]
        bigstack_windows.go:9:13: note: previous declaration is here
        go build runtime/testdata/testprogcgo: C compiler warning promoted to error on Go builders
        
--- FAIL: TestCgoExternalThreadPanic (0.00s)
    crash_test.go:54: building testprogcgo []: exit status 1
        # runtime/testdata/testprogcgo
        In file included from _cgo_export.c:4:
        cgo-gcc-export-header-prolog:43:35: warning: redeclaration of 'GoNop' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration]
        aprof.go:13:14: note: previous declaration is here
        cgo-gcc-export-header-prolog:44:35: warning: redeclaration of 'goBigStack1' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration]
        bigstack_windows.go:9:13: note: previous declaration is here
        go build runtime/testdata/testprogcgo: C compiler warning promoted to error on Go builders
        
--- FAIL: TestCgoTraceback (0.00s)
    crash_test.go:54: building testprogcgo []: exit status 1
        # runtime/testdata/testprogcgo
        In file included from _cgo_export.c:4:
        cgo-gcc-export-header-prolog:43:35: warning: redeclaration of 'GoNop' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration]
        aprof.go:13:14: note: previous declaration is here
        cgo-gcc-export-header-prolog:44:35: warning: redeclaration of 'goBigStack1' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration]
        bigstack_windows.go:9:13: note: previous declaration is here
        go build runtime/testdata/testprogcgo: C compiler warning promoted to error on Go builders
        
--- FAIL: TestCgoCCodeSIGPROF (32.70s)
    crash_test.go:54: building testprogcgo []: exit status 1
        # runtime/testdata/testprogcgo
        In file included from _cgo_export.c:4:
        cgo-gcc-export-header-prolog:43:35: warning: redeclaration of 'GoNop' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration]
        aprof.go:13:14: note: previous declaration is here
        cgo-gcc-export-header-prolog:44:35: warning: redeclaration of 'goBigStack1' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration]
        bigstack_windows.go:9:13: note: previous declaration is here
        go build runtime/testdata/testprogcgo: C compiler warning promoted to error on Go builders
        
--- FAIL: TestCgoCrashHandler (0.00s)
    crash_test.go:54: building testprogcgo []: exit status 1
        # runtime/testdata/testprogcgo
        In file included from _cgo_export.c:4:
        cgo-gcc-export-header-prolog:43:35: warning: redeclaration of 'GoNop' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration]
        aprof.go:13:14: note: previous declaration is here
        cgo-gcc-export-header-prolog:44:35: warning: redeclaration of 'goBigStack1' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration]
        bigstack_windows.go:9:13: note: previous declaration is here
        go build runtime/testdata/testprogcgo: C compiler warning promoted to error on Go builders
        
--- FAIL: TestCgoCheckBytes (0.00s)
    crash_cgo_test.go:188: building testprogcgo []: exit status 1
        # runtime/testdata/testprogcgo
        In file included from _cgo_export.c:4:
        cgo-gcc-export-header-prolog:43:35: warning: redeclaration of 'GoNop' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration]
        aprof.go:13:14: note: previous declaration is here
        cgo-gcc-export-header-prolog:44:35: warning: redeclaration of 'goBigStack1' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration]
        bigstack_windows.go:9:13: note: previous declaration is here
        go build runtime/testdata/testprogcgo: C compiler warning promoted to error on Go builders
        
--- FAIL: TestCgoPanicDeadlock (32.71s)
    crash_test.go:54: building testprogcgo []: exit status 1
        # runtime/testdata/testprogcgo
        In file included from _cgo_export.c:4:
        cgo-gcc-export-header-prolog:43:35: warning: redeclaration of 'GoNop' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration]
        aprof.go:13:14: note: previous declaration is here
        cgo-gcc-export-header-prolog:44:35: warning: redeclaration of 'goBigStack1' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration]
        bigstack_windows.go:9:13: note: previous declaration is here
        go build runtime/testdata/testprogcgo: C compiler warning promoted to error on Go builders
        
--- FAIL: TestBigStackCallbackCgo (1.83s)
    crash_test.go:54: building testprogcgo []: exit status 1
        # runtime/testdata/testprogcgo
        In file included from _cgo_export.c:4:
        cgo-gcc-export-header-prolog:43:35: warning: redeclaration of 'GoNop' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration]
        aprof.go:13:14: note: previous declaration is here
        cgo-gcc-export-header-prolog:44:35: warning: redeclaration of 'goBigStack1' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration]
        bigstack_windows.go:9:13: note: previous declaration is here
        go build runtime/testdata/testprogcgo: C compiler warning promoted to error on Go builders
        
FAIL
FAIL	runtime	155.001s
ok  	runtime/cgo	0.520s
ok  	runtime/debug	0.443s
ok  	runtime/internal/atomic	0.199s
ok  	runtime/internal/math	0.087s
ok  	runtime/internal/sys	0.159s
ok  	runtime/metrics	0.117s
ok  	runtime/pprof	31.837s
ok  	runtime/race	4.617s
ok  	runtime/trace	1.730s
ok  	sort	0.422s
ok  	strconv	0.796s
ok  	strings	5.062s
ok  	sync	1.575s
ok  	sync/atomic	7.560s
--- FAIL: TestStdioAreInheritable (0.08s)
    syscall_windows_test.go:110: failed to build go library: exit status 1
        -buildmode=c-shared not supported on windows/arm64
FAIL
FAIL	syscall	0.471s
ok  	testing	1.461s
ok  	testing/fstest	0.149s
ok  	testing/iotest	0.175s
ok  	testing/quick	0.375s
ok  	text/scanner	0.194s
ok  	text/tabwriter	0.176s
ok  	text/template	1.241s
ok  	text/template/parse	0.190s
ok  	time	3.857s
ok  	unicode	0.171s
ok  	unicode/utf16	0.111s
ok  	unicode/utf8	0.186s
ok  	cmd/addr2line	11.125s
ok  	cmd/api	102.325s
ok  	cmd/asm/internal/asm	4.293s
ok  	cmd/asm/internal/lex	0.142s
ok  	cmd/compile/internal/dwarfgen	2.636s
ok  	cmd/compile/internal/importer	13.266s
ok  	cmd/compile/internal/ir	0.102s
ok  	cmd/compile/internal/logopt	1.722s
ok  	cmd/compile/internal/noder	0.129s
ok  	cmd/compile/internal/ssa	1.987s
ok  	cmd/compile/internal/ssagen	0.286s
ok  	cmd/compile/internal/syntax	2.036s
ok  	cmd/compile/internal/test	72.368s
ok  	cmd/compile/internal/typecheck	3.206s
ok  	cmd/compile/internal/types	0.111s
ok  	cmd/compile/internal/types2	22.463s
ok  	cmd/cover	16.341s
ok  	cmd/doc	1.538s
ok  	cmd/fix	36.683s
--- FAIL: TestWindowsDefaultBuildmodIsPIE (0.00s)
    --- FAIL: TestWindowsDefaultBuildmodIsPIE/cgo (11.04s)
        go_test.go:2129: running testgo [build -o C:\Users\gopher\AppData\Local\Temp\cmd-go-test-552885582\gotest3063318790\main.exe C:\Users\gopher\AppData\Local\Temp\cmd-go-test-552885582\gotest3063318790\main.go]
        go_test.go:2188: .edata section is not present
go test proxy running at GOPROXY=http://127.0.0.1:51844/mod
--- FAIL: TestScript (0.02s)
    --- FAIL: TestScript/build_acl_windows (91.21s)
        script_test.go:252: 
            # Create $WORK\guest and give the Guests group full access.
            # Files created within that directory will have different security attributes by default. (0.097s)
            # Build a binary using the guest directory as an intermediate (1.828s)
            # Build the same binary, but write it to the guest directory. (1.779s)
            # Read ACLs for the files. (87.432s)
            > exec powershell -Command 'Get-Acl main.exe | Select -expand AccessToString'
            [stdout]
            NT AUTHORITY\SYSTEM Allow  FullControl
            BUILTIN\Administrators Allow  FullControl
            DESKTOP-0285N7P\gopher Allow  FullControl
            > cp stdout $WORK\exe-acl.txt
            > exec powershell -Command 'Get-Acl main.go | Select -expand AccessToString'
            [stdout]
            NT AUTHORITY\SYSTEM Allow  FullControl
            BUILTIN\Administrators Allow  FullControl
            DESKTOP-0285N7P\gopher Allow  FullControl
            > cp stdout $WORK\src-acl.txt
            > cd $TMP
            $WORK\guest
            > exec powershell -Command 'Get-Acl main.exe | Select -expand AccessToString'
            [context deadline exceeded]
            FAIL: testdata\script\build_acl_windows.txt:25: test timed out while running command
            
FAIL
FAIL	cmd/go	526.607s
ok  	cmd/go/internal/auth	0.175s
ok  	cmd/go/internal/cache	8.959s
ok  	cmd/go/internal/fsys	4.301s
ok  	cmd/go/internal/generate	0.426s
ok  	cmd/go/internal/get	0.665s
ok  	cmd/go/internal/imports	1.049s
ok  	cmd/go/internal/load	0.690s
ok  	cmd/go/internal/lockedfile	1.189s
ok  	cmd/go/internal/lockedfile/internal/filelock	0.216s
ok  	cmd/go/internal/modconv	1.008s
ok  	cmd/go/internal/modfetch	0.242s
ok  	cmd/go/internal/modfetch/codehost	0.150s
ok  	cmd/go/internal/modfetch/zip_sum_test	0.131s
ok  	cmd/go/internal/modload	0.128s
ok  	cmd/go/internal/mvs	0.085s
ok  	cmd/go/internal/par	0.117s
ok  	cmd/go/internal/search	0.088s
ok  	cmd/go/internal/str	0.087s
ok  	cmd/go/internal/test	1.321s
ok  	cmd/go/internal/txtar	0.083s
ok  	cmd/go/internal/vcs	0.213s
ok  	cmd/go/internal/web	0.174s
ok  	cmd/go/internal/work	1.420s
ok  	cmd/gofmt	4.110s
ok  	cmd/internal/archive	9.287s
ok  	cmd/internal/buildid	2.120s
ok  	cmd/internal/dwarf	0.285s
ok  	cmd/internal/edit	0.123s
ok  	cmd/internal/goobj	0.112s
ok  	cmd/internal/moddeps	18.951s
ok  	cmd/internal/obj	0.956s
ok  	cmd/internal/obj/arm64	1.784s
ok  	cmd/internal/obj/ppc64	1.784s
ok  	cmd/internal/obj/riscv	1.805s
ok  	cmd/internal/obj/s390x	0.135s
ok  	cmd/internal/obj/x86	17.875s
ok  	cmd/internal/objabi	0.680s
ok  	cmd/internal/pkgpath	1.088s
ok  	cmd/internal/src	0.211s
ok  	cmd/internal/sys	0.268s
ok  	cmd/internal/test2json	3.312s
--- FAIL: TestDWARF (0.00s)
    --- FAIL: TestDWARF/testprogcgo (47.47s)
        dwarf_test.go:94: go build -o C:\Users\gopher\AppData\Local\Temp\TestDWARF_testprogcgo758230041\001\testprogcgo.exe ../../runtime/testdata/testprogcgo: exit status 1
            # runtime/testdata/testprogcgo
            In file included from _cgo_export.c:4:
            cgo-gcc-export-header-prolog:43:35: warning: redeclaration of 'GoNop' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration]
            aprof.go:13:14: note: previous declaration is here
            cgo-gcc-export-header-prolog:44:35: warning: redeclaration of 'goBigStack1' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration]
            bigstack_windows.go:9:13: note: previous declaration is here
            go build runtime/testdata/testprogcgo: C compiler warning promoted to error on Go builders
FAIL
FAIL	cmd/link	112.189s
ok  	cmd/link/internal/benchmark	0.481s
ok  	cmd/link/internal/ld	76.789s
ok  	cmd/link/internal/loader	0.617s
ok  	cmd/nm	41.841s
ok  	cmd/objdump	46.734s
ok  	cmd/pack	31.040s
ok  	cmd/trace	6.884s
ok  	cmd/vet	48.371s
FAIL
go tool dist: Failed: exit status 1
2021/06/10 14:06:47 remote failure running src/all.bat: exit status 1
2021/06/10 14:06:47 done.
exit status 1

@zx2c4
Copy link
Contributor

zx2c4 commented Jun 11, 2021

I've got a fix for that in https://go-review.googlesource.com/c/go/+/326310/

But I'm now battling the next clang-related issue, where apparently it wants a microsoft-style import library, rather than a straight up .dll pretending to be a .a like gcc takes.

@gopherbot
Copy link

Change https://golang.org/cl/327209 mentions this issue: cmd/go: pass -Wno-dll-attribute-on-redeclaration to clang

@gopherbot
Copy link

Change https://golang.org/cl/327211 mentions this issue: cmd/go, misc/cgo: account for LLD differences on Windows

@gopherbot
Copy link

Change https://golang.org/cl/327309 mentions this issue: runtime: testprogcgo: don't call exported Go functions directly from Go

@dmitshur dmitshur added NeedsFix The path to resolution is known, but the work has not been done. and removed NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels Jun 12, 2021
gopherbot pushed a commit that referenced this issue Jun 13, 2021
LLD won't import a .dll directly and instead requires an import library.
So generate these using -out-implib, the same way as was done in CL
312046, where it makes sense, and elsewhere build the import library
using a def file. We can't use -out-implib all the time, because the
output file gets overwritten each time the linker is called, rather than
merged.

Updates #46502.

Change-Id: Iefe54cb6c576004b83b1039ba673881b8640423d
Reviewed-on: https://go-review.googlesource.com/c/go/+/327211
Trust: Jason A. Donenfeld <Jason@zx2c4.com>
Run-TryBot: Jason A. Donenfeld <Jason@zx2c4.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
gopherbot pushed a commit that referenced this issue Jun 14, 2021
The platform supports c-shared now, so flip this on. I've given this a
small smoke test using [1], and it was able to pass packets and
generally function well. Since [1] uses quite a bit of Go functionality
under the hood, I think it's a decent test that a lot of things that
should be working are working. So this commit enables it.

[1] https://git.zx2c4.com/wireguard-windows/about/embeddable-dll-service/README.md

Updates #46502.

Change-Id: I5c771d033bd20e5ce472c315d7c207bbc1020b4a
Reviewed-on: https://go-review.googlesource.com/c/go/+/326310
Trust: Jason A. Donenfeld <Jason@zx2c4.com>
Trust: Alex Brainman <alex.brainman@gmail.com>
Run-TryBot: Jason A. Donenfeld <Jason@zx2c4.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
@gopherbot
Copy link

Change https://golang.org/cl/331670 mentions this issue: dashboard,cmd/release: replace windows-arm64-aws with windows-arm64-10

gopherbot pushed a commit to golang/build that referenced this issue Jun 30, 2021
This change removes the windows-arm64-aws buildlet and replaces all
usages with the windows-arm64-10 buildlet.

- Remove the known issue from the windows-arm64-10 buildlet, which has
been passing reliably.
- Enable tests during releases, and add a slowbot alias, as it's a much
faster buildlet.

Updates golang/go#46502
For golang/go#42604

Change-Id: Ib9f7c3d5391b01e303b43bbdad030b3f94147c5d
Reviewed-on: https://go-review.googlesource.com/c/build/+/331670
Trust: Alexander Rakoczy <alex@golang.org>
Run-TryBot: Alexander Rakoczy <alex@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Carlos Amedee <carlos@golang.org>
@gopherbot
Copy link

Change https://golang.org/cl/345129 mentions this issue: cmd/release: start running release tests for windows-arm64

gopherbot pushed a commit to golang/build that referenced this issue Aug 25, 2021
By now, all outstanding issues preventing release tests for
windows-arm64 from being turned on by default are resolved:

- Issues golang/go#46406 and golang/go#46502 are fixed.
- The other remaining blocker golang/go#47017 is determined to be a
  builder-specific issue (not reproducible on physical Windows ARM64
  hardware) that by now happens infrequently enough that automated
  retries should be able to cover for future occurrences.
  Issue golang/go#47965 is opened to track progress on this.
- The builder performance is good and allows release tests to complete
  quickly, not adding any bottlenecks to the release process.

If something changes, we can revisit this, but information available
so far suggests it's a good time to start running release tests for
windows/arm64 by default.

Fixes golang/go#47017.
Updates golang/go#47965.

Change-Id: Ie96164821a2f8e795a22ac2d36b7292587a3e117
Reviewed-on: https://go-review.googlesource.com/c/build/+/345129
Reviewed-by: Alexander Rakoczy <alex@golang.org>
Trust: Dmitri Shuralyov <dmitshur@golang.org>
@golang golang locked and limited conversation to collaborators Aug 25, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
arch-arm64 FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done. OS-Windows
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants