Fix intermittent test failure in test-resume-sig (#51)
Fix intermittent test failure in test-resume-sig (#51)

(At least on x86(_32),) `unw_resume` will call `setcontext` which will modify the signal masks
based on the value in the context. Since the signal mask is not being initialized by
`unw_getcontext`, this cause the signal mask to be set to a random (uninitialized) value after
`unw_resume` which cause the test to fail since it relies on the signal mask for SIGUSR2 being
cleared.

The proper fix is likely to either make `unw_resume` not touch the signal mask if the context
wasn't initialized with a signal ucontext, or to make `unw_getcontext` record the signal mask too.
It's unclear to me which approach should be taken...

In the mean time, the intermittent failure can be fixed simply by zero initialing the context first
which would clear all the signal masks.
When siginfo is available, a more reliable way is to use the `ucontext` passed in
to the signal handler directly and rely on `sigreturn` to reset it.
Unfortunately, this is currently not implemented on all archs either.
vtjnash/libunwind,libunwind/libunwind,djwatson/libunwind,yuyichao/libunwind,frida/libunwind,libunwind/libunwind,frida/libunwind,rantala/libunwind,frida/libunwind,rantala/libunwind,djwatson/libunwind,vtjnash/libunwind,vtjnash/libunwind,yuyichao/libunwind,djwatson/libunwind,rantala/libunwind,libunwind/libunwind,yuyichao/libunwind