golang / go

The Go programming language
https://go.dev
BSD 3-Clause "New" or "Revised" License
123.81k stars 17.65k forks source link

affected/package: log #56622

Closed ckcfcc closed 1 year ago

ckcfcc commented 1 year ago

go version: 1.19.3

Does this issue reproduce with the latest release?

yes

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

mac os 11.4 (intel cpu)

go env Output
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/dark/Library/Caches/go-build"
GOENV="/Users/dark/Library/Application Support/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/dark/dev_lib/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/dark/dev_lib/go"
GOPRIVATE=""
GOPROXY="https://goproxy.cn,direct"
GOROOT="/usr/local/Cellar/go/1.19.3/libexec"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.19.3/libexec/pkg/tool/darwin_amd64"
GOVCS=""
GOVERSION="go1.19.3"
GCCGO="gccgo"
GOAMD64="v1"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/dark/dev_projects/JYOline/jyWebSvr/go.mod"
GOWORK=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/52/tc8v_lps5fnbpn1r3vhzhtg80000gn/T/go-build3952776503=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

use log.Printf() print some message

What did you expect to see?

not crash

code

        attNum++
        firstCale = true
        log.Printf("[战斗] 开始第%d(%d)次攻击", attNum, *sm.cfg.FtCfg.AttNum) // here  line:213
        err = sm.tcp.SendAttack(pid, sm.rbt.FI.RndSeed, wgSID, 4, 1, wg.Style, x, y, wgLV)
        if err != nil {
            err = fmt.Errorf("[战斗] 攻击发包失败")
            return
        }

log.Printf crash.txt

randall77 commented 1 year ago

This looks like memory corruption. Have you tried running with the race detector?

gopherbot commented 1 year ago

Timed out in state WaitingForInfo. Closing.

(I am just a bot, though. Please speak up if this is a mistake or you have the requested information.)