Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:26154 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 12978 invoked by uid 1010); 22 Oct 2006 20:45:30 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 12962 invoked from network); 22 Oct 2006 20:45:30 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 22 Oct 2006 20:45:30 -0000 Authentication-Results: pb1.pair.com smtp.mail=kingwez@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=kingwez@gmail.com; sender-id=pass; domainkeys=good Received-SPF: pass (pb1.pair.com: domain gmail.com designates 66.249.82.234 as permitted sender) DomainKey-Status: good X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: kingwez@gmail.com X-Host-Fingerprint: 66.249.82.234 wx-out-0506.google.com Linux 2.4/2.6 Received: from [66.249.82.234] ([66.249.82.234:3631] helo=wx-out-0506.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 1D/F7-54754-668DB354 for ; Sun, 22 Oct 2006 16:45:28 -0400 Received: by wx-out-0506.google.com with SMTP id s17so1674564wxc for ; Sun, 22 Oct 2006 13:45:24 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=UGmO2G9+98V0wtwdG6GoW+07zBUkvUy/YEZBrkhiEXbJDJ5sijRQ+Yzpjt3U9nNRBeVXMjP+DPoZCo2k1XlR5uTRpvppgy7Mkyr3MjUQS2oJiWPm4vZ3oEJEVUQCVyBE6+jdPCz3F8lU/3YR405KuZu2VJrA6hTahbtcnam0F2M= Received: by 10.90.81.14 with SMTP id e14mr1852432agb; Sun, 22 Oct 2006 13:45:24 -0700 (PDT) Received: by 10.90.101.11 with HTTP; Sun, 22 Oct 2006 13:45:24 -0700 (PDT) Message-ID: <4e89b4260610221345h32fcda7cv7cc1639d7a4b8b55@mail.gmail.com> Date: Sun, 22 Oct 2006 16:45:24 -0400 To: Gwynne Cc: internals@lists.php.net In-Reply-To: <7AC73514-422F-499B-A226-7C789046CAD8@skytag.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <7AC73514-422F-499B-A226-7C789046CAD8@skytag.com> Subject: Re: [PHP-DEV] Random PHP crash in erealloc() From: kingwez@gmail.com ("Wez Furlong") Two things to try: - run it under valgrind to see if it highlights code problems - try it on a different box. If it works on the other box, consider testing your ram as it may be faulty. --Wez. On 10/18/06, Gwynne wrote: > I'm experiencing a strange random crash in PHP 5.1.4 and 5.1.6 > triggered by several separate sections of code under a number of > circumstances. I can't narrow it down much, but the backtrace always > ends with: > > (gdb) bt > #0 0x081f80fe in _erealloc (ptr=0x8531b44, size=2, allow_failure=0) > at ./src/php-5.1.6/Zend/zend_alloc.c:387 > #1 0x08206e54 in add_string_to_string (result=0xbfffb7f0, > op1=0xbfffb7f0, op2=0x8520cb4) at ./src/php-5.1.6/Zend/ > zend_operators.c:1138 > #2 0x0822b36c in ZEND_ADD_STRING_SPEC_TMP_CONST_HANDLER > (execute_data=0xbfffb880) at zend_vm_execute.h:5019 > #3 0x08229718 in execute (op_array=0x851f590) at zend_vm_execute.h:92 > #4 0x08229b97 in zend_do_fcall_common_helper_SPEC > (execute_data=0xbfffba80) at zend_vm_execute.h:234 > > or > > (gdb) bt > #0 0x4068c654 in mallopt () from /lib/libc.so.6 > #1 0x4068b220 in realloc () from /lib/libc.so.6 > #2 0x081f811b in _erealloc (ptr=0x858d230, size=30, allow_failure=0) > at ./src/php-5.1.6/Zend/zend_alloc.c:388 > #3 0x08206e54 in add_string_to_string (result=0xbfffbdd8, > op1=0xbfffbdd8, op2=0x852e284) at ./src/php-5.1.6/Zend/ > zend_operators.c:1138 > #4 0x0822b36c in ZEND_ADD_STRING_SPEC_TMP_CONST_HANDLER > (execute_data=0xbfffc1a0) at zend_vm_execute.h:5019 > #5 0x08229718 in execute (op_array=0x8531cc0) at zend_vm_execute.h:92 > #6 0x08229b97 in zend_do_fcall_common_helper_SPEC > (execute_data=0xbfffc3c0) at zend_vm_execute.h:234 > > The PHP code in question is rather complicated and I've tried and > failed to isolate a smaller section that might be triggering this. > This PHP is built on i686-pc-linux-gnu (GNU/Linux 2.4.32), using both > GCC 3.3.5 and 4.0.2 (no difference between builds made with one vs > the other) with the following configure line: > > ./configure --prefix=$HOME/builds --enable-cgi --enable-force-cgi- > redirect --enable-cli --disable-short-tags --with-zlib --disable-ftp > --with-iconv=$HOME/builds --with-iconv-dir=$HOME/builds --with-mysql=/ > usr --enable-sockets --disable-debug --with-xsl=$HOME/builds --enable- > bcmath --with-gmp=$HOME/builds --with-imap=$HOME/builds/imap --with- > imap-ssl=/usr --with-xmlrpc --with-xml-dir=$HOME/builds --with- > mysqli=/usr/bin/mysql_config --disable-maintainer-zts --enable-zend- > multibyte --disable-mbstring --without-gd --enable-memory-limit -- > with-expat-dir=$HOME/builds --without-sqlite --disable-pdo --disable- > spl --disable-tokenizer --disable-simplexml --disable-ipv6 --with- > openssl=/usr --disable-pear --disable-spl --enable-discard-path -- > enable-xmlreader --enable-xmlwriter --enable-zip --with-libxml-dir= > $HOME/builds --with-mcrypt=$HOME/builds > > I have two custom-built extensions loading into PHP as well, but I > was able to eliminate them as the source of the problem by disabling > them entirely and verifying that it made no difference. Obviously, > I'm using the CGI SAPI. If I build with --enable-debug, the issue > immediately vanishes. My only guess at this would be some kind of > memory stomper, but I don't know enough about PHP internals to track > it down. I ran the full testsuite on every build (both 5.1.4 and > 5.1.6 showed exactly the same symptoms) with perfect results (save > the tests that always fail under normal circumstances). > > Can anyone offer any thoughts? I can't post the scripts I'm using, > but I need a non-"use the debug version and hope" solution if one > exists. > > -- Gwynne, Daughter of the Code > "This whole world is an asylum for the incurable." > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > >