-
Notifications
You must be signed in to change notification settings - Fork 18k
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: panic when calling runtime.Callers after div by zero on linux/arm #10486
Comments
Looks like somehow _div is not leaving the stack in a good state when cleaning up and calling panicdivide. I don't understand the arm assembly enough to understand how this is supposed to work. ARM guys? |
BTW this is 1.4.2, not tip. Just a thought, it looks like the _div callsite pushes 2 words before calling _div. I don't understand why it needs to do that. I made a change in 1.4 that removed a lot of these 2 (or for arm, 3) word pushes/pops for defers and go statements. Maybe traceback doesn't understand this 2-word pad? Maybe the pcsp map no longer contains the sp delta for this _div callsite? Maybe we can just get rid of the 2-word push/pop? I don't see what its purpose is. |
Keith, see http://golang.org/src/runtime/vlop_arm.s#L179 for the explanation
If we only concern about Go code, we can reserve two register for ODIV/OMOD
and treat them like DUFFCOPY. But assembly code also uses DIV/MOD, and
that's why we currently resort to the liblink trickery.
|
I think we can bring back CL https://golang.org/cl/19810043. Anyone want to try? |
I have this working. Will send out once current arm build breakage is gone. |
We want to adjust the DIV calling convention to use m, and usleep can be called without an m, so switch to a multiplication by the reciprocal (and test). Step toward a fix for #6699 and #10486. Change-Id: Iccf76a18432d835e48ec64a2fa34a0e4d6d4b955 Reviewed-on: https://go-review.googlesource.com/12898 Reviewed-by: Ian Lance Taylor <iant@golang.org>
CL https://golang.org/cl/12899 mentions this issue. |
Expected output: none, program should exit successfully
Observed output:
This is a minimal test case whittled down from a larger application.
Note the following:
var pcs [512]uintptr
tovar pcs [256]uintptr
results in successful execution.filepath.ToSlash(runtime.GOROOT())
results in successful execution.The text was updated successfully, but these errors were encountered: