-
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
cmd/compile: bad compilation #16016
Comments
I'm sitting in a meeting, so I'm bisecting. |
Looks like the live variable info at the start of one of the autogenerated functions is not correct. vals is missing from the live list, so if we trigger a GC right at the start of (*R).Foo, we won't scan its argument (the slice of interface{}). There's no "use" of the arg variable visible in the assembly. The JMPRET implicitly uses the args, though, as they are read by the tail callee. The fix may be to consider JMPRET as having read all the args. |
CL https://golang.org/cl/23960 mentions this issue. |
CL https://golang.org/cl/29570 mentions this issue. |
On link-register machines we uses RET (sym), instead of JMP (sym), for tail call (so the assembler knows and may rewrite it to restore link register if necessary). Add RET to the analysis. Fixes #17186. Fixes #16016 on link-register machines. Change-Id: I8690ac57dd9d49beeea76a5f291988e9a1d3afe5 Reviewed-on: https://go-review.googlesource.com/29570 Run-TryBot: Cherry Zhang <cherryyz@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org>
CL https://golang.org/cl/29652 mentions this issue. |
Add an "errorcheckwithauto" action which performs error check including lines with auto-generated functions (excluded by default). Comment "// ERRORAUTO" matches these lines. Add testcase for CL 29570 (as an example). Updates #16016, #17186. Change-Id: Iaba3727336cd602f3dda6b9e5f97dafe0848e632 Reviewed-on: https://go-review.googlesource.com/29652 Run-TryBot: Cherry Zhang <cherryyz@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org>
Using
go1.7beta1
Consider the following program:
The method
Foo
is a read only method that does a type assertion on the input. It should be safe to run that operation concurrently.Currently this leads to corrupted memory:
This passes with SSA or GC off:
/cc @randall77 @ianlancetaylor
The text was updated successfully, but these errors were encountered: