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
beenshi opened this issue Jun 24, 2019 · 3 comments
Closed
Milestone

Comments

@beenshi
Copy link

@beenshi beenshi 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

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Jun 24, 2019

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

@odeke-em

This comment has been minimized.

Copy link
Member

@odeke-em odeke-em commented Jun 24, 2019

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

This comment has been minimized.

Copy link
Contributor

@ianlancetaylor ianlancetaylor commented Jun 24, 2019

It's fine for 1.13. Thanks.

@odeke-em odeke-em added this to the Go1.13 milestone Jun 24, 2019
@gopherbot gopherbot closed this in df901bc Jun 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.