For MediaWiki (recent comments | status changes | tags | authors | states | release notes | statistics)
This is good! It has caused so many subtle bugs.
+ CACHE_NONE => array( 'class' => 'FakeMemCachedClient' ),
Shouldn't the class be EmptyBagOStuff ?
It should. There are quite a lot of references to FakeMemCachedClient in the core. I wanted to fix them in a separate commit to make review easier.
Fixed the instances in tests/ in r83144.
Causes PHP Fatal error: Call to a member function set() on a non-object in /www/w/includes/MemcachedSessions.php on line 67. Tim can kind of reproduce this. His latest comments from IRC: "My test wiki just started reproducing it. Actually I think it is PHP's fault after all. I'm reproducing it on 5.3.4. What I don't understand is how it could ever work."
Should be fixed as of r83147.
On request shutdown, PHP does things in the following order:
zend_call_destructors() goes through the $GLOBALS symbol table and identifies every global variable that holds an object which has a reference count of 1. It removes these globals. It doesn't decrement any reference counts. Any globals which are not objects, or have a reference count greater than 1, are left in the symbol table. So if we have a variable $x:
$x = new Foo;
That will be deleted, unless we protect it by making a reference to it from somewhere:
$y =& $x;
After this perplexing action, zend_deactivate_modules() calls php_session_save_current_state() which calls our memcached save handler, which uses $wgMemc. Because this revision removed all references to $wgMemc, being obsolete holdovers from PHP 4, this exposed $wgMemc to zend_call_destructors(), meaning that it was not present in the symbol table when memsess_write() was called.
Thanks for digging, Tim. Back to new.
Reported upstream: http://bugs.php.net/bug.php?id=54157
Marked WONTFIX upstream. Made a choice between two evils, apparently.
I talked to Johannes on IRC about it. I think I convinced him that something is not quite right about this code. He said he'd have another look at it if I wrote it up for php internals.
Filing bugs against PHP is more of a starting point than an ending point. Most of the bugs that I've gotten fixed in PHP started out being closed as some flavour of "bogus".
newFromParams() in ObjectCache.php:
Line 55 is using an undefined variable $id