https://bugzilla.wikimedia.org/show_bug.cgi?id=43034

       Web browser: ---
            Bug ID: 43034
           Summary: Bombarding PHP with signals every 2 milliseconds
                    breaks things
           Product: MediaWiki extensions
           Version: master
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: Unprioritized
         Component: Scribunto
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected]
    Classification: Unclassified
   Mobile Platform: ---

Created attachment 11496
  --> https://bugzilla.wikimedia.org/attachment.cgi?id=11496&action=edit
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.

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are watching all bug changes.
_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to