|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2010-03-29 12:30 UTC] laacz at laacz dot lv
Description:
------------
When calling crypt() function more than once, it hangs after third call to it.
Configure parameters:
$ php -i | grep configure
Configure Command => './configure' '--enable-bcmath' '--enable-soap' '--with-
pgsql' '--with-ldap' '--enable-sqlite-utf8' '--with-apxs2=/usr/bin/apxs2' '--
prefix=/usr/local' '--with-pdo-mysql' '--with-config-file-path=/etc/httpd' '--
with-openssl=/usr' '--with-mysql=mysqlnd' '--with-mysqli=mysqlnd' '--with-pdo-
mysql=mysqlnd' '--enable-zip' '--localstatedir=/var' '--enable-ftp' '--with-
jpeg-dir=/usr' '--with-gd' '--enable-sockets' '--with-zlib-dir=/usr' '--with-
xmlrpc' '--enable-mbstring=all' '--with-iconv' '--with-gettext' '--with-
imap=/usr' '--with-imap-ssl=/usr' '--with-curl' '--with-mcrypt=/usr/local' '--
with-freetype-dir=/usr/include/freetype2' '--enable-gd-native-ttf' '--with-
mssql' '--with-snmp' '--with-kerberos' '--enable-maintainer-zts' '--enable-
pcntl'
Compiled in and loaded modules (from get_loaded_extensions()): Core, date, ereg,
libxml, openssl, pcre, sqlite3, zlib, bcmath, ctype, curl, dom, fileinfo,
filter, ftp, gd, gettext, hash, iconv, session, json, ldap, mbstring, mcrypt,
mssql, standard, SPL, pcntl, PDO, mysqlnd, pdo_sqlite, pgsql, Phar, posix,
Reflection, pdo_mysql, SimpleXML, snmp, soap, sockets, mysqli, SQLite, imap,
tokenizer, xml, xmlreader, xmlrpc, xmlwriter, zip, mysql
Test script:
---------------
<?php
echo "#1: " . crypt('MUrGtL', 'AB') . "\n";
echo "#2: " . crypt('MUrGtL', 'AB') . "\n";
echo "#3: " . crypt('MUrGtL', 'AB') . "\n";
?>
Expected result:
----------------
$ php crypt.php
#1: ABcghTMliojv2
#2: ABcghTMliojv2
#3: ABcghTMliojv2
$
Actual result:
--------------
# php crypt.php
#1: ABcghTMliojv2
#2: ABcghTMliojv2
Patchesmembar-solaris.patch (last revision 2010-06-16 22:59 UTC by SRIRAM dot NATARAJAN at GMAIL dot COM)Dead_lock_fix_attempt (last revision 2010-03-29 11:54 UTC by pajoye@php.net) GDB-backtrace-proper (last revision 2010-03-29 11:27 UTC by laacz at laacz dot lv) GDB-backtrace (last revision 2010-03-29 11:13 UTC by laacz at laacz dot lv) Pull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 18:00:01 2025 UTC |
Same problem on windows (5.3.2 binary, php5apache2_2.dll): Run 2 requests in parallel: for ($i=0; $i<500000; $i++) { crypt('a', '_'); } ab -n 1 -c 1 http://localhost/test.php => ~1 second, ok ab -n 2 -c 2 http://localhost/test.php => hangshi 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; }