# Set SA_ONSTACK in zend_sigaction External

- Thread: https://externals.io/message/118687
- Original archive: https://news-web.php.net/php.internals/118687
- Started by kevin@dunglas.dev on 2022-09-22T12:55:44+00:00
- Messages: 2
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · RFCs at https://externals.io/rfc.md · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #118687 — kevin@dunglas.dev — 2022-09-22T12:55:44+00:00

URL: https://externals.io/message/118687#118687

Hi, internals!

It's been a while.

I'm currently working on a new SAPI for web servers written in Go.
Many virtual machines, including Go (
https://pkg.go.dev/os/signal#hdr-Go_programs_that_use_cgo_or_SWIG), depend
on signals using SA_ONSTACK (
https://man7.org/linux/man-pages/man2/sigaltstack.2.html). This flag allows
a thread to define a new alternate signal stack. Many argue that SA_ONSTACK
should be a default, but it's not the case (yet).

Python merged a patch setting SA_ONSTACK in 2021 (Python 3.10+) for the
same reasons (https://bugs.python.org/issue43390 /
https://github.com/python/cpython/commit/02ac6f41e5569ec28d625bb005155903f64cc9ee),
with no issues.

I opened a Pull Request to set this flag by default and tested it
successfully with my Go SAPI: https://github.com/php/php-src/pull/9597

As this is technically at the limit between a new feature and a bug fix
(having the ability to call Go/C++ VM code from PHP and embed PHP in such
programs), should I open an RFC? Also, if merging my patch is considered,
which branch should I target?

Cheers,
-- 
Kévin Dunglas

---

## #118688 — Joe Watkins — 2022-09-22T13:15:06+00:00

URL: https://externals.io/message/118687#118688 · In reply to: #118687

Hi Kevin,

Master should be targeted, no RFC is required, and the patch looks fine to
me.

Cheers
Joe



> Hi, internals!
>
> It's been a while.
>
> I'm currently working on a new SAPI for web servers written in Go.
> Many virtual machines, including Go (
> https://pkg.go.dev/os/signal#hdr-Go_programs_that_use_cgo_or_SWIG), depend
> on signals using SA_ONSTACK (
> https://man7.org/linux/man-pages/man2/sigaltstack.2.html). This flag
> allows
> a thread to define a new alternate signal stack. Many argue that SA_ONSTACK
> should be a default, but it's not the case (yet).
>
> Python merged a patch setting SA_ONSTACK in 2021 (Python 3.10+) for the
> same reasons (https://bugs.python.org/issue43390 /
>
> https://github.com/python/cpython/commit/02ac6f41e5569ec28d625bb005155903f64cc9ee
> ),
> with no issues.
>
> I opened a Pull Request to set this flag by default and tested it
> successfully with my Go SAPI: https://github.com/php/php-src/pull/9597
>
> As this is technically at the limit between a new feature and a bug fix
> (having the ability to call Go/C++ VM code from PHP and embed PHP in such
> programs), should I open an RFC? Also, if merging my patch is considered,
> which branch should I target?
>
> Cheers,
> --
> Kévin Dunglas
