Skip to content
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: callee saved r4 is destroyed unexpectedly in sigtramp@sys_darwin_arm.s #32744

Closed
ghost opened this issue Jun 24, 2019 · 3 comments
Closed
Milestone

Comments

@ghost
Copy link

ghost commented Jun 24, 2019

TEXT runtime·sigtramp(SB),NOSPLIT,$0
	// Reserve space for callee-save registers and arguments.
	SUB	$36, R13

	MOVW	R4, 12(R13)
	MOVW	R5, 16(R13)
	MOVW	R6, 20(R13)
	MOVW	R7, 24(R13)
	MOVW	R8, 28(R13)
	MOVW	R11, 32(R13)	

	// Save arguments.
	MOVW	R0, 4(R13)	// sig
	MOVW	R1, 8(R13)	// info
	MOVW	R2, 12(R13)	// ctx

The R4 is first stored to 12(R13), then R2 is also stored to 12(R13), so the original value in R4 is destroyed.

@gopherbot
Copy link

Change https://golang.org/cl/183517 mentions this issue: runtime: fix a register save/restore bug in sigtramp of arm-darwin

@odeke-em
Copy link
Member

Thank you for reporting this bug @beenshi!

@ianlancetaylor I see you've reviewed Ben's CL, shall we triage this for Go1.13 or Go1.14?

@ianlancetaylor
Copy link
Contributor

It's fine for 1.13. Thanks.

@odeke-em odeke-em added this to the Go1.13 milestone Jun 24, 2019
@golang golang locked and limited conversation to collaborators Jun 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants