Test script
(we don't have a separate product/component for LuaSandbox?)
The LuaSandbox PHP extension, when profiling is enabled, will bombard PHP with SIGRT_7 every 2 milliseconds. This tends to randomly break important syscalls as they get constantly interrupted.
For example, if PHP has allocated enough memory that a clone() system call would take more than 2 milliseconds then it will never finish because it will constantly get interrupted. The attached test program illustrates this; if you have a particularly fast machine, you might have to increase the size of the allocated string.
For another example, I noticed that the Scribunto unit tests would randomly die when run using the LuaSandbox engine. That stopped once I fixed this bug. Not entirely conclusive, but suggestive that something in PHP got an unexpected EINTR and decided to kill the process.
If LuaSandbox is compiled with LUASANDBOX_PROFILER_USE_THREAD, this isn't a problem because it uses a different mechanism for the profiling. But if you really want to keep the possibility of using signals, it also seems to work to block the signal (using sigprocmask) whenever in_lua is false.
Version: master
Severity: normal
Attached: