-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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
runtime/race: ThreadSanitizer failed to allocate 0x0000005c9000 (6066176) bytes at 0x200dc940a0000 (error code: 87) #46099
Comments
The race detector uses ~10x the memory that a run without It is possible that the race detector can't allocate memory because the address space it wants is being used by something else. |
The task manager show less then 10Mb of use for the simple example. Looking to GLFW source code, |
Hm, I don't know then. You have officially overreached my Windows knowledge :( |
I too am seeing this on my project. I need to confirm, but I think I wasn't seeing the issue with 1.16.3, but then hit it with 1.16.4 |
Also seeing this with fkie-cad/yapscan on windows only.
|
Sorry, scratch that. I do see with 1.16.3 too. Go version bump coincided with other toolchain upgrades |
cc @zx2c4 |
The problem is still present in 1.16.5. |
Also affects 1.17beta1. |
Still present in 1.17rc1 |
cc @dvyukov |
I don't have a windows machine, so I can't debug it. |
Is the MEM_LARGE_PAGES flag used? In that case the size needs to be a multiple of
Source: https://docs.microsoft.com/en-us/windows/win32/memory/large-page-support |
I don't know if it's relevant, but according to this message in haskell forum: "this means that address given to VirtualAlloc is either not reserved yet, or that size is too big (ie the block-to-be-committed isn't inside one VirtualAlloc MEM_RESERVE block)". Another source point to ASLR, but this should not be the case since the problem is always with the same address. This IBM bug report states: Windows API VirtualAlloc is requesed to allocate memory ofsize 64KB with flag MEM_LARGE_PAGES. This is a non-standard allocation and the API fails with an error "The parameter is incorrect". |
MEM_LARGE_PAGES does not seem to be used in compiler-rt/* dir: |
This function matches the error message. There is an exception for Windows AddressSanitizer not applied to Go but it seems not related. |
It also seems like the allocation is done with a fixed address? Even if that is not the core of the issue in this case (since it seems to always happen), wouldn't that potentially lead to pseudorandom failures if ASLR decides to load a DLL there? |
Yes, with a fixed address. |
I see. Thanks for clarifying. :) |
Thought I'd give some data points: It runs fine if I cross compiled from linux with Looks like it might be specific to TDM GCC EDIT: Running with gdb, it crashes at: https://github.com/golang/go/blob/go1.16.6/src/runtime/race.go#L393 |
This also happens with MSYS2 GCC.
|
Having the same issue when trying running |
I didn't have this problem with 1.16.3 , but was running musl GCC 9.2.1 mingw64 toolchain . When I upgraded Go to 1.16.4 I upgraded the toolchain to GCC 10.X at the same time. That's when I started having problems. So I think the GCC version is the significant thing, not the Go version. Unfortunately I haven't been able to try with >1.16.3 and a 9.2.1 toolchain |
Previously we were downgrading mingw to work around an issue in the race detector in Go on Windows when used with a newer version of GCC. The issue was first reported here: golang/go#46099 Shortly after the release of 1.19 someone had commented this issue was solved for them, and after trying it out in some test runs on actions machines, it seems to be the case. The downgrade was mostly harmless except for two shortcomings: 1. It took quite a while for the package to get downloaded+installed. 2. Chocolatey would frequently fail to download with `The remote file either doesn't exist, is unauthorized, or is forbidden for url ... Exception calling "GetResponse" with "0" argument(s): "The request was aborted: Could not create SSL/TLS secure channel."` Restarting the failed run would often resolve this, but a 50-50 shot of things working is not a great situation. Be nice to find what seemingly fixed the issue, but getting the CI in working order is a good idea. Signed-off-by: Daniel Canter <[email protected]>
This reverts commit 1ef4bda. Previously we were downgrading mingw to work around an issue in the race detector in Go on Windows when used with a newer version of GCC. The issue was first reported here: golang/go#46099 Shortly after the release of 1.19 someone had commented this issue was solved for them, and after trying it out in some test runs on actions machines, it seems to be the case. Disabling ASLR got things in order, and PIE was disabled for -race builds in 1.19, so this is likely the reason things work now: golang/go@0c7fcf6. The downgrade was mostly harmless except for two shortcomings: 1. It took quite a while for the package to get downloaded+installed. 2. Chocolatey would frequently fail to download with `The remote file either doesn't exist, is unauthorized, or is forbidden for url ... Exception calling "GetResponse" with "0" argument(s): "The request was aborted: Could not create SSL/TLS secure channel."` Restarting the failed run would often resolve this, but a 50-50 shot of things working is not a great situation. Signed-off-by: Daniel Canter <[email protected]>
Updated to 1.19 and new error...
I just want to debug 1 test 😭 Edit: if I run the command manually, apparently it's not even valid:
|
I think this is getting a bit farther afield from the original issue ("ThreadSanitizer failed to allocate"). Seems like maybe something is out of whack with your gcc installation.
That looks as though the "-l" is being interpreted by the Go command and not passed to the compiler. I would try fixing up your quoting, e.g. "-gcflags all=-N -l" etc. |
I forgot this even used gcc haha I'm not sure which version I have installed, I always assumed Go on Windows used the native Microsoft compiler for C code.
none of these are commands I've written, these are just what comes out when I click "debug test" in vscode I'll experiment a bit more next week, this was working fine for literal years and suddenly one day it all breaks and I can't debug any more, so annoying. |
Hello , I got this on 1.19
|
@benitogf you are out of memory:
|
got it, thanks @dvyukov 😅 |
Probably yes. |
This reverts commit 1ef4bda. Previously we were downgrading mingw to work around an issue in the race detector in Go on Windows when used with a newer version of GCC. The issue was first reported here: golang/go#46099 Shortly after the release of 1.19 someone had commented this issue was solved for them, and after trying it out in some test runs on actions machines, it seems to be the case. Disabling ASLR got things in order, and PIE was disabled for -race builds in 1.19, so this is likely the reason things work now: golang/go@0c7fcf6. The downgrade was mostly harmless except for two shortcomings: 1. It took quite a while for the package to get downloaded+installed. 2. Chocolatey would frequently fail to download with `The remote file either doesn't exist, is unauthorized, or is forbidden for url ... Exception calling "GetResponse" with "0" argument(s): "The request was aborted: Could not create SSL/TLS secure channel."` Restarting the failed run would often resolve this, but a 50-50 shot of things working is not a great situation. Signed-off-by: Daniel Canter <[email protected]>
This reverts commit fa2016d Previously we were downgrading mingw to work around an issue in the race detector in Go on Windows when used with a newer version of GCC. The issue was first reported here: golang/go#46099 Shortly after the release of 1.19 someone had commented this issue was solved for them, and after trying it out in some test runs on actions machines, it seems to be the case. Disabling ASLR got things in order, and PIE was disabled for -race builds in 1.19, so this is likely the reason things work now: golang/go@0c7fcf6. The downgrade was mostly harmless except for two shortcomings: 1. It took quite a while for the package to get downloaded+installed. 2. Chocolatey would frequently fail to download with `The remote file either doesn't exist, is unauthorized, or is forbidden for url ... Exception calling "GetResponse" with "0" argument(s): "The request was aborted: Could not create SSL/TLS secure channel."` Restarting the failed run would often resolve this, but a 50-50 shot of things working is not a great situation. Signed-off-by: Daniel Canter <[email protected]> (cherry picked from commit 912d43b) Signed-off-by: Akhil Mohan <[email protected]>
This reverts commit 1b6bf22. Previously we were downgrading mingw to work around an issue in the race detector in Go on Windows when used with a newer version of GCC. The issue was first reported here: golang/go#46099 The issue is reported to be fixed after go 1.19 was released
This reverts commit 1b6bf22. Previously we were downgrading mingw to work around an issue in the race detector in Go on Windows when used with a newer version of GCC. The issue was first reported here: golang/go#46099 The issue is reported to be fixed after go 1.19 was released This fixes the CI failures on github actions windows machines, that fails with the error: Cannot find file at '..\\lib\mingw\tools\install\mingw64\bin\mingw32-make.exe' (C:\ProgramData\Chocolatey\lib\mingw\tools\install\mingw64\bin\mingw32-make.exe). This usually indicates a missing or moved file. Error: Process completed with exit code 1.
This reverts commit 1b6bf22. Previously we were downgrading mingw to work around an issue in the race detector in Go on Windows when used with a newer version of GCC. The issue was first reported here: golang/go#46099 The issue is reported to be fixed after go 1.19 was released This fixes the CI failures on github actions windows machines, that fails with the error: Cannot find file at '..\\lib\mingw\tools\install\mingw64\bin\mingw32-make.exe' (C:\ProgramData\Chocolatey\lib\mingw\tools\install\mingw64\bin\mingw32-make.exe). This usually indicates a missing or moved file. Error: Process completed with exit code 1.
This reverts commit 1ef4bda. Previously we were downgrading mingw to work around an issue in the race detector in Go on Windows when used with a newer version of GCC. The issue was first reported here: golang/go#46099 Shortly after the release of 1.19 someone had commented this issue was solved for them, and after trying it out in some test runs on actions machines, it seems to be the case. Disabling ASLR got things in order, and PIE was disabled for -race builds in 1.19, so this is likely the reason things work now: golang/go@0c7fcf6. The downgrade was mostly harmless except for two shortcomings: 1. It took quite a while for the package to get downloaded+installed. 2. Chocolatey would frequently fail to download with `The remote file either doesn't exist, is unauthorized, or is forbidden for url ... Exception calling "GetResponse" with "0" argument(s): "The request was aborted: Could not create SSL/TLS secure channel."` Restarting the failed run would often resolve this, but a 50-50 shot of things working is not a great situation. Signed-off-by: Daniel Canter <[email protected]>
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Use the source in "Usage" section of https://github.com/go-gl/glfw, then run:
What did you expect to see?
The program correctly running, as if
-race
was not provided.What did you see instead?
The error appears on each run. The count, address and error code are always the same. Using different program, the count and address are different.
The text was updated successfully, but these errors were encountered: