Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:25258 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 38662 invoked by uid 1010); 9 Aug 2006 10:55:02 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 38624 invoked from network); 9 Aug 2006 10:55:01 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 9 Aug 2006 10:55:01 -0000 Authentication-Results: pb1.pair.com header.from=rquadling@googlemail.com; domainkeys=good DomainKey-Status: good X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: rquadling@googlemail.com X-Host-Fingerprint: 64.233.166.181 py-out-1112.google.com Linux 2.4/2.6 Received: from ([64.233.166.181:28595] helo=py-out-1112.google.com) by pb1.pair.com (ecelerity 2.1.1.3 r(11751M)) with ESMTP id 43/50-30310-CEBB9D44 for ; Wed, 09 Aug 2006 06:41:49 -0400 Received: by py-out-1112.google.com with SMTP id t32so245906pyc for ; Wed, 09 Aug 2006 03:41:46 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=googlemail.com; h=received:message-id:date:from:reply-to:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=VBEbNPF1rwiiqfEFc1oGbdoq50RhnU9+u4fibBCiHFT7L8ajOxzUIfP4YFcX85a7vQLef0gN308dnr81IZbzi5oAuDRsu+IRiV7VWLbrBSR14P1o32kvLTI+jzO6m1Bv/6a9Y3JPCLhHEcz2ia5IzsbVL1lkJP104wf9+pozsk4= Received: by 10.35.77.1 with SMTP id e1mr1252259pyl; Wed, 09 Aug 2006 03:41:45 -0700 (PDT) Received: by 10.35.93.18 with HTTP; Wed, 9 Aug 2006 03:41:44 -0700 (PDT) Message-ID: <10845a340608090341o30a1cd08lf0dbc1c8200e473e@mail.gmail.com> Date: Wed, 9 Aug 2006 11:41:44 +0100 Reply-To: RQuadling@GoogleMail.com To: "PHP Developers Mailing List" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Subject: Assist in debugging a crash. From: rquadling@googlemail.com ("Richard Quadling") Hi. I'm getting a crash with the new Win32 Snapshot - PHP 5.2.0RC2-dev (cli) (built: Aug 9 2006 08:20:48) / PHP Version 5.2.0RC2-dev Build Date Aug 9 2006 08:15:12 (for ISAPI) (From DrWatson for CLI) AppName: php.exe AppVer: 5.2.0.0 ModName: php5ts.dll ModVer: 5.2.0.0 Offset: 00009f78 (From Browser for ISAPI) PHP has encountered an Access Violation at 00F19F78 Using Depends.exe, that address is closest to _zend_mm_free (0x9D30) and _zend_mm_realloc (0xA030) These functions follow each other in zend_alloc.c. The userland code was working before I upgraded the snapshot. I've done all the usual stuff like removing extensions and Zend Optimizer. I'm having the problem with the CLI and ISAPI versions. What can I do to identify the problem further. The script which causes the problem is quite large. I'm not able to reproduce a simple case for the problem. Is there a debug version available for PHP and if so, what debugger should I use? The actual line of code for which the script fails is trivial (the echos are debugs I've added to find the problem) ... // Works. $headers = str_replace(CRLF.'.', CRLF.'..', trim(implode(CRLF, $this->headers))); echo "\n\n" , __FILE__, ' ' , __LINE__, ' ', strlen($this->body); // Crashes. $body = str_replace(CRLF . '.', CRLF . '..', $this->body); echo "\n\n" , __FILE__, ' ' , __LINE__; If I ... // Works. $headers = str_replace(CRLF.'.', CRLF.'..', trim(implode(CRLF, $this->headers))); echo "\n\n" , __FILE__, ' ' , __LINE__, ' ', strlen($this->body); // Works. $b1 = $this->body; echo "\n\n" , __FILE__, ' ' , __LINE__, ' ', strlen($b1), ' ', strlen($this->body); // Crashes. $body = str_replace("\r\n.", "\r\n..", $b1); echo "\n\n" , __FILE__, ' ' , __LINE__; If I ... // Works. $headers = str_replace(CRLF.'.', CRLF.'..', trim(implode(CRLF, $this->headers))); echo "\n\n" , __FILE__, ' ' , __LINE__, ' ', strlen($this->body); // Works. $b1 = $this->body; echo "\n\n" , __FILE__, ' ' , __LINE__, ' ', strlen($b1), ' ', strlen($this->body); // File saved and then crash. $b2 = file_put_contents('C:/data.txt', $b1); // Not reached. echo "\n\n" , __FILE__, ' ' , __LINE__, ' ', var_export($b2, True); $body = str_replace("\r\n.", "\r\n..", $b1); echo "\n\n" , __FILE__, ' ' , __LINE__; I looked at the data directly. The data is an HTML email with some CSS in it. Some of the CSS is like ... /* Success's have a green background */ .MAction_Success_TH { background-color : #00FF00; } .MTable_Action_TD { background-color : #DFDFDF; } .MTitle_Action_TH { background-color : #7F7FFF; } .MTitle_TH { background-color : #007FFF; } By putting a space in front of the '.', this has solved the problem. e.g. /* Success's have a green background */ .MAction_Success_TH { background-color : #00FF00; } .MTable_Action_TD { background-color : #DFDFDF; } .MTitle_Action_TH { background-color : #7F7FFF; } .MTitle_TH { background-color : #007FFF; } I've NO idea why. Please remember that the code was working BEFORE the snapshot and I've been stupid and not kept the old version. I will in future. -- ----- Richard Quadling Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731 "Standing on the shoulders of some very clever giants!"