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
cmd/go: reject use of PIE with -race #20038
Comments
My gut says quarduple the amount of memory assigned to that container.
…On Thu, 20 Apr 2017, 01:22 Brad Fitzpatrick ***@***.***> wrote:
/cc @dvyukov <https://github.com/dvyukov> @ianlancetaylor
<https://github.com/ianlancetaylor>
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#20038 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAAcA8eCT0MvHyNC7uohK7fFgNSPULeFks5rxiadgaJpZM4NB1dE>
.
|
How much memory does the program use without race detector? |
@dvyukov I was doing some load testing (nothing too crazy) the other day and I found that it never reached 15 MB. I'd say it generally takes between 10-15 MB. |
@davecheney does it sound strange that the race detector would require 8-16 GB of memory for a program that takes 15 or maybe 20 MB at the very most? |
@aaronjwood, is your container limiting actual memory usage or also allocating virtual memory addresses? |
Please provide repro instructions. |
@dvyukov actually I have some updates on this. I found that it's not the race detector that's causing the issue, it's when we build the binary as a PIE executable AND use the race detector. Before when we were building we passed |
Uh, that's not supported. Race runtime assumes that executable is loaded at around 0 address. I guess we need to prohibit this combination for now. |
I see, I didn't realize that. If that's the case then I guess we can simply close this. Maybe some docs or a change like you suggested would help others that may run into this in the future. |
Rejecting that combination in cmd/go SGTM. |
I uploaded a fix for review: https://go-review.googlesource.com/c/41335/ |
Is the gopherbot sick? It's not crossreferencing CLs, I uploaded a patch hours ago but it didn't post on the issue. |
Maybe on sick leave? ;-). Anyway, please ignore my fix if there was already one in the works. |
@ALTree, two problems with gopherbot. One was already known (not yet productionized properly) and the other is new with a fix+test coming. |
CL https://golang.org/cl/41333 mentions this issue. |
CL https://golang.org/cl/41335 mentions this issue. |
What version of Go are you using (
go version
)?1.7.4
What operating system and processor architecture are you using (
go env
)?OS: CoreOS 1010.6.0 (Linux 4.5.7)
Arch: x86_64
What did you do?
Built a binary with
-race
in our CI environment (also x86_64 Linux but not CoreOS), ran it on CoreOS, immediately got a segfault.What did you expect to see?
No segfault :) Building this same binary without the race detector and running it on CoreOS works just fine.
What did you see instead?
One other important detail: this binary was run under Mesos 1.0.3. The only resource restrictions in place (applied via cgroups) were 4 GB of memory and 4 (relative) CPU shares.
The text was updated successfully, but these errors were encountered: