It is useful to be able to intentionally trigger fatal errors in MediaWiki, to confirm error/logging behavior. Create a way to do this on production in a secure and controlled way. This will be useful for T187147, but is also generally useful going forward.
Suggested implementation: create a script in wmf/operations/mediawiki-config/w for this purpose. Fully load MediaWiki via WebStart.php. Loading in this way includes configuration and installs error handlers, which may be relevant. The existing extract2.php script in that directory is a good example of how to load in this way.
The script should recognize two parameters, one for indicating the type of fatal error to trigger, and another for indicating whether the error should trigger normally or via a post-send function. (Some error behaviors may differ when executed in a post-send context than in a normal context.)
The types of fatal errors the script can produce should include at least:
- method does not exist
- out of memory
- timeout
- segfault
Additionally, the script should accept a password parameter, which it checks against a password stored in either PrivateSettings.php or (perhaps better) a dedicated file in the same private directory as PrivateSettings.php.