Start with -race results in segmentation violation #1774
Open
Description
Describe the bug
We wanted to upgrade from v3 to v4 and run into the following issue (no other changes has been made and rollbacking the version fix the error)
To Reproduce
The binary is not starting at all kills itself before.
CGO_ENABLED=0 go run -race cmd/router/main.go
SIGSEGV: segmentation violation
PC=0x10417823c m=0 sigcode=2 addr=0x10
signal arrived during cgo execution
goroutine 1 gp=0xc0000021c0 m=0 mp=0x1079539a0 [syscall, locked to thread]:
runtime.cgocall(0x104e0efc0, 0x0)
/usr/local/go/src/runtime/cgocall.go:167 +0x58 fp=0xc00009df40 sp=0xc00009df00 pc=0x1042291c8
runtime.main()
/usr/local/go/src/runtime/proc.go:243 +0x210 fp=0xc00009dfd0 sp=0xc00009df40 pc=0x1041f5f40
runtime.goexit({})
/usr/local/go/src/runtime/asm_arm64.s:1223 +0x4 fp=0xc00009dfd0 sp=0xc00009dfd0 pc=0x104238ea4
goroutine 2 gp=0xc000002c40 m=nil [force gc (idle)]:
runtime.gopark(0x0?, 0x1077f52e0?, 0xa0?, 0x39?, 0x0?)
/usr/local/go/src/runtime/proc.go:424 +0xc8 fp=0xc000088790 sp=0xc000088770 pc=0x10422fe68
runtime.goparkunlock(...)
/usr/local/go/src/runtime/proc.go:430
runtime.forcegchelper()
/usr/local/go/src/runtime/proc.go:337 +0xb8 fp=0xc0000887d0 sp=0xc000088790 pc=0x1041f6328
runtime.goexit({})
/usr/local/go/src/runtime/asm_arm64.s:1223 +0x4 fp=0xc0000887d0 sp=0xc0000887d0 pc=0x104238ea4
created by runtime.init.7 in goroutine 1
/usr/local/go/src/runtime/proc.go:325 +0x24
goroutine 3 gp=0xc000003180 m=nil [GC sweep wait]:
runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
/usr/local/go/src/runtime/proc.go:424 +0xc8 fp=0xc000098f60 sp=0xc000098f40 pc=0x10422fe68
runtime.goparkunlock(...)
/usr/local/go/src/runtime/proc.go:430
runtime.bgsweep(0xc0000b4000)
/usr/local/go/src/runtime/mgcsweep.go:277 +0xa0 fp=0xc000098fb0 sp=0xc000098f60 pc=0x1041de0b0
runtime.gcenable.gowrap1()
/usr/local/go/src/runtime/mgc.go:204 +0x28 fp=0xc000098fd0 sp=0xc000098fb0 pc=0x1041d1f38
runtime.goexit({})
/usr/local/go/src/runtime/asm_arm64.s:1223 +0x4 fp=0xc000098fd0 sp=0xc000098fd0 pc=0x104238ea4
created by runtime.gcenable in goroutine 1
/usr/local/go/src/runtime/mgc.go:204 +0x6c
goroutine 4 gp=0xc000003340 m=nil [GC scavenge wait]:
runtime.gopark(0xc0000b4000?, 0x1064f3048?, 0x1?, 0x0?, 0xc000003340?)
/usr/local/go/src/runtime/proc.go:424 +0xc8 fp=0xc000194f60 sp=0xc000194f40 pc=0x10422fe68
runtime.goparkunlock(...)
/usr/local/go/src/runtime/proc.go:430
runtime.(*scavengerState).park(0x1079523c0)
/usr/local/go/src/runtime/mgcscavenge.go:425 +0x5c fp=0xc000194f90 sp=0xc000194f60 pc=0x1041dbaac
runtime.bgscavenge(0xc0000b4000)
/usr/local/go/src/runtime/mgcscavenge.go:653 +0x44 fp=0xc000194fb0 sp=0xc000194f90 pc=0x1041dbff4
runtime.gcenable.gowrap2()
/usr/local/go/src/runtime/mgc.go:205 +0x28 fp=0xc000194fd0 sp=0xc000194fb0 pc=0x1041d1ed8
runtime.goexit({})
/usr/local/go/src/runtime/asm_arm64.s:1223 +0x4 fp=0xc000194fd0 sp=0xc000194fd0 pc=0x104238ea4
created by runtime.gcenable in goroutine 1
/usr/local/go/src/runtime/mgc.go:205 +0xac
r0 0x0
r1 0x104e0efd0
r2 0xc00009def0
r3 0x107952d00
r4 0x110
r5 0xc00009d000
r6 0x1
r7 0x0
r8 0x1079539a0
r9 0x10417822c
r10 0x1079539a0
r11 0x107952d00
r12 0x1000000000000000
r13 0x16bc8afb0
r14 0xffffff0000000000
r15 0x7fb
r16 0xc00009d6c0
r17 0x1f555acc0
r18 0x0
r19 0x104e0efd0
r20 0x0
r21 0x16bc8af90
r22 0x107987484
r23 0x16bc8b118
r24 0x1832c2000
r25 0x0
r26 0x1069763c8
r27 0x107987000
r28 0x107952d00
r29 0x16bc8af28
lr 0x104239ca8
sp 0x16bc8af00
pc 0x10417823c
fault 0x10
exit status 2
Expected behavior
[A clear and concise description of what you expected to happen.]
Environment (please complete the following information):
- Windows: [paste the result of
ver
] - Linux: [paste contents of
/etc/os-release
and the result ofuname -a
] - Mac OS: [paste the result of
sw_vers
anduname -a
- FreeBSD: [paste the result of
freebsd-version -k -r -u
anduname -a
] - OpenBSD: [paste the result of
uname -a
]
ProductName: macOS
ProductVersion: 15.2
BuildVersion: 24C101
Darwin dustin 24.2.0 Darwin Kernel Version 24.2.0: Fri Dec 6 19:02:12 PST 2024; root:xnu-11215.61.5~2/RELEASE_ARM64_T6031 arm64
Additional context
[Cross-compiling? Paste the command you are using to cross-compile and the result of the corresponding go env
]
Metadata
Assignees
Labels
No labels