go to bug id or search bugs for
If for some reason the function PHP_MINIT_FUNCTION in the file php_wincache.c fails, WINCACHE crashes in the PHP_MSHUTDOWN_FUNCTION function.
There is no code to reproduce. I just changed the PHP_MINIT_FUNCTION to force an error. Recompile the WINCACHE code and use any small PHP file like the one below:
echo 'My name is Don';
A crash can be seen.
The code should handle failure in WINCACHE and exit gracefully.
An access violation.
Add a Patch
Add a Pull Request
The problem is happening because in the function PHP_MINIT_FUNCTION inside file php_wincache.c we also need to set these two lines so that value sets to NULL.
WCG(lfcache) = NULL;
WCG(locache) = NULL;
If we do not set it to NULL, it will get deleted again in PHP_MSHUTDOWN_FUNCTION.
Attaching possible patch. Please review and let me know.
--- php_wincache.c (revision 291858)
+++ php_wincache.c (working copy)
@@ -570,6 +570,8 @@
plcache2 = NULL;
+ WCG(lfcache) = NULL;
+ WCG(locache) = NULL;
Assigning it to myself.
This bug has been fixed in SVN.
In case this was a documentation problem, the fix will show up at the
end of next Sunday (CET) on pecl.php.net.
In case this was a pecl.php.net website problem, the change will show
up on the website in short time.
Thank you for the report, and for helping us make PECL better.
I have created a branch named futures and the fix for the crash is committed there. To view the changes look at:
At some point of time, this should be merged to mainline release.