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
Why panic? fmt.Sprintf("%d@%d@%d",v1,v2,v3) #39587
Comments
Thank you for reporting this issue. Before we can investigate can you please do one or more of the following
|
Something is wrong with one of the strings that you're printing. It has a nonzero length ( Find out where that string came from. That's where the bug is. Looks superficially similar to #39495 . |
Have you tried running your program under the race detector? See https://blog.golang.org/race-detector . |
go test -race xxx_test.go this works ok |
@lovei it is possible that your test coverage do not exercise the race condition. Can you build your server process using the |
Yes, I used the -race flag to build the server code (it took about 10 minutes to run) and called the method many times, but this does not seem to print WARNING: DATA RACE about fmt.Sprintf). I can't understand why panic at here?
|
@lovei are you able to provide the full stack trace? |
@davecheney recover.txt |
@lovei thank you for the stack trace. Are you 100% sure you have deployed your -race build binary to your server and subjected it to the same traffic? |
sorry, not the same traffic, i just tested it on my pc with -race. |
same case, I recurring this problem, because of shared memory
|
@fxxkingNoob the program you supplied has a data race. Have you tried running your program under the race detector? See https://blog.golang.org/race-detector . |
Of course it has data race. |
Ok, thank you. I think this issue can be closed. |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
My server happened once yesterday
What did you do?
runtime error: invalid memory address or nil pointer dereference
/var/jenkins_home/go/src/runtime/panic.go:969 +0x166 fmt.(*buffer).writeString(...)
/var/jenkins_home/go/src/fmt/print.go:82 fmt.(*fmt).padString(0xc00432b220, 0x0, 0xe)
/var/jenkins_home/go/src/fmt/format.go:110 +0x8c fmt.(*fmt).fmtS(0xc00432b220, 0x0, 0xe)
/var/jenkins_home/go/src/fmt/format.go:359 +0x61 fmt.(*pp).fmtString(0xc00432b1e0, 0x0, 0xe, 0x73)
/var/jenkins_home/go/src/fmt/print.go:450 +0x1ba fmt.(*pp).printArg(0xc00432b1e0, 0x2365440, 0xc008a8c570, 0x73)
/var/jenkins_home/go/src/fmt/print.go:698 +0x843 fmt.(*pp).doPrintf(0xc00432b1e0, 0x26a7bb7, 0x1d, 0xc000d1f278, 0xa, 0xa)
/var/jenkins_home/go/src/fmt/print.go:1030 +0x15a fmt.Sprintf(0x26a7bb7, 0x1d, 0xc0009c1278, 0xa, 0xa, 0x2738001, 0x10000c00432b1e0) /var/jenkins_home/go/src/fmt/print.go:219 +0x66
The text was updated successfully, but these errors were encountered: