-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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: segmentation fault on linux/arm when GODEBUG=sbrk=1 #33159
Comments
@aclements @mknyszek Do we expect |
Not especially, no. That said, the panic is actually an unaligned 64-bit atomic access to |
Change https://golang.org/cl/186919 mentions this issue: |
this still occurs with cl 186919 ( |
No, that commit should have fixed it... Could you post an updated traceback (or a few so I can look for patterns)? Also, what's the reason for using sbrk mode? Do you actually need it, or was this just an experiment? I can't even recall the last time we used that to debug something, so another option is to just remove it. |
@aclements i was interested in sbrk mode because i was experimenting with putting hard caps on memory use for go programs. we have an old (3 series right now, maybe 4.4 soon 😢) kernel, and it seems that setrlimit(2) with RLIMIT_DATA does not apply to mmap until linux 4.7. |
here's syslog.test executing natively on arm, cross-compiled with
|
@mischief, sbrk=1 mode isn't going to help with hard caps on memory use. sbrk=1 mode means that nothing ever gets freed or garbage collected, so the heap size just grows monotonically. However, it does not actually mean Go uses the Even as of Linux 4.7, The only effective way to limit a process' physical memory use on Linux that I'm aware of is to use memory cgroups. What is the output of (For my own reference, the implementation and description of the |
|
FYI this still crashes with an alignment error, but it seems that
|
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
i can reproduce with
go version devel +5bc46cb712 Wed Jul 17 17:34:32 2019 +0000 linux/amd64
.What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
i compiled this code (example code from log/syslog) https://play.golang.org/p/at82pgxjDf1 with GOARCH=arm GOARM=7 from linux/amd64, and executed it on a arm system.
if i execute the program normally, it succeeds. if i execute the program with
GODEBUG=sbrk=1
, the program will panic:What did you expect to see?
no panic.
What did you see instead?
a panic.
The text was updated successfully, but these errors were encountered: