Last modified: 2012-12-30 17:30:01 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T45034, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 43034 - Bombarding PHP with signals every 2 milliseconds breaks things
Bombarding PHP with signals every 2 milliseconds breaks things
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
Scribunto (Other open bugs)
master
All All
: Unprioritized normal (vote)
: ---
Assigned To: Brad Jorsch
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-12-12 20:15 UTC by Brad Jorsch
Modified: 2012-12-30 17:30 UTC (History)
4 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments
Test script (710 bytes, text/text)
2012-12-12 20:15 UTC, Brad Jorsch
Details

Description Brad Jorsch 2012-12-12 20:15:19 UTC
Created attachment 11496 [details]
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.
Comment 1 Brad Jorsch 2012-12-12 20:17:33 UTC
Gerrit change #38354 removes the #ifdef for LUASANDBOX_PROFILER_USE_THREAD, making it always use that code.

I have a different changeset that does the "block the signal whenever in_lua is false", but there's no point uploading that for review if we decide go with the more straightforward fix.
Comment 2 Alex Monk 2012-12-25 21:56:33 UTC
Merged by Tim Starling on the 20th. Is this bug fixed now?
Comment 3 Brad Jorsch 2012-12-26 14:17:44 UTC
Yes.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links