Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:14602 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 2663 invoked by uid 1010); 3 Feb 2005 22:39:54 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 2624 invoked from network); 3 Feb 2005 22:39:54 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 Feb 2005 22:39:54 -0000 X-Host-Fingerprint: 209.49.110.2 emma.patton.com Linux 2.4/2.6 Received: from ([209.49.110.2:47873] helo=anida.patton.com) by pb1.pair.com (ecelerity HEAD (r4105:4106)) with SMTP id 52/3A-10528-343A2024 for ; Thu, 03 Feb 2005 17:18:43 -0500 Received: from jolhoeft ([10.10.22.84]) by anida.patton.com (8.12.8/8.12.8) with ESMTP id j13MIecT017598; Thu, 3 Feb 2005 17:18:40 -0500 To: "'Derick Rethans'" Cc: "'PHP Developers Mailing List'" Date: Thu, 3 Feb 2005 17:18:40 -0500 Message-ID: <000601c50a3e$50cf9a40$54160a0a@ATLANTIC> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: quoted-printable X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.6626 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 In-Reply-To: Importance: Normal Subject: RE: [PHP-DEV] snprintf defined as ap_php_snprintf From: jolhoeft@patton.com ("Jeff Olhoeft") References: On Thu, 3 Feb 2005, Derick Rethans wrote: > > > > Is this a deliberate change? Is there some way to tell configure = to > > > > use the system snprintf instead of the PHP version? > > > > > > You should always been using the ap_php_snprintf() one as that has = an > > > extra modified %F for non-locale aware number formatting. To make = your > > > extension work, make sure to include main/snprintf.h. > > > > I'm afraid I might not have been clear. In 4.3.10, php.h includes > > snprintf.h, which defines snprintf as ap_php_snprintf. = Unfortunately, > > ap_php_snprintf is failing, causing the module to crash. If I force = it > to > > use glibc's snprintf, everything works fine. Unfortunately, > ap_php_snprintf > > isn't an option right now, and I'm wondering what is the cleanest = way to > > insure that the system snprintf is used. >=20 > You can't do that actually. Is it necessary to override the system snprintf? This is a potential = trap for the unwary programmer. It took us a fair amount of digging to = discover that this was happening. I haven't found any documentation that warns = that snprintf might behave differently then one is used to. > What fails in ap_php_snprintf? We need to > fix that instead. I'm afraid I've not been able to pin-point the problem more then that. = The target is an embedded system with limited memory, so debugging can be a challenge at times. Looking at my original message, I realize that I = forgot to mention that the crash occurs only in mod_php, not the stand alone excutable of php. > (And always CC the mailinglist). Ack, sorry about that. Thanks, Jeff