Partner and Community Forums
Windows Cache Extension for PHP
Weird behavior related to the use of wincache+__autoload magic method
Last post Jan 24, 2010 03:59 AM by don.raman
Jan 07, 2010 10:59 AM|LINK
I´ve noticed a really weird behaviour on my production server:
Everything works fine with wincache, but every once in a while, my scripts quit calling the __autoload method.
This works ok (the problem has nothing to do with the __autoload function included in the autoload.php file (it worked for years in our previous production server), but then suddenly we get a Fatal Error 'Class not found'.
It happens with every script i execute, and the class not found is always the first class declared in the script.
I´ve tested it, and the problem is the __autoload magic function won´t get called.
If i programatically call the function, the script works ok.
I know for sure the problem is related to wincache, because i can see in the stats page (wincache stats page) that there are 1700 BILLIONS of files cached, which is totally imposible. If i manually kill the php-cgi processes (we have at most 4 php-cgi processes,
running under fastcgi, and created by one single worker process), then the wincache gets rebooted, and our apps start working again.
Sorry for such a long post, any help would be really appreciated.
Thanks a lot.
Jan 07, 2010 11:49 AM|LINK
Thank you for reporting this to us. Can we get a small PHP code which we can use to reproduce the bug at our side on a consistent basis? This will help us debugging the code and fixing it.
From mere description it seems like auto-loading is going to some kind of infinite loop. You can do two things, either please provide a small code which we can use in-house or get us access to a machine which exhibits this problem. We are working on a refresh
to WINCACHE 1.0 and would like to fix it.
Again thanks for reporting it to us.
Jan 08, 2010 06:31 AM|LINK
I´m sending you the content of 2 files where we can see the problem, but the thing is, i dont think you will reproduce it, and i don´t think i can find a way to let you access our production server...
This is the code for the files autoload.php and test.php
The thing is: this really simple code has been working for years in our previous production server (still in use, until we fix this problem and move on to the new one), i´m sure there´s no infinite loop, besides that, this code
might be working for several days while we test our new server, and it suddenly quits working, for every application in our server, the error message would be: Fatal Error, class "NameOfTheFirstClassInTheFile" not found.
I´ve noticed the problem is that the magic __autoload function won´t get called anymore (i´ve tried throwing exceptions from the __autoload function, and the exception never get´s thrown), if i manually call that function before
i instantiate the tbd object, that would work:
include_once (dirname(__FILE__) .
I´m sorry i can´t give you no more clues, i think it´s gonna be hard to fix, but we´d appreciate any help.
Jan 12, 2010 06:49 AM|LINK
Hello, did you reproduce the problem?
I´m sorry I can´t let you access our production server (company rules), but i can tell you what kind of server, ddbb, operating system... we have, since you might have a similar machine where you could try this code, although i don´t know if it will reproduce
Jan 12, 2010 01:02 PM|LINK
We are trying to fix similar crash. There is a bug where shared memory is not being locked properly and is getting corrupted. Once the shared memory gets corrupted behavior is undefined. You might be facing a similar situation. We are working on a fix. Once
we have the fix I will send you the private DLL so that you can verify it at your end.
Jan 19, 2010 07:06 AM|LINK
We have fixed a bug which was causing the crash. Is it possible for you to try a private to see if this bug is fixed? If yes, pls email me at ksingla at microsoft dot com and I will send you the private. Let me know if you need the private for php 5.2 or 5.3.
Jan 24, 2010 03:59 AM|LINK
A gentle reminder if you haven't done this already. I remember you reporting a problem with inclusion of file with WINCACHE. We believe we have a solution for that. We are in the process of releasing WINCACHE 1.0.1 version with this fix. It will be good
if you can test the private version of WINCACHE with the fix. This will be a win-win situation for both of us as you will get a chance to ensure that the fix is indeed working for you and if not we can address your concern too so that you can run WINCACHE
smoothly. For us, it will be great to have a real customer validation. We have already got it validated by few customers. it would be great if you can help us in making WINCACHE a great caching solution on WINDOWS.
For getting the privates, please mail me at DONRAMAN[@]MICROSOFT[dot]COM and let me know if you need the privates for PHP 5.2 or PHP 5.3.
Again thanks in advance for helping us.