-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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
go1.22.8 runtime error: SIGSEGV: segmentation violation #70194
Comments
If I downgrade golang version from 1.22.8 to 1.21.13, it can run smoothly without crash. |
Can you use |
I used -race to recompile and published to production and find some potential data race issues. Then I fixed those potential data race issues and republish to production environment. Then the crash disappeared. |
The race detector has some runtime overhead, so it cannot be enabled by default. And when data race occurs, this can corrupt arbitrary memory data, so errors can occur elsewhere. Do you have any suggestions to improve this error message? |
If data race happens on a map, when program crashes, it generates error like: concurrent map read and map write. This gives programmer a direction to find the reason. |
Map operations are on the order of 100 cycles. Adding an instruction or two to detect races is feasible in that situation. (There's also memory available in the map case which isn't available in the slice case.) |
I get occasional segfaults from The stack traces are identical apart from address space layout randomization.
|
Go version
go version go1.22.8 linux/amd64
Output of
go env
in your module/workspace:What did you do?
I just upgrade golang from 1.21.13 to 1.22.8 and publish my project to production environment.
What did you see happen?
After running for a while, the program crashes, and I see ouput:
SIGSEGV: segmentation violation
PC=0x41b77b m=4 sigcode=128 addr=0x0
goroutine 0 gp=0xc0000076c0 m=4 mp=0xc000073808 [idle]:
runtime.readUintptr(...)
/usr/local/go/src/runtime/mbitmap.go:466
runtime.(*mspan).typePointersOfUnchecked(0xc0250f9b00?, 0xc0041d9890?)
/usr/local/go/src/runtime/mbitmap_allocheaders.go:203 +0x3b fp=0x7ffac22ddd28 sp=0x7ffac22ddd08 pc=0x41b77b
runtime.scanobject(0xc000073808?, 0xc00005fc68)
/usr/local/go/src/runtime/mgcmark.go:1446 +0xb5 fp=0x7ffac22dddb8 sp=0x7ffac22ddd28 pc=0x427115
runtime.gcDrain(0xc00005fc68, 0x7)
/usr/local/go/src/runtime/mgcmark.go:1242 +0x1f4 fp=0x7ffac22dde20 sp=0x7ffac22dddb8 pc=0x426a74
runtime.gcDrainMarkWorkerIdle(...)
/usr/local/go/src/runtime/mgcmark.go:1114
runtime.gcBgMarkWorker.func2()
/usr/local/go/src/runtime/mgc.go:1406 +0x6f fp=0x7ffac22dde70 sp=0x7ffac22dde20 pc=0x4230af
runtime.systemstack(0x800000)
/usr/local/go/src/runtime/asm_amd64.s:509 +0x4a fp=0x7ffac22dde80 sp=0x7ffac22dde70 pc=0x4788ea
goroutine 34 gp=0xc000502000 m=4 mp=0xc000073808 [GC worker (active)]:
runtime.systemstack_switch()
/usr/local/go/src/runtime/asm_amd64.s:474 +0x8 fp=0xc000508750 sp=0xc000508740 pc=0x478888
runtime.gcBgMarkWorker()
/usr/local/go/src/runtime/mgc.go:1370 +0x1f2 fp=0xc0005087e0 sp=0xc000508750 pc=0x422d72
runtime.goexit({})
/usr/local/go/src/runtime/asm_amd64.s:1695 +0x1 fp=0xc0005087e8 sp=0xc0005087e0 pc=0x47a8a1
created by runtime.gcBgMarkStartWorkers in goroutine 1
/usr/local/go/src/runtime/mgc.go:1234 +0x1c
goroutine 319 gp=0xc00099fc00 m=8 mp=0xc00050e008 [syscall, 92 minutes]:
runtime.notetsleepg(0x2c5e780, 0xffffffffffffffff)
/usr/local/go/src/runtime/lock_futex.go:246 +0x29 fp=0xc000e24fa0 sp=0xc000e24f78 pc=0x412549
os/signal.signal_recv()
/usr/local/go/src/runtime/sigqueue.go:152 +0x29 fp=0xc000e24fc0 sp=0xc000e24fa0 pc=0x476ca9
os/signal.loop()
/usr/local/go/src/os/signal/signal_unix.go:23 +0x13 fp=0xc000e24fe0 sp=0xc000e24fc0 pc=0x11d2e93
runtime.goexit({})
/usr/local/go/src/runtime/asm_amd64.s:1695 +0x1 fp=0xc000e24fe8 sp=0xc000e24fe0 pc=0x47a8a1
created by os/signal.Notify.func1.1 in goroutine 1
/usr/local/go/src/os/signal/signal.go:151 +0x1f
goroutine 1 gp=0xc0000061c0 m=nil [select]:
runtime.gopark(0xc00078cea0?, 0x5?, 0x38?, 0xc5?, 0xc00078ccf2?)
/usr/local/go/src/runtime/proc.go:402 +0xce fp=0xc00078cb90 sp=0xc00078cb70 pc=0x4426ce
runtime.selectgo(0xc00078cea0, 0xc00078cce8, 0xc033dbcdf0?, 0x0, 0x5?, 0x1)
/usr/local/go/src/runtime/select.go:327 +0x725 fp=0xc00078ccb0 sp=0xc00078cb90 pc=0x454545
main.main()
/opt/gitlab.thinkplay.co/tp3/server/gate/main.go:160 +0x1865 fp=0xc00078cf50 sp=0xc00078ccb0 pc=0x13f5125
runtime.main()
/usr/local/go/src/runtime/proc.go:271 +0x29d fp=0xc00078cfe0 sp=0xc00078cf50 pc=0x44227d
runtime.goexit({})
/usr/local/go/src/runtime/asm_amd64.s:1695 +0x1 fp=0xc00078cfe8 sp=0xc00078cfe0 pc=0x47a8a1
goroutine 2 gp=0xc000006c40 m=nil [force gc (idle), 92 minutes]:
runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
/usr/local/go/src/runtime/proc.go:402 +0xce fp=0xc00006cfa8 sp=0xc00006cf88 pc=0x4426ce
runtime.goparkunlock(...)
/usr/local/go/src/runtime/proc.go:408
runtime.forcegchelper()
/usr/local/go/src/runtime/proc.go:326 +0xb3 fp=0xc00006cfe0 sp=0xc00006cfa8 pc=0x442533
runtime.goexit({})
/usr/local/go/src/runtime/asm_amd64.s:1695 +0x1 fp=0xc00006cfe8 sp=0xc00006cfe0 pc=0x47a8a1
created by runtime.init.6 in goroutine 1
/usr/local/go/src/runtime/proc.go:314 +0x1a
There are many more goroutine stack information with m=nil and status idle or sleep.
rax 0x7ffaa8e93f28
rbx 0xc0250f9b08
rcx 0xc0250f9b00
rdx 0xc041cbec78
rdi 0x56
rsi 0x34323033315f7265
rbp 0x7ffac22ddd18
rsp 0x7ffac22ddd08
r8 0xc000502000
r9 0xc00005ea08
r10 0xc033cb0800
r11 0x37
r12 0x7ffac22ddda8
r13 0x1
r14 0xc0000076c0
r15 0x3
rip 0x41b77b
rflags 0x10202
cs 0x33
fs 0x0
gs 0x0
What did you expect to see?
I expect the program run smoothly.
The text was updated successfully, but these errors were encountered: