Bug #51424 [Asn->Csd]: crypt() function hangs after 3rd call

From: Date: Sun, 08 Aug 2010 14:18:47 +0000
Subject: Bug #51424 [Asn->Csd]: crypt() function hangs after 3rd call
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-153237@lists.php.net to get a copy of this message
Edit report at http://bugs.php.net/bug.php?id=51424&edit=1

 ID:                 51424
 Updated by:         pajoye@php.net
 Reported by:        laacz at laacz dot lv
 Summary:            crypt() function hangs after 3rd call
-Status:             Assigned
+Status:             Closed
 Type:               Bug
 Package:            Strings related
 Operating System:   *
 PHP Version:        5.3.2
 Assigned To:        pajoye
 Block user comment: N



Previous Comments:
------------------------------------------------------------------------
[2010-06-17 12:22:53] pajoye@php.net

Automatic comment from SVN on behalf of pajoye
Revision: http://svn.php.net/viewvc/?view=revision&revision=300512
Log: - #51424

------------------------------------------------------------------------
[2010-06-17 12:22:06] pajoye@php.net

Automatic comment from SVN on behalf of pajoye
Revision: http://svn.php.net/viewvc/?view=revision&revision=300511
Log: - #51424, solaris part

------------------------------------------------------------------------
[2010-06-17 01:01:18] srinatar@php.net

i have attached a patch to add membar functionality for solaris. af
course, this would be more relevant if we want to remove the tsrm lock
around this.

------------------------------------------------------------------------
[2010-06-16 16:30:30] pajoye@php.net

This patch was what I proposed initially, it only reduces the risk but
does not fix all cases.

What I committed is over safe as we could remove the tsrm lock. However
I do need to know how we can do the membar on solaris.

------------------------------------------------------------------------
[2010-06-16 15:04:02] srinatar@php.net

hi  laacz at laacz dot lv
 can u please try with this patch and see if this addresses u r issue

to apply this patch, u will need to save the below contents into a file
and 
run

cd php-5.3.2
patch -d . < <saved-file-name>

gmake clean
gmake

 
--- ext/standard/php_crypt_r.c.orig     Wed Jun 16 05:59:16 2010
+++ ext/standard/php_crypt_r.c  Wed Jun 16 06:00:17 2010
@@ -81,9 +81,7 @@
        tsrm_mutex_lock(php_crypt_extended_init_lock);
 #endif
 
-       if (initialized) {
-               return;
-       } else {
+       if (!initialized) {
                _crypt_extended_init();
                initialized = 1;
        }

------------------------------------------------------------------------


The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

    http://bugs.php.net/bug.php?id=51424


-- 
Edit this bug report at http://bugs.php.net/bug.php?id=51424&edit=1


Thread (19 messages)

« previous php.bugs (#153237) next »