2006/2/15, Jim Gallacher <[EMAIL PROTECTED]>: > Nicolas Lehuen wrote: > > 2006/2/15, Jim Gallacher <[EMAIL PROTECTED]>: > > > >>Nicolas Lehuen wrote: > >> > >>>Hi, > >>> > >>>I've built Apache 2.2 and tested mod_python SVN trunk with it. > >>> > >>>The two register_cleanup tests fail. Apparently it's because the test > >>>code registers a cleanup function giving the current request as > >>>parameter. Of course when the cleanup function is called, the request > >>>object is no longer valid, and Apache segfaults. > >>> > >>>Fixing this is only a matter of fixing the test code, yet I wonder how > >>>this code could properly run on Apache 2.0.55. Maybe the request > >>>object was not properly destroyed and this has been fixed in Apache > >>>2.2 ? > >> > >>The tests pass as-is on Debian linux, so this seems to be Win32 specific. > >> > >>Jim > >> > > > > Yet there is no way it should pass anywhere : the test is de facto > > using an old request object during the shutdown of the server. Either > > this old request object is still valid, and we have to ask ourselves > > why it hasn't be properly destroyed, or the old request object isn't > > valid and we are just lucky under Linux and unlucky under Win32. > > > > BTW, I've launched the debugger and Apache segfaults when > > dereferencing the request object to get its server object, during an > > ap_log_rerror() call. > > Just to make sure I didn't introduce any regressions with the code > cleanup I recently checked in, could you retest with revision 376545? > The only diffence between that rev and 3.2.7 is the Apache 2.2 support > and bash 3.1 configure problem. > > svn co -r 376545 https://svn.apache.org/repos/asf/httpd/mod_python/trunk > mp.3765545 > > Jim >
I've corrected the tests and the documentation, which were both wrong about the usage of apache.register_cleanup and server.register_cleanup. I still wonder how those two test could possibly have passed before. The usage of apache.register_cleanup was plain wrong, it should never have passed. This is not particularly reassuring about the legitimity of our test suite. I've double checked the code, and I don't see what's wrong here, so if anyone want to give a try... Anyway, FWIW, now the whole unit test suite passes with Apache 2.2 under Windows XP SP2. Regards, Nicolas