Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.9.4

Bug #11678 Registry.php getChannel() deadlocks
Submitted: 2007-07-24 05:38 UTC Modified: 2007-08-31 16:44 UTC
From: crodriguez Assigned: cellog
Status: Closed Package: PEAR (version 1.6.1)
PHP Version: 5.2.3 OS: linux
Roadmaps: 1.6.2    
Subscription  




This patch renders other patches obsolete

Obsolete patches:

Index: PEAR/Registry.php
===================================================================
RCS file: /repository/pear-core/PEAR/Registry.php,v
retrieving revision 1.166
diff -u -r1.166 Registry.php
--- PEAR/Registry.php	16 Jun 2007 18:41:59 -0000	1.166
+++ PEAR/Registry.php	18 Aug 2007 21:55:35 -0000
@@ -795,6 +795,7 @@
             }
 
             if (!is_resource($this->lock_fp)) {
+                $this->lock_fp = null;
                 return $this->raiseError("could not create lock file" .
                                          (isset($php_errormsg) ? ": " . $php_errormsg : ""));
             }
@@ -805,6 +806,9 @@
                     case LOCK_UN: $str = 'unlock';    break;
                     default:      $str = 'unknown';   break;
                 }
+                //is resource at this point, close it on error.
+                fclose($this->lock_fp);
+                $this->lock_fp = null;
                 return $this->raiseError("could not acquire $str lock ($this->lockfile)",
                                          PEAR_REGISTRY_ERROR_LOCK);
             }