Port to 2.1: Fix alternate stack cleanup on MUSL (#18687)
authorJan Vorlicek <janvorli@microsoft.com>
Thu, 28 Jun 2018 21:39:51 +0000 (23:39 +0200)
committerWes Haggard <Wes.Haggard@microsoft.com>
Thu, 28 Jun 2018 21:54:01 +0000 (14:54 -0700)
commitc6e7fbc5516842945b9b375f7724438dece10627
tree18284afe80b3d6b19b7464b89480ae97453c4d42
parent105e2abe69f4768023e2483158d4d05d55f97982
Port to 2.1: Fix alternate stack cleanup on MUSL (#18687)

The MUSL implementation of sigaltstack checks that the ss.ss_size is
larger or equal than the MINSIGSTKSZ even when the ss_flags is set
to SS_DISABLE even though Linux man page for sigaltstack states that
when this flag is set, all other ss fields are ignored.

We were not setting the ss_size in this case and it was causing a memory
leak for each thread that has terminated on MUSL based Linux distros
like Alpine.

Glibc implementation doesn't check the ss_size when the SS_DISABLE is set
so the problem was really MUSL specific.
src/pal/src/exception/signal.cpp