Skip to content

Avoid boxing errno during signal-frame setup - #15050

Merged
copybara-service[bot] merged 1 commit into
google:masterfrom
tamird:sigframe-errno
Sep 28, 2026
Merged

copybara-service[bot] merged 1 commit into
google:masterfrom
tamird:sigframe-errno

Conversation

@tamird

@tamird tamird commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

CallWithSignalFrame runs without stack splitting from KVM's bluepill path, but converts a variable errno to error when rt_sigprocmask fails. Go emits runtime.convT64 for this conversion, which can grow the stack and allocate 1. Even when an errno uses cached storage, the helper retains its stack check. The interface return was introduced in 374a11a.

Return unix.Errno directly, with zero indicating success, and update bluepill to check the concrete result. The signal-handler test and benchmark now reject setup failures instead of silently accepting them and release their mapped stacks.

Assisted-by: Codex

@tamird

tamird commented Sep 27, 2026

Copy link
Copy Markdown
Contributor Author

This was found by the checkescape rewrite in #15033.

CallWithSignalFrame runs without stack splitting from KVM's bluepill
path, but converts a variable errno to error when rt_sigprocmask fails.
Go emits runtime.convT64 for this conversion, which can grow the stack
and allocate [1]. Even when an errno uses cached storage, the helper
retains its stack check. The interface return was introduced in
374a11a.

Return unix.Errno directly, with zero indicating success, and update
bluepill to check the concrete result. The signal-handler test and
benchmark now reject setup failures instead of silently accepting them
and release their mapped stacks.

[1]: https://github.com/golang/go/blob/go1.26.3/src/runtime/iface.go#L400-L408

Assisted-by: Codex
@tamird

tamird commented Sep 27, 2026

Copy link
Copy Markdown
Contributor Author

@xinzhong could you please start the import?

copybara-service Bot pushed a commit that referenced this pull request Sep 27, 2026
CallWithSignalFrame runs without stack splitting from KVM's bluepill path, but converts a variable errno to error when rt_sigprocmask fails. Go emits runtime.convT64 for this conversion, which can grow the stack and allocate [1]. Even when an errno uses cached storage, the helper retains its stack check. The interface return was introduced in 374a11a.

Return unix.Errno directly, with zero indicating success, and update bluepill to check the concrete result. The signal-handler test and benchmark now reject setup failures instead of silently accepting them and release their mapped stacks.

[1]: https://github.com/golang/go/blob/go1.26.3/src/runtime/iface.go#L400-L408

Assisted-by: Codex
FUTURE_COPYBARA_INTEGRATE_REVIEW=#15050 from tamird:sigframe-errno 5ea6855
PiperOrigin-RevId: 989285344
copybara-service Bot pushed a commit that referenced this pull request Sep 28, 2026
CallWithSignalFrame runs without stack splitting from KVM's bluepill path, but converts a variable errno to error when rt_sigprocmask fails. Go emits runtime.convT64 for this conversion, which can grow the stack and allocate [1]. Even when an errno uses cached storage, the helper retains its stack check. The interface return was introduced in 374a11a.

Return unix.Errno directly, with zero indicating success, and update bluepill to check the concrete result. The signal-handler test and benchmark now reject setup failures instead of silently accepting them and release their mapped stacks.

[1]: https://github.com/golang/go/blob/go1.26.3/src/runtime/iface.go#L400-L408

Assisted-by: Codex
FUTURE_COPYBARA_INTEGRATE_REVIEW=#15050 from tamird:sigframe-errno 5ea6855
PiperOrigin-RevId: 989285344
copybara-service Bot pushed a commit that referenced this pull request Sep 28, 2026
CallWithSignalFrame runs without stack splitting from KVM's bluepill path, but converts a variable errno to error when rt_sigprocmask fails. Go emits runtime.convT64 for this conversion, which can grow the stack and allocate [1]. Even when an errno uses cached storage, the helper retains its stack check. The interface return was introduced in 374a11a.

Return unix.Errno directly, with zero indicating success, and update bluepill to check the concrete result. The signal-handler test and benchmark now reject setup failures instead of silently accepting them and release their mapped stacks.

[1]: https://github.com/golang/go/blob/go1.26.3/src/runtime/iface.go#L400-L408

Assisted-by: Codex
FUTURE_COPYBARA_INTEGRATE_REVIEW=#15050 from tamird:sigframe-errno 5ea6855
PiperOrigin-RevId: 989285344
copybara-service Bot pushed a commit that referenced this pull request Sep 28, 2026
CallWithSignalFrame runs without stack splitting from KVM's bluepill path, but converts a variable errno to error when rt_sigprocmask fails. Go emits runtime.convT64 for this conversion, which can grow the stack and allocate [1]. Even when an errno uses cached storage, the helper retains its stack check. The interface return was introduced in 374a11a.

Return unix.Errno directly, with zero indicating success, and update bluepill to check the concrete result. The signal-handler test and benchmark now reject setup failures instead of silently accepting them and release their mapped stacks.

[1]: https://github.com/golang/go/blob/go1.26.3/src/runtime/iface.go#L400-L408

Assisted-by: Codex
FUTURE_COPYBARA_INTEGRATE_REVIEW=#15050 from tamird:sigframe-errno 5ea6855
PiperOrigin-RevId: 989285344
copybara-service Bot pushed a commit that referenced this pull request Sep 28, 2026
CallWithSignalFrame runs without stack splitting from KVM's bluepill path, but converts a variable errno to error when rt_sigprocmask fails. Go emits runtime.convT64 for this conversion, which can grow the stack and allocate [1]. Even when an errno uses cached storage, the helper retains its stack check. The interface return was introduced in 374a11a.

Return unix.Errno directly, with zero indicating success, and update bluepill to check the concrete result. The signal-handler test and benchmark now reject setup failures instead of silently accepting them and release their mapped stacks.

[1]: https://github.com/golang/go/blob/go1.26.3/src/runtime/iface.go#L400-L408

Assisted-by: Codex
FUTURE_COPYBARA_INTEGRATE_REVIEW=#15050 from tamird:sigframe-errno 5ea6855
PiperOrigin-RevId: 989285344
@copybara-service
copybara-service Bot merged commit 436719d into google:master Sep 28, 2026
13 checks passed
@tamird
tamird deleted the sigframe-errno branch September 28, 2026 20:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants