-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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
race: 'unsupported VMA range' on linux/arm64 #29948
Comments
It seems to be intensional not to support VMA 39 https://reviews.llvm.org/D52167 |
@mengzhuo Your observation is correct. It is a combined problem with Golang and compiler-rt. 39-bit VMA cannot easily be supported by TSAN for Go heap in compiler-rt. Actually there is also some problems with 42-bit VMA. TSAN runtime requires GO heap to be in the range [0x00c000000000, 0x00e000000000], a part of shadow memory region will be out of 42bits address(See: https://github.com/llvm-mirror/compiler-rt/blob/58d43607862096aeb32d72173911c9df244a30f1/lib/tsan/rtl/tsan_platform.h#L795). In theory, we should be able to support 47-bit VMA. But it is not a common configuration in Linux distos, so only 48-bit VMA is supported. |
On the Go side, it is better that we ignore the tests on arm64 when the kernel is not configured as 48-bit VMA. |
Thanks, @Zheng-Xu. How do we check that? Reading kernel config? Or we can just try to map some address and see if it works? Mind contributing a CL? Thanks. We should probably also document this in the release note. |
@cherrymui I took a quick look on disabling the test. But I don't have a good solution so far. I try to list what I found and the difficulty here:
Do you think above solution is reasonable? I can push a CL if it is OK. |
Thanks for the information. As you said, we should not do anything at build time, exactly because of cross compilation. Always disabling -race test in cmd/dist is also not a good idea, as we'll not know if it breaks. Maybe in cmd/dist, we can check the stderr and if it is the unsupported VMA failure, we turn it into SKIP instead of FAIL? Users who use the race detector can still encounter this in their own programs. So we still need to document this. |
Change https://golang.org/cl/160919 mentions this issue: |
@cherrymui Could you mind take a look the patch catching unsupported VMA failure and skipping that. |
If I understand this correctly, the race detector simply doesn't work reliably on arm64 systems. And the problem can only be fixed in race.syso, not in Go code. That's too bad, but I think that for 1.12 we should remove arm64 from raceDetectorSupported in cmd/dist/test.go and cmd/internal/sys/supported.go. It wasn't supported in 1.11, so this is not a regression. We can try again to enable it in 1.13. |
@ianlancetaylor Actually for 44-bit VMA , ppc64le has same problem. Only 46-bit VMA and 47-bit VMA are currently supported for powercp64 on Go. |
@ianlancetaylor, what do you want to do here (if anything) for Go 1.12? I see that https://go-review.googlesource.com/c/go/+/160919/ stalled and hasn't been updated with review feedback. |
@cherrymui @mengzhuo Should we keep or disable arm64 race detector for the 1.12 release? I don't fully understand the circumstances under which it fails. |
@ianlancetaylor I think keep linux/arm64 race detector is fine. This issue only happens when you try to run race builds on unsupported kernel |
OK, thanks. |
If I understand correctly, the ARM64 race detector support works fine under certain kernel configurations (probably the popular one?), but doesn't work at all under some other kernel configurations. So I was suggesting we skip the tests under unsupported kernel. |
@cherrymui, skipping tests is fine (even for Go 1.12, or a later point release) if you want. But I don't think this is a release blocker at this point. That is, all.bash passing for everybody's distro/version isn't a blocker for shipping a release. |
I agree that this is not a release-blocker but more generally I don't think skipping the tests is really a fix here. If we can skip the tests, we can and should also report the problem when running a binary built with |
@cherrymui @ianlancetaylor Currently data race works fine on the kernel configured with 48-bits VMA which is popular. Data race doesn't support the kernel configured with 39-bit VMA and 42-bit VMA because the shadow memory calculated in TSAN runtime will be out of the address space. I will investigate how to support 39-bit VMA in TSAN runtime. |
@bradfitz I also agree that this does not block release. |
@ianlancetaylor TSAN runtime will report the error message when running a binary built with -race on unsupported VMA. |
OK, thanks. |
I think it might related to
https://github.com/llvm-mirror/compiler-rt/blob/master/lib/dfsan/dfsan.cc#L85
What version of Go are you using (
go version
)?master
Does this issue reproduce with the latest release?
No
What operating system and processor architecture are you using (
go env
)?Linux/arm64
CPU: RockChip 3399pro
go env
OutputWhat did you do?
What did you expect to see?
ALL test passed.
What did you see instead?
The text was updated successfully, but these errors were encountered: