go: runtime: frequent TestCrashDumpsAllThreads failures on `linux/s390x`
#!watchflakes
post <- goarch == "s390x" && pkg == "runtime" && test == "TestCrashDumpsAllThreads"
Go version
ca804118b1ff4ea6cd0b83808e140671d7e10f6f
What operating system and processor architecture are you using (go env)?
linux-s390x-ibm-race at ca804118b1ff4ea6cd0b83808e140671d7e10f6f
:: Running /data/golang/workdir/go/src/make.bash with args ["/data/golang/workdir/go/src/make.bash" "-force"] and env ["LANG=en_US.UTF-8" "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin" "HOME=/root" "LOGNAME=root" "USER=root" "SHELL=/bin/sh" "INVOCATION_ID=5ad2b81f504d4d4493366f364d13f297" "JOURNAL_STREAM=9:358624446" "META_BUILDLET_BINARY_URL=https://storage.googleapis.com/go-builder-data/buildlet.linux-s390x" "GO_STAGE0_NET_DELAY=0s" "GO_STAGE0_DL_DELAY=100ms" "WORKDIR=/data/golang/workdir" "GOROOT_BOOTSTRAP=/data/golang/workdir/go1.4" "GO_BUILDER_NAME=linux-s390x-ibm-race" "GO_BUILDER_FLAKY_NET=1" "GO_TEST_TIMEOUT_SCALE=5" "GOBIN=" "TMPDIR=/data/golang/workdir/tmp" "GOCACHE=/data/golang/workdir/gocache" "GOPLSCACHE=/data/golang/workdir/goplscache" "PWD=/data/golang/workdir/go/src"] in dir /data/golang/workdir/go/src
What did you do?
https://build.golang.org/log/5e29be06bbb7a8a4923d83a58972aa2a10677a94
What did you expect to see?
All tests passing.
What did you see instead?
--- FAIL: TestCrashDumpsAllThreads (0.11s)
crash_unix_test.go:145: found 2 instances of main.crashDumpsAllThreadsLoop; expected 4
…
FAIL
FAIL runtime 46.511s
(attn @golang/s390x)
About this issue
- Original URL
- State: open
- Created 3 years ago
- Comments: 182 (181 by maintainers)
@mknyszek @bcmills We had a look at this issue and we used git bisect to figure out the culprit commit.
Bad Commit Id: de5b418b which introducing failure of TestCrashDumpsAllThreads() We had a look at the file changes corresponding to the bad commit, we see that there are some changes to signal_unix.go file and we suspect that issue lies with the changes made to this file. We are further having look at the changes and we will update when we find more about the root cause of the failure.
@bcmills Am I understanding correctly that you are saying that ultimately the test is failing because traceback reports
goroutine running on other thread; stack unavailablefor the running threads? If so, I think that is a misunderstanding. That report is expected and appears even when the test passes (attached below). Part of the purpose of sending SIGQUIT to every thread so we can report the stacks even of threads that are spinning in user code; this test tries to ensure that we reach every thread.Passing test output:
sighandlershould not be re-raisingSIGQUITuntil after it has already dumped the backtrace for the current thread.The pattern in the recent watchflakes reports for this issue is that one thread is reported in
crashDumpsAllThreadsLoop, and three others (presumably the othercrashDumpsAllThreadsLoopthreads) are reported asgoroutine running on other thread; stack unavailable.That is,
sighandlersuccessfully received the signal and ran, but the crash thread’s call totracebackothersfailed to print stacks for those other goroutines. That happens here: https://cs.opensource.google/go/go/+/master:src/runtime/traceback.go;l=1255-1258;drc=a9c9cc07ac0d3dc73865a57e6ce45c22ada3b5c9@prattmic Thanks. Just take a look on several test failures here, seems none of them exceed 5s(if test time is working correctly). Before this change, usually the last thread which received SIGQUIT will attempt to crash the process, and the others will sleep 5s. After that, the first crash thread will periodically check and crash the process if
crashing.Load() > mcount()-int32(extraMLength.Load()). My guess is that maybe it needs more time to receive and handle the SIGQUIT on slow machine? In the former case, if the last one is ready to crash, the others may had already in sleep state. In the latter case, however, they may just increase thecrashingand even have no time to print out the SIGQUIT and PC… while the first thread is started to crash?Since this seems to be very specific to the builder, in triage we’re wondering if anyone from @golang/s390x could start taking a look. It seems to be failing often enough that bisection should identify the culprit, and then that might just reveal the issue.