Apache Mod-Python - Testing mod_python SVN trunk with Apache 2.2 on Win32

This is Interesting: Free IT Magazines  
Home > Archive > Apache Mod-Python > February 2006 > Testing mod_python SVN trunk with Apache 2.2 on Win32





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Testing mod_python SVN trunk with Apache 2.2 on Win32
Nicolas Lehuen

2006-02-15, 2:46 am

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 ?

This also shows that we should document the fact that the current
request object should not be passed directly or indirectly to the
*.register_cleanup functions. Maybe we could implement a little test
in those function to make sure it is not passed directly ?

Those two failures aside, the rest of the tests are OK.

Regards,
Nicolas

Graham Dumpleton

2006-02-15, 7:46 am


On 15/02/2006, at 5:29 PM, 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 ?
>
> This also shows that we should document the fact that the current
> request object should not be passed directly or indirectly to the
> *.register_cleanup functions. Maybe we could implement a little test
> in those function to make sure it is not passed directly ?
>
> Those two failures aside, the rest of the tests are OK.


I have had a quick go on Mac OS X with Apache 2.2 and SVN trunk and
I get test_global_lock failing. Will have to wait until tomorrow for
me to
look at it further.

Graham

Jim Gallacher

2006-02-17, 11:10 pm

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

Nicolas Lehuen

2006-02-17, 11:10 pm

2006/2/15, Jim Gallacher <jpg@jgassociates.ca>:
> Nicolas Lehuen wrote:
>
> 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.

Regards,
Nicolas

Jim Gallacher

2006-02-17, 11:10 pm

Nicolas Lehuen wrote:
> 2006/2/15, Jim Gallacher <jpg@jgassociates.ca>:
>
>
> 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

Nicolas Lehuen

2006-02-17, 11:10 pm

2006/2/15, Jim Gallacher <jpg@jgassociates.ca>:
> Nicolas Lehuen wrote:
c.[vbcol=seagreen]
>
> 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

Graham Dumpleton

2006-02-17, 11:10 pm

I have already noted that apache.register_cleanup() and
req.server.register_cleanup() are prone to failure. The problem
is that they are run in the context of a signal handler. See:

http://issues.apache.org/jira/browse/MODPYTHON-109

I suggested in the JIRA issue that these functions may need to
be removed unless an equivalent can be found that is safe.

Graham

On 16/02/2006, at 6:55 AM, Nicolas Lehuen wrote:

> 2006/2/15, Jim Gallacher <jpg@jgassociates.ca>:
>
> 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



Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com