httpd-bugs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 41141] New: - mod_dbd, apr_dbd_pgsql: Error looking up ... in database mod_dbd, apr_dbd_pgsql: Error looking up ... in database
Date Sun, 10 Dec 2006 12:26:45 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=41141>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=41141

           Summary: mod_dbd, apr_dbd_pgsql: Error looking up ... in database
                    mod_dbd, apr_dbd_pgsql: Error looking up ... in database
           Product: Apache httpd-2
           Version: 2.2.3
          Platform: Sun
        OS/Version: Solaris
            Status: NEW
          Keywords: PatchAvailable
          Severity: critical
          Priority: P2
         Component: Other Modules
        AssignedTo: bugs@httpd.apache.org
        ReportedBy: jens@strawberry.com


The authorization using DBD/PGSQL is broken at least in version 2.2.3.
Debugging the code I foigured out, that in dbd_setup_lock a failure
return code is generated if srv->mutex contains the NULL value. This
is incorrect, because the NULL value may also be assigned in success
cases if no mutexes are required (see: dbd_setup_init in the same
source file). I've created the following patch which works fine for
me:


*** ./modules/database/mod_dbd.c.fcs    Sun Dec 10 12:19:47 2006
--- ./modules/database/mod_dbd.c        Sun Dec 10 12:22:01 2006
***************
*** 388,416 ****
      /* several threads could be here at the same time, all trying to
       * initialize the reslist because dbd_setup_init failed to do so
       */
!     if (!svr->mutex) {
!         /* we already logged an error when the mutex couldn't be created */
!         return APR_EGENERAL;
      }

-     rv = apr_thread_mutex_lock(svr->mutex);
-     if (rv != APR_SUCCESS) {
-         ap_log_perror(APLOG_MARK, APLOG_CRIT, rv, pool,
-                       "DBD: Failed to acquire thread mutex");
-         return rv;
-     }
-
      if (!svr->dbpool) {
          rv2 = dbd_setup(s->process->pool, svr);
      }

!     rv = apr_thread_mutex_unlock(svr->mutex);
!     if (rv != APR_SUCCESS) {
!         ap_log_perror(APLOG_MARK, APLOG_CRIT, rv, pool,
!                       "DBD: Failed to release thread mutex");
!         if (rv2 == APR_SUCCESS) {
!             rv2 = rv;
!         }
      }
      return rv2;
  }
--- 388,415 ----
      /* several threads could be here at the same time, all trying to
       * initialize the reslist because dbd_setup_init failed to do so
       */
!     if (svr->mutex) {
!       rv = apr_thread_mutex_lock(svr->mutex);
!       if (rv != APR_SUCCESS) {
!           ap_log_perror(APLOG_MARK, APLOG_CRIT, rv, pool,
!                         "DBD: Failed to acquire thread mutex");
!           return rv;
!       }
      }

      if (!svr->dbpool) {
          rv2 = dbd_setup(s->process->pool, svr);
      }

!     if (svr->mutex) {
!       rv = apr_thread_mutex_unlock(svr->mutex);
!       if (rv != APR_SUCCESS) {
!           ap_log_perror(APLOG_MARK, APLOG_CRIT, rv, pool,
!                         "DBD: Failed to release thread mutex");
!           if (rv2 == APR_SUCCESS) {
!               rv2 = rv;
!           }
!       }
      }
      return rv2;
  }

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


Mime
View raw message