ZF-11858: Zend_Captcha_Image garbage collection can result in fatal error when run in parallel


Zend_Captcha_Image garbage collector sometimes results in a fatal error: SplFileInfo::getMTime(): stat failed for XXX.png in in Zend/Captcha/Image.php, at line 583.

I belive that this error occurs only under some load, when two (or more) garbage collectors fire at the same time. One GC tries to run SplFileInfo::getMTime() on file wich was already deleted by other parallel GC.

Solution for this could be some kind of semaphore or at least an additional file_exists() check.


Patch that adds a file_exists() check before getMTime() call

added a patch using a file_exists() check. Did not supply a unit test since the issue is hard to reproduce and would probably require mocking the file access completely.

Fixed in trunk r24821