[OpenSmalltalk/opensmalltalk-vm] 352de1: Ensure that sigaltstack is used to establish an al...

Previous Topic Next Topic
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

[OpenSmalltalk/opensmalltalk-vm] 352de1: Ensure that sigaltstack is used to establish an al...

Eliot Miranda-4
  Branch: refs/heads/Cog
  Home:   https://github.com/OpenSmalltalk/opensmalltalk-vm
  Commit: 352de13869ef1aefeae1c6f863eeb41111db7ffe
  Author: Eliot Miranda <[hidden email]>
  Date:   2019-10-05 (Sat, 05 Oct 2019)

  Changed paths:
    M platforms/unix/vm/aio.c
    M platforms/unix/vm/sqUnixITimerHeartbeat.c
    M platforms/unix/vm/sqUnixITimerTickerHeartbeat.c

  Log Message:
  Ensure that sigaltstack is used to establish an alternative signal stack on
Unix platforms, and that the SIGIO handler (forceInterruptCheck) runs on that
stack.  Although we don't have absolute proof we have strong evidence to suggest
that on recent macOS versions (e.g. 10.13) the first delivery of SIGIO to the
VM causes corruption of the code zone if the VM is in or transitioning to
machine code.  This is similar to crashes seen in the Newspeak VM on linux using
the ITIMER heartbeat.  There-on the issue was that the dynamic linker would be
called within the signal handler on first invocation, and that this would cause
the dynamic linker to traverse the Smalltalk JIT code stack, misinteerpret
Smalltalk stack frames as ABI-compliant stack frames and cause corruption as
a result.

Since the code is now system wide on Unix, not merely confined to the ITIMER VM,
move the sigaltstack initialization to platforms/unix/vm/aio.c and delete the
duplications in  the ITIMER heartbeat variants.