Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.2.7
    • Fix Version/s: 3.2.10, 3.3.1
    • Component/s: core
    • Labels:
      None

      Description

      See http://article.gmane.org/gmane.comp.apache.mod-python.devel/1425 for some remarks by Jorey Bump, raised during the 3.2.1-BETA tests.

        Activity

        Hide
        Nicolas Lehuen added a comment -

        Now that Apache 2.2 is out, and mod_python 3.2 close to release, maybe it's time to have a look at this for mod_python 3.3 ?

        Show
        Nicolas Lehuen added a comment - Now that Apache 2.2 is out, and mod_python 3.2 close to release, maybe it's time to have a look at this for mod_python 3.3 ?
        Hide
        Deron Meranda added a comment -

        One small incompatibility is the call to the APR function apr_sockaddr_port_get(), as introduced in the fix for bug MODPYTHON-64. That function was deprecated in APR 1.0 (which maked it into httpd 2.2). The changelog for APR says:

        *) The following deprecated interfaces have been removed:
        ....
        apr_sockaddr_port_get -> (access directly)

        After reviewing the APR changes, it appears that the correct fix to mod_python is quite simple. The line in connobject.c:

        apr_sockaddr_port_get(&port, addr);

        should be replaced with

        port = addr->port;

        This is still portable and has no endianness or word-size issues. (as it would if it tried accessing the addr->sa sub-struct directly).

        Show
        Deron Meranda added a comment - One small incompatibility is the call to the APR function apr_sockaddr_port_get(), as introduced in the fix for bug MODPYTHON-64 . That function was deprecated in APR 1.0 (which maked it into httpd 2.2). The changelog for APR says: *) The following deprecated interfaces have been removed: .... apr_sockaddr_port_get -> (access directly) After reviewing the APR changes, it appears that the correct fix to mod_python is quite simple. The line in connobject.c: apr_sockaddr_port_get(&port, addr); should be replaced with port = addr->port; This is still portable and has no endianness or word-size issues. (as it would if it tried accessing the addr->sa sub-struct directly).
        Hide
        Jim Gallacher added a comment -

        I scanned mod_python 3.2.6 for the existence of other deprecated apr functions listed in the APR change log and nothing else is turning up. I'll comment on the APR_STATUS_IS_SUCCESS issue separately.

        Show
        Jim Gallacher added a comment - I scanned mod_python 3.2.6 for the existence of other deprecated apr functions listed in the APR change log and nothing else is turning up. I'll comment on the APR_STATUS_IS_SUCCESS issue separately.
        Hide
        Jim Gallacher added a comment -

        Running mod_python 3.2.6 and earlier with Apache 2.2 fails with the following error:

        httpd: Syntax error on line 414 of /usr/local/apache2/conf/httpd.conf:
        Cannot load /usr/local/apache2/modules/mod_python.so into server:
        /usr/local/apache2/modules/mod_python.so:
        undefined symbol: APR_STATUS_IS_SUCCESS

        Apache 2.2 now uses apr 1.x (Apache 2.0 used 0.9x) from which APR_STATUS_IS_SUCCESS.

        This was discussed by Greg Stein and Ryan Bloom on the httpd dev mailing list
        http://www.mail-archive.com/dev@httpd.apache.org/msg21757.html.

        The macro was eliminated from apr/trunk in revision 65292.

        The suggested fix is to replace the APR_STATUS_IS_SUCCESS(s) test with (s == APR_SUCCESS), but there is a possible unresolved Win32 issue that was left hanging. Roughly speaking the relevant lines of code in the old apr_errno.h look like this:

        #if defined(OS2) && !defined(DOXYGEN)
        #define APR_STATUS_IS_SUCCESS(s) ((s) == APR_SUCCESS \

        (s) == APR_OS_START_SYSERR + NO_ERROR)

        #elif defined(WIN32) && !defined(DOXYGEN) /* !defined(OS2) */
        #define APR_STATUS_IS_SUCCESS(s) ((s) == APR_SUCCESS \

        (s) == APR_OS_START_SYSERR + ERROR_SUCCESS)

        #elif defined(NETWARE) && !defined(DOXYGEN) /* !defined(OS2) && !defined(WIN32) */
        #define APR_STATUS_IS_SUCCESS(s) ((s) == APR_SUCCESS)

        #else /* !defined(NETWARE) && !defined(OS2) && !defined(WIN32) */
        #define APR_STATUS_IS_SUCCESS(s) ((s) == APR_SUCCESS)
        #endif

        Show
        Jim Gallacher added a comment - Running mod_python 3.2.6 and earlier with Apache 2.2 fails with the following error: httpd: Syntax error on line 414 of /usr/local/apache2/conf/httpd.conf: Cannot load /usr/local/apache2/modules/mod_python.so into server: /usr/local/apache2/modules/mod_python.so: undefined symbol: APR_STATUS_IS_SUCCESS Apache 2.2 now uses apr 1.x (Apache 2.0 used 0.9x) from which APR_STATUS_IS_SUCCESS. This was discussed by Greg Stein and Ryan Bloom on the httpd dev mailing list http://www.mail-archive.com/dev@httpd.apache.org/msg21757.html . The macro was eliminated from apr/trunk in revision 65292. The suggested fix is to replace the APR_STATUS_IS_SUCCESS(s) test with (s == APR_SUCCESS), but there is a possible unresolved Win32 issue that was left hanging. Roughly speaking the relevant lines of code in the old apr_errno.h look like this: #if defined(OS2) && !defined(DOXYGEN) #define APR_STATUS_IS_SUCCESS(s) ((s) == APR_SUCCESS \ (s) == APR_OS_START_SYSERR + NO_ERROR) #elif defined(WIN32) && !defined(DOXYGEN) /* !defined(OS2) */ #define APR_STATUS_IS_SUCCESS(s) ((s) == APR_SUCCESS \ (s) == APR_OS_START_SYSERR + ERROR_SUCCESS) #elif defined(NETWARE) && !defined(DOXYGEN) /* !defined(OS2) && !defined(WIN32) */ #define APR_STATUS_IS_SUCCESS(s) ((s) == APR_SUCCESS) #else /* !defined(NETWARE) && !defined(OS2) && !defined(WIN32) */ #define APR_STATUS_IS_SUCCESS(s) ((s) == APR_SUCCESS) #endif
        Hide
        Jim Gallacher added a comment -

        I thought I could edit a JIRA comment but perhaps not.

        Anyway, the above should read:

        Apache 2.2 now uses apr 1.x (Apache 2.0 used 0.9x) from which APR_STATUS_IS_SUCCESS has been removed.

        Show
        Jim Gallacher added a comment - I thought I could edit a JIRA comment but perhaps not. Anyway, the above should read: Apache 2.2 now uses apr 1.x (Apache 2.0 used 0.9x) from which APR_STATUS_IS_SUCCESS has been removed.
        Hide
        Jim Gallacher added a comment -

        Unit Test Issue: mod_auth.so dependency

        mod_auth.so has been split into separate modules in Apache 2.2 (mod_auth_basic, mod_authn_file, mod_authz_user, and mod_authz_groupfile).

        test/test.py will need to be changed to use mod_auth_basic.

        Show
        Jim Gallacher added a comment - Unit Test Issue: mod_auth.so dependency mod_auth.so has been split into separate modules in Apache 2.2 (mod_auth_basic, mod_authn_file, mod_authz_user, and mod_authz_groupfile). test/test.py will need to be changed to use mod_auth_basic.
        Hide
        Jim Gallacher added a comment -

        Unit Test Issue: KeepAliveTimeout

        In htdocs/tests.py, test_server_members tests the value of KeepAliveTimeout. The default value for KeepAliveTimeout changed in Apache 2.2 from 15 seconds to 5 seconds, so the test as written fails.

        It would likely be better if KeepAliveTimeout configuration directive was used to set an explicit value rather than relying on the default.

        The offending test in tests.py starts at line 448::

        log(" server.keep_alive_timeout: %s" % `server.keep_alive_timeout`)
        if server.keep_alive_timeout != 15.0:
        self.fail("server.keep_alive_timeout should be 15.0")

        Show
        Jim Gallacher added a comment - Unit Test Issue: KeepAliveTimeout In htdocs/tests.py, test_server_members tests the value of KeepAliveTimeout. The default value for KeepAliveTimeout changed in Apache 2.2 from 15 seconds to 5 seconds, so the test as written fails. It would likely be better if KeepAliveTimeout configuration directive was used to set an explicit value rather than relying on the default. The offending test in tests.py starts at line 448:: log(" server.keep_alive_timeout: %s" % `server.keep_alive_timeout`) if server.keep_alive_timeout != 15.0: self.fail("server.keep_alive_timeout should be 15.0")
        Hide
        Jim Gallacher added a comment -

        Patch jg-20060204-1.diff should allow mod_python to work with apache 2.2. This was generated against svn r374719, which corresponds to mod_python 3.2.7.

        It does not add support for any new features found in Apache 2.2.

        Show
        Jim Gallacher added a comment - Patch jg-20060204-1.diff should allow mod_python to work with apache 2.2. This was generated against svn r374719, which corresponds to mod_python 3.2.7. It does not add support for any new features found in Apache 2.2.
        Hide
        Jim Gallacher added a comment -

        I show have mentioned that I'll commit the patch once we've opened trunk for new code checkins.

        Show
        Jim Gallacher added a comment - I show have mentioned that I'll commit the patch once we've opened trunk for new code checkins.
        Hide
        Jim Gallacher added a comment -

        The following comment from Justin Erenkrantz was sent to the python-dev mailing list :

        FWIW, don't ever expect code that relies upon Win32's ERROR_SUCCESS to
        have actually worked anywhere else. The removal of that
        STATUS_IS_SUCCESS #define was to codify that APR_SUCCESS was really
        just 0. I think we did some digging in when we made this change and
        no Windows code ever returned ERROR_SUCCESS for the cases we cared
        about. – justin

        Show
        Jim Gallacher added a comment - The following comment from Justin Erenkrantz was sent to the python-dev mailing list : FWIW, don't ever expect code that relies upon Win32's ERROR_SUCCESS to have actually worked anywhere else. The removal of that STATUS_IS_SUCCESS #define was to codify that APR_SUCCESS was really just 0. I think we did some digging in when we made this change and no Windows code ever returned ERROR_SUCCESS for the cases we cared about. – justin

          People

          • Assignee:
            Jim Gallacher
            Reporter:
            Nicolas Lehuen
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development