Skip to content

gccgo: bootstrap with gccgo fails #47771

@stevenpackardblp

Description

@stevenpackardblp

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

Compiling 1.17 release source code using GCC 9.3 gccgo.

Does this issue reproduce with the latest release?

Yes.

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

linux amd64

What did you do?

Attempting to build the 1.17 release using GCC 9.3 gccgo fails with:

cd src && \
    GOOS=linux GOARCH=amd64 \
    GOROOT=/tmp/go-1.17 \
    GOROOT_FINAL=/opt/lib/go-1.17 \
    GOROOT_BOOTSTRAP=/opt/lib/go \
    GCCGO=gccgo \
    ./make.bash
Building Go cmd/dist using /opt/lib/go. (go1.12.2 gccgo (9.3.0-2+b20210731T06443745) 9.3.0 linux/amd64)
Building Go toolchain1 using /opt/lib/go.
Building Go bootstrap cmd/go (go_bootstrap) using Go toolchain1.
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=1 addr=0 pc=6238351]

goroutine 1 [running]:
types.fieldsHasTParam
	/tmp/go-1.17/src/cmd/compile/internal/types/type.go:1734
bootstrap..z2fcmd..z2fcompile..z2finternal..z2ftypes.NewSignature
	/tmp/go-1.17/src/cmd/compile/internal/types/type.go:1816
typecheck.tcFuncType
	/tmp/go-1.17/src/cmd/compile/internal/typecheck/type.go:91
typecheck.typecheck1
	/tmp/go-1.17/src/cmd/compile/internal/typecheck/typecheck.go:572
typecheck.typecheck
	/tmp/go-1.17/src/cmd/compile/internal/typecheck/typecheck.go:373
typecheck.typecheckNtype
	/tmp/go-1.17/src/cmd/compile/internal/typecheck/typecheck.go:269
typecheck.typecheckdef
	/tmp/go-1.17/src/cmd/compile/internal/typecheck/typecheck.go:1870
typecheck.typecheck1
	/tmp/go-1.17/src/cmd/compile/internal/typecheck/typecheck.go:480
typecheck.typecheck
	/tmp/go-1.17/src/cmd/compile/internal/typecheck/typecheck.go:373
bootstrap..z2fcmd..z2fcompile..z2finternal..z2ftypecheck.AssignExpr
	/tmp/go-1.17/src/cmd/compile/internal/typecheck/typecheck.go:31
typecheck.tcFunc
	/tmp/go-1.17/src/cmd/compile/internal/typecheck/func.go:374
typecheck.typecheck1
	/tmp/go-1.17/src/cmd/compile/internal/typecheck/typecheck.go:903
typecheck.typecheck
	/tmp/go-1.17/src/cmd/compile/internal/typecheck/typecheck.go:373
bootstrap..z2fcmd..z2fcompile..z2finternal..z2ftypecheck.Stmt
	/tmp/go-1.17/src/cmd/compile/internal/typecheck/typecheck.go:33
bootstrap..z2fcmd..z2fcompile..z2finternal..z2fnoder.LoadPackage
	/tmp/go-1.17/src/cmd/compile/internal/noder/noder.go:118
bootstrap..z2fcmd..z2fcompile..z2finternal..z2fgc.Main
	/tmp/go-1.17/src/cmd/compile/internal/gc/main.go:192
main.main
	/tmp/go-1.17/src/cmd/compile/main.go:55

go tool dist: FAILED: /tmp/go-1.17/pkg/tool/linux_amd64/compile -std -pack -o /tmp/go-tool-dist-828520844/runtime/internal/sys/_go_.a -p runtime/internal/sys -importcfg /tmp/go-tool-dist-828520844/runtime/internal/sys/importcfg /tmp/go-1.17/src/runtime/internal/sys/arch.go /tmp/go-1.17/src/runtime/internal/sys/arch_amd64.go /tmp/go-1.17/src/runtime/internal/sys/intrinsics.go /tmp/go-1.17/src/runtime/internal/sys/intrinsics_common.go /tmp/go-1.17/src/runtime/internal/sys/sys.go /tmp/go-1.17/src/runtime/internal/sys/zgoarch_amd64.go /tmp/go-1.17/src/runtime/internal/sys/zgoos_linux.go /tmp/go-1.17/src/runtime/internal/sys/zversion.go: exit status 2
go tool dist: open /tmp/go-tool-dist-828520844/internal/goexperiment/_go_.a: no such file or directory
go tool dist: open /tmp/go-tool-dist-828520844/runtime/internal/sys/_go_.a: no such file or directory
go tool dist: open /tmp/go-tool-dist-828520844/internal/cpu/_go_.a: no such file or directory
go tool dist: open /tmp/go-tool-dist-828520844/runtime/internal/atomic/_go_.a: no such file or directory
go tool dist: open /tmp/go-tool-dist-828520844/internal/abi/_go_.a: no such file or directory
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=1 addr=0 pc=6238351]

goroutine 1 [running]:
types.fieldsHasTParam
	/tmp/go-1.17/src/cmd/compile/internal/types/type.go:1734
bootstrap..z2fcmd..z2fcompile..z2finternal..z2ftypes.NewSignature
	/tmp/go-1.17/src/cmd/compile/internal/types/type.go:1816
typecheck.newSig
	/tmp/go-1.17/src/cmd/compile/internal/typecheck/builtin.go:215
typecheck.runtimeTypes
	/tmp/go-1.17/src/cmd/compile/internal/typecheck/builtin.go:232
bootstrap..z2fcmd..z2fcompile..z2finternal..z2ftypecheck.InitRuntime
	/tmp/go-1.17/src/cmd/compile/internal/typecheck/syms.go:72
bootstrap..z2fcmd..z2fcompile..z2finternal..z2fgc.Main
	/tmp/go-1.17/src/cmd/compile/internal/gc/main.go:266
main.main
	/tmp/go-1.17/src/cmd/compile/main.go:55

go tool dist: FAILED: /tmp/go-1.17/pkg/tool/linux_amd64/compile -std -pack -o /tmp/go-tool-dist-828520844/internal/goexperiment/_go_.a -p internal/goexperiment -importcfg /tmp/go-tool-dist-828520844/internal/goexperiment/importcfg /tmp/go-1.17/src/internal/goexperiment/exp_fieldtrack_off.go /tmp/go-1.17/src/internal/goexperiment/exp_preemptibleloops_off.go /tmp/go-1.17/src/internal/goexperiment/exp_regabi_off.go /tmp/go-1.17/src/internal/goexperiment/exp_regabiargs_off.go /tmp/go-1.17/src/internal/goexperiment/exp_regabidefer_off.go /tmp/go-1.17/src/internal/goexperiment/exp_regabig_off.go /tmp/go-1.17/src/internal/goexperiment/exp_regabireflect_off.go /tmp/go-1.17/src/internal/goexperiment/exp_regabiwrappers_off.go /tmp/go-1.17/src/internal/goexperiment/exp_staticlockranking_off.go /tmp/go-1.17/src/internal/goexperiment/flags.go: exit status 2
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=1 addr=0 pc=6238351]

goroutine 1 [running]:
types.fieldsHasTParam
	/tmp/go-1.17/src/cmd/compile/internal/types/type.go:1734
bootstrap..z2fcmd..z2fcompile..z2finternal..z2ftypes.NewSignature
	/tmp/go-1.17/src/cmd/compile/internal/types/type.go:1816
typecheck.tcFuncType
	/tmp/go-1.17/src/cmd/compile/internal/typecheck/type.go:91
typecheck.typecheck1
	/tmp/go-1.17/src/cmd/compile/internal/typecheck/typecheck.go:572
typecheck.typecheck
	/tmp/go-1.17/src/cmd/compile/internal/typecheck/typecheck.go:373
typecheck.typecheckNtype
	/tmp/go-1.17/src/cmd/compile/internal/typecheck/typecheck.go:269
typecheck.typecheckdef
	/tmp/go-1.17/src/cmd/compile/internal/typecheck/typecheck.go:1870
typecheck.typecheck1
	/tmp/go-1.17/src/cmd/compile/internal/typecheck/typecheck.go:480
typecheck.typecheck
	/tmp/go-1.17/src/cmd/compile/internal/typecheck/typecheck.go:373
bootstrap..z2fcmd..z2fcompile..z2finternal..z2ftypecheck.AssignExpr
	/tmp/go-1.17/src/cmd/compile/internal/typecheck/typecheck.go:31
typecheck.tcFunc
	/tmp/go-1.17/src/cmd/compile/internal/typecheck/func.go:374
typecheck.typecheck1
	/tmp/go-1.17/src/cmd/compile/internal/typecheck/typecheck.go:903
typecheck.typecheck
	/tmp/go-1.17/src/cmd/compile/internal/typecheck/typecheck.go:373
bootstrap..z2fcmd..z2fcompile..z2finternal..z2ftypecheck.Stmt
	/tmp/go-1.17/src/cmd/compile/internal/typecheck/typecheck.go:33
bootstrap..z2fcmd..z2fcompile..z2finternal..z2fnoder.LoadPackage
	/tmp/go-1.17/src/cmd/compile/internal/noder/noder.go:118
bootstrap..z2fcmd..z2fcompile..z2finternal..z2fgc.Main
	/tmp/go-1.17/src/cmd/compile/internal/gc/main.go:192
main.main
	/tmp/go-1.17/src/cmd/compile/main.go:55

go tool dist: FAILED: /tmp/go-1.17/pkg/tool/linux_amd64/compile -std -pack -o /tmp/go-tool-dist-828520844/internal/cpu/_go_.a -p internal/cpu -importcfg /tmp/go-tool-dist-828520844/internal/cpu/importcfg -asmhdr /tmp/go-tool-dist-828520844/internal/cpu/go_asm.h -symabis /tmp/go-tool-dist-828520844/internal/cpu/symabis /tmp/go-1.17/src/internal/cpu/cpu.go /tmp/go-1.17/src/internal/cpu/cpu_amd64.go /tmp/go-1.17/src/internal/cpu/cpu_x86.go: exit status 2
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=1 addr=0 pc=6238351]

goroutine 1 [running]:
types.fieldsHasTParam
	/tmp/go-1.17/src/cmd/compile/internal/types/type.go:1734
bootstrap..z2fcmd..z2fcompile..z2finternal..z2ftypes.NewSignature
	/tmp/go-1.17/src/cmd/compile/internal/types/type.go:1816
typecheck.tcFuncType
	/tmp/go-1.17/src/cmd/compile/internal/typecheck/type.go:91
typecheck.typecheck1
	/tmp/go-1.17/src/cmd/compile/internal/typecheck/typecheck.go:572
typecheck.typecheck
	/tmp/go-1.17/src/cmd/compile/internal/typecheck/typecheck.go:373
typecheck.typecheckNtype
	/tmp/go-1.17/src/cmd/compile/internal/typecheck/typecheck.go:269
typecheck.typecheckdef
	/tmp/go-1.17/src/cmd/compile/internal/typecheck/typecheck.go:1870
typecheck.typecheck1
	/tmp/go-1.17/src/cmd/compile/internal/typecheck/typecheck.go:480
typecheck.typecheck
	/tmp/go-1.17/src/cmd/compile/internal/typecheck/typecheck.go:373
bootstrap..z2fcmd..z2fcompile..z2finternal..z2ftypecheck.AssignExpr
	/tmp/go-1.17/src/cmd/compile/internal/typecheck/typecheck.go:31
typecheck.tcFunc
	/tmp/go-1.17/src/cmd/compile/internal/typecheck/func.go:374
typecheck.typecheck1
	/tmp/go-1.17/src/cmd/compile/internal/typecheck/typecheck.go:903
typecheck.typecheck
	/tmp/go-1.17/src/cmd/compile/internal/typecheck/typecheck.go:373
bootstrap..z2fcmd..z2fcompile..z2finternal..z2ftypecheck.Stmt
	/tmp/go-1.17/src/cmd/compile/internal/typecheck/typecheck.go:33
bootstrap..z2fcmd..z2fcompile..z2finternal..z2fnoder.LoadPackage
	/tmp/go-1.17/src/cmd/compile/internal/noder/noder.go:118
bootstrap..z2fcmd..z2fcompile..z2finternal..z2fgc.Main
	/tmp/go-1.17/src/cmd/compile/internal/gc/main.go:192
main.main
	/tmp/go-1.17/src/cmd/compile/main.go:55

go tool dist: FAILED: /tmp/go-1.17/pkg/tool/linux_amd64/compile -std -pack -o /tmp/go-tool-dist-828520844/internal/abi/_go_.a -p internal/abi -importcfg /tmp/go-tool-dist-828520844/internal/abi/importcfg /tmp/go-1.17/src/internal/abi/abi.go /tmp/go-1.17/src/internal/abi/abi_generic.go: exit status 2

What did you expect to see?

Successful build.

What did you see instead?

Failed build due to segmentation faults.

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions