Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:26727 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 8066 invoked by uid 1010); 27 Nov 2006 20:25:45 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 8050 invoked from network); 27 Nov 2006 20:25:45 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 27 Nov 2006 20:25:45 -0000 X-Host-Fingerprint: 83.160.219.156 korving.demon.nl Received: from [83.160.219.156] ([83.160.219.156:23749] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 74/6A-43708-5A94B654 for ; Mon, 27 Nov 2006 15:25:45 -0500 Message-ID: <74.6A.43708.5A94B654@pb1.pair.com> To: internals@lists.php.net Date: Mon, 27 Nov 2006 21:24:09 +0100 Lines: 61 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1437 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 X-Posted-By: 83.160.219.156 Subject: thread unsafety inventory From: r.korving@xit.nl ("Ron Korving") Internals, I have gone through the PHP codebase (latest 5.2 CVS), looking for the use of thread unsafe functions, and I found a number. I have virtually no experience in the PHP codebase, so I can't guarantee there are no false alarms in this, but I think the majority is valid. I noticed that main/reentrancy.c provided in thread-safe versions of unsafe functions by means of locking, which can be used when the thread-safe variant is not available. These functions in reentrancy.c are not always used however. Below follows all situations I could find. The only other functions I checked besides those mentioned was asctime(), which showed no problems. If you feel it's better for me to turn this into a bugreport (or many small ones?), let me know and I will. Kind regards, Ron Korving ------------------------------------------------- gmtime: (use gmtime_r) ext/interbase/ibase_query.c on line 679 ext/pdo_sqlite/sqlite/src/date.c on line 948 (external code library) sapi/thttpd_patch on lines 282, 1355, 2298 ctime: (use ctime_r) ext/mime_magic/mime_magic.c on line 1759 localtime: (use localtime_r) ext/com_dotnet/com_variant.c on line 818 ext/pdo_sqlite/sqlite/src/date.c on line 415 (external code library) ext/sqlite/libsqlite/src/date.c on line 419 (external code library) ext/xmlrpc/libxmlrpc/xmlrpc.c on line 234 (external code library) ext/zip/lib/zip_dirent.c on lines 398, 525 (external code library) sapi/thttpd_patch on line 2300 (external code library) crypt: (use crypt_r) ext/standard/crypt.c on line 149 rand: (use rand_r) ext/mcrypt/mcrypt.c on line 1042 ext/soap/php_http.c on line 467 ext/sqlite/libsqlite/src/encode.c on lines 204, 213 (external code library) readdir: (use readdir_r) ext/pcre/pcrelib/pcregrep.c on line 261 main/streams/php_scandir.c on line 74