Details
-
Bug
-
Resolution: Fixed
-
Major
-
6.5.0
-
Untriaged
-
Unknown
Description
When attempting to compile ns_generate_cert with ThreadSanitizer enabled and after the recent change to correctly pass TSan flags to CGO code (http://review.couchbase.org/#/c/113422/), compilation fails with the following error:
Building Go target ns_generate_cert using Go 1.8.5
|
-- CGO_CFLAGS=' -fsanitize=thread'
|
-- Executing: /home/couchbase/.cbdepscache/exploded/x86_64/go-1.8.5/go/bin/go install -pkgdir /home/couchbase/jenkins/workspace/kv_engine-master-post-commit-TSan/build/gopkg/go-1.8.5 -tags="" -buildmode="default" -gcflags="-trimpath=/home/couchbase/jenkins/workspace/kv_engine-master-post-commit-TSan" -asmflags="-trimpath=/home/couchbase/jenkins/workspace/kv_engine-master-post-commit-TSan" -ldflags="" generate_cert
|
# generate_cert
|
.debug_pubnames: missing DWARF section for relocation target go.info.runtime.writeBarrier
|
panic: runtime error: invalid memory address or nil pointer dereference
|
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x5294ee]
|
|
goroutine 1 [running]:
|
cmd/link/internal/ld.relocsym(0xc4204be000, 0xc422c6c4a0)
|
/usr/local/go/src/cmd/link/internal/ld/data.go:607 +0x26ae
|
cmd/link/internal/ld.(*Link).reloc(0xc4204be000)
|
/usr/local/go/src/cmd/link/internal/ld/data.go:757 +0x128
|
cmd/link/internal/ld.Main()
|
/usr/local/go/src/cmd/link/internal/ld/main.go:207 +0x949
|
main.main()
|
/usr/local/go/src/cmd/link/main.go:58 +0xdb
|
(Log file of the build environment: http://cv.jenkins.couchbase.com/job/kv_engine-master-post-commit-TSan/136/console)
Searching for similar bugs I see a similar error message in https://github.com/golang/go/issues/21566, which suggests this is a problem in Golang toolchain. This issue is marked as 'fixed' by https://go-review.googlesource.com/c/go/+/58630/ which first appears in go 1.10.