You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[[]]
[[] [1]]
0xc0000140d0
[[] [1] [1 2]]
0xc0000140f8
[[] [1] [1 2] [1 2 3]]
0xc00001c130
[[] [1] [1 2] [1 2 3] [1 2 3 4]]
0xc00001c138
this address is used to save the last item of slice []int{1,2,3,4}. Since this slice is appended to *re which will be accessed later, according to my understanding address 0xc00001c138 should not be released and used by others before *re is released.
[[] [1] [1 2] [1 2 3] [1 2 3 4] [1 2 3 4 5]]
0xc00001e0e0
[[] [1] [1 2] [1 2 3] [1 2 3 5] [1 2 3 4 5] [1 2 3 5]]
0xc00001c138
but looks like here 0xc00001c138 is released and used to save the last items of slice[]int{1,2,3,5}.
it can be prvoed that the last item of slice []int{1,2,3,4} is changed from 4 to 5
The text was updated successfully, but these errors were encountered:
Walnux
changed the title
A potential GC issue
A potential GC issue?
Feb 17, 2021
Walnux
changed the title
A potential GC issue?
It is a GC issue?
Feb 17, 2021
Uh oh!
There was an error while loading. Please reload this page.
Meet a weird issue, someone can have a look at it. Thanks!
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
go1.16 is the latest stable version I can get now
What operating system and processor architecture are you using (
go env
)?$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/martin/.cache/go-build"
GOENV="/home/martin/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/martin/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/martin/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.16"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/dev/null"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build901155952=/tmp/go-build -gno-record-gcc-switches"
What did you do?
Please see the code below
What did you expect to see?
[[]] [[] [1]] 0xc0000140d0 [[] [1] [1 2]] 0xc0000140f8 [[] [1] [1 2] [1 2 3]] 0xc00001c130 [[] [1] [1 2] [1 2 3] [1 2 3 4]] 0xc00001c138 [[] [1] [1 2] [1 2 3] [1 2 3 4] [1 2 3 4 5]] 0xc00001e0e0 [[] [1] [1 2] [1 2 3] [1 2 3 4] [1 2 3 4 5] [1 2 3 5]] 0xc0000???? any memory space which is not used ...
What did you see instead?
The text was updated successfully, but these errors were encountered: