Closed
Description
What version of Go are you using (go version
)?
$ go version go version go1.13.3 linux/arm64
we applied some patch to go1.13.3:
2019-08-06 02:42 b25ec50b69 syscall: implement rawVforkSyscall for linux/arm64
2019-09-11 02:26 904f046e2b runtime: fix crash during VDSO calls on arm
2019-10-23 11:42 758eb020f7 runtime: save/fetch g register during VDSO on ARM and ARM64
2019-10-31 10:32 f07cbc7f88 runtime: don't fetch G from signal stack when using cgo
2019-11-10 13:18 75c839af22 runtime: don't save G during VDSO if we're handling signal
2019-10-28 09:29 0ae9389609 runtime: fix textOff for multiple text sections
tested using go1.11.2 and go1.13.3, crash occurs on both golang version.
Does this issue reproduce with the latest release?
not tested, the go1.13.5 shall reproducible. I'll try master branch soon.
What operating system and processor architecture are you using (go env
)?
go env
Output
$ go env GO111MODULE="" GOARCH="arm64" GOBIN="" GOCACHE="/root/.cache/go-build" GOENV="/root/.config/go/env" GOEXE="" GOFLAGS="" GOHOSTARCH="arm64" GOHOSTOS="linux" GONOPROXY="" GONOSUMDB="" GOOS="linux" GOPATH="/root/go" GOPRIVATE="" GOPROXY="https://proxy.golang.org,direct" GOROOT="/usr/lib/golang" GOSUMDB="sum.golang.org" GOTMPDIR="" GOTOOLDIR="/usr/lib/golang/pkg/tool/linux_arm64" GCCGO="gccgo" AR="ar" CC="gcc" CXX="g++" CGO_ENABLED="1" GOMOD="" CGO_CFLAGS="-g -O2" CGO_CPPFLAGS="" CGO_CXXFLAGS="-g -O2" CGO_FFLAGS="-g -O2" CGO_LDFLAGS="-g -O2" PKG_CONFIG="pkg-config" GOGCCFLAGS="-fPIC -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build956154425=/tmp/go-build -gno-record-gcc-switches"
What did you do?
- build and install docker-engine(we use docker-ce 18.09) using go1.13.3 on arm64 environment. linux kernel 4.19.36. We can reproduce using physical machine, but not easy on virtual machines.
- run container using follow command, then wait a long time.
#!/bin/bash
for ((i=0;i<100;i++)); do
docker run -tid --name=jj-$i --health-interval 1s --health-cmd date ubuntu-arm64 bash
done
we get 2 core files core_containerd-shim_31862_1576112309 core_containerd-shim_53653_1576133943
gdb ./containerd-shim core_containerd-shim_31862_1576112309
(gdb) bt
#0 runtime.raise () at /usr/lib/golang/src/runtime/sys_linux_arm64.s:156
#1 0x00000000000517b8 in runtime.dieFromSignal (sig=6) at /usr/lib/golang/src/runtime/signal_unix.go:454
#2 0x0000000000051d70 in runtime.sigfwdgo (sig=6, info=0x4000106da0, ctx=0x4000106e20, ~r3=<optimized out>) at /usr/lib/golang/src/runtime/signal_unix.go:657
#3 0x0000000000050f78 in runtime.sigtrampgo (sig=<optimized out>, info=0x4000106da0, ctx=0x4000106e20) at /usr/lib/golang/src/runtime/signal_unix.go:316
#4 0x0000000000069438 in runtime.sigtramp () at /usr/lib/golang/src/runtime/sys_linux_arm64.s:404
#5 <signal handler called>
#6 runtime.raise () at /usr/lib/golang/src/runtime/sys_linux_arm64.s:156
#7 0x00000000000517b8 in runtime.dieFromSignal (sig=6) at /usr/lib/golang/src/runtime/signal_unix.go:454
#8 0x0000000000051978 in runtime.crash () at /usr/lib/golang/src/runtime/signal_unix.go:546
#9 0x0000000000064988 in runtime.fatalthrow.func1 () at /usr/lib/golang/src/runtime/panic.go:833
#10 0x000000000003c520 in runtime.fatalthrow () at /usr/lib/golang/src/runtime/panic.go:826
#11 0x000000000003c384 in runtime.throw (s=...) at /usr/lib/golang/src/runtime/panic.go:774
#12 0x0000000000031838 in runtime.(*mspan).sweep (s=0xffff86a10b88, preserve=false, ~r1=<optimized out>) at /usr/lib/golang/src/runtime/mgcsweep.go:328
#13 0x0000000000025ab0 in runtime.(*mcentral).uncacheSpan (c=0x5a64f8 <runtime.mheap_+8760>, s=0xffff86a10b88) at /usr/lib/golang/src/runtime/mcentral.go:197
#14 0x0000000000025390 in runtime.(*mcache).releaseAll (c=0xffff86a046d0) at /usr/lib/golang/src/runtime/mcache.go:158
#15 0x000000000002541c in runtime.(*mcache).prepareForSweep (c=0xffff86a046d0) at /usr/lib/golang/src/runtime/mcache.go:185
#16 0x0000000000047c98 in runtime.acquirep (_p_=0x4000022500) at /usr/lib/golang/src/runtime/proc.go:4117
#17 0x0000000000042188 in runtime.stopm () at /usr/lib/golang/src/runtime/proc.go:1930
#18 0x0000000000042bfc in runtime.gcstopm () at /usr/lib/golang/src/runtime/proc.go:2125
#19 0x000000000004428c in runtime.schedule () at /usr/lib/golang/src/runtime/proc.go:2481
#20 0x0000000000044608 in runtime.goschedImpl (gp=0x40001b9c80) at /usr/lib/golang/src/runtime/proc.go:2625
#21 0x0000000000044838 in runtime.gopreempt_m (gp=0x40001b9c80) at /usr/lib/golang/src/runtime/proc.go:2653
#22 0x0000000000054924 in runtime.newstack () at /usr/lib/golang/src/runtime/stack.go:1038
#23 0x0000000000066130 in runtime.morestack () at /usr/lib/golang/src/runtime/asm_arm64.s:310
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
325 nfreed := s.allocCount - nalloc
326 if nalloc > s.allocCount {
327 print("runtime: nelems=", s.nelems, " nalloc=", nalloc, " previous allocCount=", s.allocCount, " nfreed=", nfreed, "\n")
**328 throw("sweep increased allocation count")**
329 }
(gdb) x /100 0xffff86a10b88
0xffff86a10b88: 0x00000000 0x00000000 0x00000000 0x00000000
next=0 prev=0
0xffff86a10b98: 0x005a6508 0x00000000 0x00238000 0x00000040
list=0x005a6508 startAddr=0x00000040/0x00238000
0xffff86a10ba8: 0x00000005 0x00000000 0x00000000 0x00000000
npages=5 manualFreeList=0
0xffff86a10bb8: 0x00000001 0x00000000 0x00000002 0x00000000
freeindex=1 nelems=2
0xffff86a10bc8: 0xffffffff 0x7fffffff 0x845d3c18 0x0000ffff
allocCache=0x7fffffff/0xffffffff allocBits=0x0000ffff/0x845d3c18
0xffff86a10bd8: 0x845d3c10 0x0000ffff 0x00069c41 0x00000007
gcmarkBits=0x0000ffff/0x845d3c10 sweepgen=7 divMul=6 baseMask=0x9c41
0xffff86a10be8: 0x017a0001 0x00050c00 0x00005000 0x00000000
allocCount=5 spanClass=0xc state=0 needzero=1 divShift=0x7a divShift2=0 scavenged=true
elemsize=0x5000
0xffff86a10bf8: 0x00242000 0x00000040 0x00000000 0x00000000
limit=0x00000040/0x00242000 speciallock=0
0xffff86a10c08: 0x00000000 0x00000000 0x00000000 0x00000000
specials=0
gdb ./containerd-shim core_containerd-shim_53653_1576133943
(gdb) bt
#0 runtime.raise () at /usr/lib/golang/src/runtime/sys_linux_arm64.s:156
#1 0x00000000000517b8 in runtime.dieFromSignal (sig=6) at /usr/lib/golang/src/runtime/signal_unix.go:454
#2 0x0000000000051d70 in runtime.sigfwdgo (sig=6, info=0x400015eda0, ctx=0x400015ee20, ~r3=<optimized out>) at /usr/lib/golang/src/runtime/signal_unix.go:657
#3 0x0000000000050f78 in runtime.sigtrampgo (sig=<optimized out>, info=0x400015eda0, ctx=0x400015ee20) at /usr/lib/golang/src/runtime/signal_unix.go:316
#4 0x0000000000069438 in runtime.sigtramp () at /usr/lib/golang/src/runtime/sys_linux_arm64.s:404
#5 <signal handler called>
#6 runtime.raise () at /usr/lib/golang/src/runtime/sys_linux_arm64.s:156
#7 0x00000000000517b8 in runtime.dieFromSignal (sig=6) at /usr/lib/golang/src/runtime/signal_unix.go:454
#8 0x0000000000051978 in runtime.crash () at /usr/lib/golang/src/runtime/signal_unix.go:546
#9 0x0000000000064988 in runtime.fatalthrow.func1 () at /usr/lib/golang/src/runtime/panic.go:833
#10 0x0000000000066080 in runtime.systemstack () at /usr/lib/golang/src/runtime/asm_arm64.s:237
#11 0x0000000000040970 in runtime.startTheWorldWithSema (emitTraceEvent=false, ~r1=<optimized out>) at /usr/lib/golang/src/runtime/proc.go:1080
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
1078 }
1079
**1080 func startTheWorldWithSema(emitTraceEvent bool) int64 {**
1081 mp := acquirem() // disable preemption because it can be holding p in a local var
1082 if netpollinited() {
1083 list := netpoll(false) // non-blocking
1084 injectglist(&list)
1085 }
223 // switch to g0
224 MOVD R5, g
225 BL runtime·save_g(SB)
226 MOVD (g_sched+gobuf_sp)(g), R3
227 // make it look like mstart called systemstack on g0, to stop traceback
228 SUB $16, R3
229 AND $~15, R3
230 MOVD $runtime·mstart(SB), R4
231 MOVD R4, 0(R3)
232 MOVD R3, RSP
233 MOVD (g_sched+gobuf_bp)(g), R29
234
235 // call target function
236 MOVD 0(R26), R3 // code pointer
**237 BL (R3)**
What did you expect to see?
containerd-shim not crash and no core files generated.
What did you see instead?
containerd-shim crash on arm64.
Metadata
Metadata
Assignees
Labels
Type
Projects
Relationships
Development
No branches or pull requests
Activity
[-]runtime/gc: sweep increased allocation count crash on arm64[/-][+]runtime: sweep increased allocation count crash on arm64[/+]ALTree commentedon Dec 12, 2019
cc @aclements @mknyszek
jing-rui commentedon Dec 13, 2019
We can reproduce crash using golang master branch:
stderr print like below:
326 if nalloc > s.allocCount {
327 print("runtime: nelems=", s.nelems, " nalloc=", nalloc, " previous allocCount=", s.allocCount, " nfreed=", nfreed, "\n")
328 throw("sweep increased allocation count")
329 }
full stderr logs
Outputianlancetaylor commentedon Dec 13, 2019
Do you have any patches on the master branch you are using?
Tell us about your program. The most common cause of this kind of error is a pointer being incorrectly converted to uintptr, or C code storing a Go pointer into Go memory. Those are both forbidden. So: do you use unsafe? Do you use cgo?
Is there a way that we can reproduce the problem ourselves?
jing-rui commentedon Dec 13, 2019
no.
the program use unsafe.
not use cgo.
if we set GODEBUG=gcstoptheworld=2, we can not reproduce the crash.
reproduce steps:
I'm trying to find a simple way to reproduce it.
ianlancetaylor commentedon Dec 14, 2019
You could try
GODEBUG=gccheckmark=1
. That might point to the erroneous object.jing-rui commentedon Dec 17, 2019
using GODEBUG=gccheckmark=1
Unfortunately, we did not get the stderr/stdout info. we'll update later when get it.
jing-rui commentedon Dec 18, 2019
update with stderr info
dump 0x4000218ac0
unsafe pointer mainly used by golang.org/x/sys, I'm trying to update sys package and try again.
jing-rui commentedon Dec 19, 2019
We create a program which can reproduce on go1.13.3.(we'll test later on master)
we try to create many(more than 10) go-issue-36101 processs, then wait hours get message in nohup.out.
full nohup.out
Outputruntime: nelems=19 nalloc=2 previous allocCount=1 nfreed=65535 fatal error: sweep increased allocation count
goroutine 3 [running]:
runtime.throw(0x118e0a, 0x20)
/usr/lib/golang/src/runtime/panic.go:774 +0x54 fp=0x4000105610 sp=0x40001055e0 pc=0x399a4
runtime.(*mspan).sweep(0xffff8f8645e0, 0x0, 0x4000105700)
/usr/lib/golang/src/runtime/mgcsweep.go:328 +0x848 fp=0x4000105730 sp=0x4000105610 pc=0x30038
runtime.sweepone(0x11c280)
/usr/lib/golang/src/runtime/mgcsweep.go:136 +0x304 fp=0x40001057a0 sp=0x4000105730 pc=0x2f504
runtime.bgsweep(0x400012c000)
/usr/lib/golang/src/runtime/mgcsweep.go:73 +0xe0 fp=0x40001057d0 sp=0x40001057a0 pc=0x2f120
runtime.goexit()
/usr/lib/golang/src/runtime/asm_arm64.s:1128 +0x4 fp=0x40001057d0 sp=0x40001057d0 pc=0x62d14
created by runtime.gcenable
/usr/lib/golang/src/runtime/mgc.go:210 +0x54
goroutine 1 [runnable]:
encoding/json.stateInString(0x4000640028, 0x106c6e, 0x0)
/usr/lib/golang/src/encoding/json/scanner.go:300 +0x218
encoding/json.checkValid(0x40003c9500, 0x508c, 0x528c, 0x4000640028, 0x40003f0028, 0x109ce0)
/usr/lib/golang/src/encoding/json/scanner.go:29 +0xb0
encoding/json.Unmarshal(0x40003c9500, 0x508c, 0x528c, 0xe0100, 0x40005c8100, 0x0, 0x0)
/usr/lib/golang/src/encoding/json/decode.go:100 +0x58
main.loadspec(0xffffca696579, 0xb)
/root/jingrui/helper/test/src/loadspec.go:654 +0x80
main.loopload(0xffffca696579, 0xb)
/root/jingrui/helper/test/src/loadspec.go:661 +0x38
main.main()
/root/jingrui/helper/test/src/loadspec.go:672 +0xd0
goroutine 18 [runnable]:
reflect.Value.SetString(0xe6bc0, 0x4000243040, 0x198, 0x400041b600, 0xa)
/usr/lib/golang/src/reflect/value.go:1714 +0x10c
encoding/json.(*decodeState).literalStore(0x40001b20b0, 0x40007a0400, 0xc, 0x188c, 0xe6bc0, 0x4000243040, 0x198, 0xb8400, 0x0, 0xe4d60)
/usr/lib/golang/src/encoding/json/decode.go:1010 +0x192c
encoding/json.(*decodeState).value(0x40001b20b0, 0xe6bc0, 0x4000243040, 0x198, 0xe6bc0, 0x4000243040)
/usr/lib/golang/src/encoding/json/decode.go:443 +0x190
encoding/json.(*decodeState).array(0x40001b20b0, 0xe4d60, 0x4000539740, 0x197, 0x40001b20d8, 0xb8f5b)
/usr/lib/golang/src/encoding/json/decode.go:616 +0x130
encoding/json.(*decodeState).value(0x40001b20b0, 0xe4d60, 0x4000539740, 0x197, 0xe4d60, 0x4000539740)
/usr/lib/golang/src/encoding/json/decode.go:419 +0xcc
encoding/json.(*decodeState).object(0x40001b20b0, 0xfc7c0, 0x4000539740, 0x199, 0x400033d388, 0xb8818)
/usr/lib/golang/src/encoding/json/decode.go:823 +0x1020
encoding/json.(*decodeState).value(0x40001b20b0, 0xfc7c0, 0x4000539740, 0x199, 0xfc7c0, 0x4000539740)
/usr/lib/golang/src/encoding/json/decode.go:429 +0x58
encoding/json.(*decodeState).array(0x40001b20b0, 0xe41e0, 0x40003353a8, 0x197, 0x40001b20d8, 0x5b)
/usr/lib/golang/src/encoding/json/decode.go:616 +0x130
encoding/json.(*decodeState).value(0x40001b20b0, 0xe41e0, 0x40003353a8, 0x197, 0xe41e0, 0x40003353a8)
/usr/lib/golang/src/encoding/json/decode.go:419 +0xcc
encoding/json.(*decodeState).object(0x40001b20b0, 0xdfd40, 0x4000555040, 0x196, 0x40001b20d8, 0x7b)
/usr/lib/golang/src/encoding/json/decode.go:823 +0x1020
encoding/json.(*decodeState).value(0x40001b20b0, 0xdfd40, 0x4000555040, 0x196, 0xdfd40, 0x4000555040)
/usr/lib/golang/src/encoding/json/decode.go:429 +0x58
encoding/json.(*decodeState).object(0x40001b20b0, 0xdf900, 0x400029e158, 0x196, 0x40001b20d8, 0x7b)
/usr/lib/golang/src/encoding/json/decode.go:823 +0x1020
encoding/json.(*decodeState).value(0x40001b20b0, 0xdf900, 0x400029e158, 0x196, 0xdf900, 0x400029e158)
/usr/lib/golang/src/encoding/json/decode.go:429 +0x58
encoding/json.(*decodeState).object(0x40001b20b0, 0xe0100, 0x400029e100, 0x16, 0x40001b20d8, 0x7b)
/usr/lib/golang/src/encoding/json/decode.go:823 +0x1020
encoding/json.(*decodeState).value(0x40001b20b0, 0xe0100, 0x400029e100, 0x16, 0x400033de78, 0xc58c4)
/usr/lib/golang/src/encoding/json/decode.go:429 +0x58
encoding/json.(*decodeState).unmarshal(0x40001b20b0, 0xe0100, 0x400029e100, 0x40001b20d8, 0x0)
/usr/lib/golang/src/encoding/json/decode.go:179 +0x1d0
encoding/json.Unmarshal(0x400079ca00, 0x508c, 0x528c, 0xe0100, 0x400029e100, 0x0, 0x0)
/usr/lib/golang/src/encoding/json/decode.go:106 +0xe4
main.loadspec(0xffffca696579, 0xb)
/root/jingrui/helper/test/src/loadspec.go:654 +0x80
main.loopload(0xffffca696579, 0xb)
/root/jingrui/helper/test/src/loadspec.go:661 +0x38
created by main.main
/root/jingrui/helper/test/src/loadspec.go:669 +0x6c
goroutine 19 [runnable]:
reflect.Value.Len(0xe4d60, 0x40003580b0, 0x197, 0x198)
/usr/lib/golang/src/reflect/value.go:1133 +0x1dc
encoding/json.(*decodeState).array(0x40001b2000, 0xe4d60, 0x40003580b0, 0x197, 0x40001b2028, 0x5b)
/usr/lib/golang/src/encoding/json/decode.go:639 +0x18c
encoding/json.(*decodeState).value(0x40001b2000, 0xe4d60, 0x40003580b0, 0x197, 0xe4d60, 0x40003580b0)
/usr/lib/golang/src/encoding/json/decode.go:419 +0xcc
encoding/json.(*decodeState).object(0x40001b2000, 0xdf900, 0x400029e0d8, 0x196, 0x40001b2028, 0x7b)
/usr/lib/golang/src/encoding/json/decode.go:823 +0x1020
encoding/json.(*decodeState).value(0x40001b2000, 0xdf900, 0x400029e0d8, 0x196, 0xdf900, 0x400029e0d8)
/usr/lib/golang/src/encoding/json/decode.go:429 +0x58
encoding/json.(*decodeState).object(0x40001b2000, 0xe0100, 0x400029e080, 0x16, 0x40001b2028, 0x7b)
/usr/lib/golang/src/encoding/json/decode.go:823 +0x1020
encoding/json.(*decodeState).value(0x40001b2000, 0xe0100, 0x400029e080, 0x16, 0x40001a1e78, 0xc58c4)
/usr/lib/golang/src/encoding/json/decode.go:429 +0x58
encoding/json.(*decodeState).unmarshal(0x40001b2000, 0xe0100, 0x400029e080, 0x40001b2028, 0x0)
/usr/lib/golang/src/encoding/json/decode.go:179 +0x1d0
encoding/json.Unmarshal(0x4000797500, 0x508c, 0x528c, 0xe0100, 0x400029e080, 0x0, 0x0)
/usr/lib/golang/src/encoding/json/decode.go:106 +0xe4
main.loadspec(0xffffca696579, 0xb)
/root/jingrui/helper/test/src/loadspec.go:654 +0x80
main.loopload(0xffffca696579, 0xb)
/root/jingrui/helper/test/src/loadspec.go:661 +0x38
created by main.main
/root/jingrui/helper/test/src/loadspec.go:670 +0x94
goroutine 20 [runnable]:
sync.(*Map).Load(0x1e7000, 0x10d720, 0xfc7c0, 0x199, 0x10, 0xc77)
/usr/lib/golang/src/sync/map.go:104 +0x98
encoding/json.cachedTypeFields(0x136ce0, 0xfc7c0, 0x199, 0x136ce0, 0xfc7c0, 0x0)
/usr/lib/golang/src/encoding/json/encode.go:1275 +0x44
encoding/json.(*decodeState).object(0x4000640420, 0xfc7c0, 0x40002c1700, 0x199, 0x40005ad388, 0xb8818)
/usr/lib/golang/src/encoding/json/decode.go:709 +0x200
encoding/json.(*decodeState).value(0x4000640420, 0xfc7c0, 0x40002c1700, 0x199, 0xfc7c0, 0x40002c1700)
/usr/lib/golang/src/encoding/json/decode.go:429 +0x58
encoding/json.(*decodeState).array(0x4000640420, 0xe41e0, 0x4000335028, 0x197, 0x4000640448, 0x5b)
/usr/lib/golang/src/encoding/json/decode.go:616 +0x130
encoding/json.(*decodeState).value(0x4000640420, 0xe41e0, 0x4000335028, 0x197, 0xe41e0, 0x4000335028)
/usr/lib/golang/src/encoding/json/decode.go:419 +0xcc
encoding/json.(*decodeState).object(0x4000640420, 0xdfd40, 0x40007ee080, 0x196, 0x4000640448, 0x7b)
/usr/lib/golang/src/encoding/json/decode.go:823 +0x1020
encoding/json.(*decodeState).value(0x4000640420, 0xdfd40, 0x40007ee080, 0x196, 0xdfd40, 0x40007ee080)
/usr/lib/golang/src/encoding/json/decode.go:429 +0x58
encoding/json.(*decodeState).object(0x4000640420, 0xdf900, 0x40005c8ed8, 0x196, 0x4000640448, 0x7b)
/usr/lib/golang/src/encoding/json/decode.go:823 +0x1020
encoding/json.(*decodeState).value(0x4000640420, 0xdf900, 0x40005c8ed8, 0x196, 0xdf900, 0x40005c8ed8)
/usr/lib/golang/src/encoding/json/decode.go:429 +0x58
encoding/json.(*decodeState).object(0x4000640420, 0xe0100, 0x40005c8e80, 0x16, 0x4000640448, 0x7b)
/usr/lib/golang/src/encoding/json/decode.go:823 +0x1020
encoding/json.(*decodeState).value(0x4000640420, 0xe0100, 0x40005c8e80, 0x16, 0x40005ade78, 0xc58c4)
/usr/lib/golang/src/encoding/json/decode.go:429 +0x58
encoding/json.(*decodeState).unmarshal(0x4000640420, 0xe0100, 0x40005c8e80, 0x4000640448, 0x0)
/usr/lib/golang/src/encoding/json/decode.go:179 +0x1d0
encoding/json.Unmarshal(0x40003c4000, 0x508c, 0x528c, 0xe0100, 0x40005c8e80, 0x0, 0x0)
/usr/lib/golang/src/encoding/json/decode.go:106 +0xe4
main.loadspec(0xffffca696579, 0xb)
/root/jingrui/helper/test/src/loadspec.go:654 +0x80
main.loopload(0xffffca696579, 0xb)
/root/jingrui/helper/test/src/loadspec.go:661 +0x38
created by main.main
/root/jingrui/helper/test/src/loadspec.go:671 +0xbc
jing-rui commentedon Dec 19, 2019
yes, we can reproduce on go master branch.
fatal error: found bad pointer in Go heap
Outputjing-rui commentedon Dec 23, 2019
@ianlancetaylor would you please try https://github.com/jing-rui/go-issue-36101 to reproduce. We can reproduce at 2 different type of physical arm machine, set GODEBUG=stoptheworld=1 or GODEBUG=stoptheworld=2 still panic.
jing-rui commentedon Dec 26, 2019
We compared using jsoniter to replace json lib, the program using jsoniter can run days without crash. So I think there must be something wrong in encoding/json. The reproduce program is updated at https://github.com/jing-rui/go-issue-36101.
cherrymui commentedon Dec 27, 2019
Thanks @jing-rui . I'm able to reproduce this with https://github.com/jing-rui/go-issue-36101 on the Linux/ARM64 builder. Running with
GOGC=1 GODEBUG=gccheckmark=1
, it fails in an hour or two. I looked into a few failures, but I haven't been able to completely understand it. However, I have a guess. It may be that we didn't always write pointers atomically, so the GC observed a partially updated pointer, which may point to bad memory. I made CL http://golang.org/cl/212626 , which ensures atomic pointer writes in memmove. With the CL I haven't gotten a crash running 10+ hours. As the failure is pretty rare, I cannot be sure, though.@jing-rui , could you test CL http://golang.org/cl/212626 ? Thanks.
19 remaining items