Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:60702 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 44494 invoked from network); 1 Jun 2012 05:00:42 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 1 Jun 2012 05:00:42 -0000 Authentication-Results: pb1.pair.com header.from=truth@proposaltech.com; sender-id=softfail Authentication-Results: pb1.pair.com smtp.mail=truth@proposaltech.com; spf=softfail; sender-id=softfail Received-SPF: softfail (pb1.pair.com: domain proposaltech.com does not designate 98.139.212.186 as permitted sender) X-PHP-List-Original-Sender: truth@proposaltech.com X-Host-Fingerprint: 98.139.212.186 nm27.bullet.mail.bf1.yahoo.com Received: from [98.139.212.186] ([98.139.212.186:21443] helo=nm27.bullet.mail.bf1.yahoo.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 0C/21-45898-87C48CF4 for ; Fri, 01 Jun 2012 01:00:41 -0400 Received: from [98.139.212.152] by nm27.bullet.mail.bf1.yahoo.com with NNFMP; 01 Jun 2012 05:00:37 -0000 Received: from [68.142.200.227] by tm9.bullet.mail.bf1.yahoo.com with NNFMP; 01 Jun 2012 05:00:37 -0000 Received: from [66.94.237.104] by t8.bullet.mud.yahoo.com with NNFMP; 01 Jun 2012 05:00:37 -0000 Received: from [127.0.0.1] by omp1009.access.mail.mud.yahoo.com with NNFMP; 01 Jun 2012 05:00:37 -0000 X-Yahoo-Newman-Id: 849774.76472.bm@omp1009.access.mail.mud.yahoo.com Received: (qmail 31373 invoked from network); 1 Jun 2012 05:00:37 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1338526837; bh=rHL+Ci8+Pwj0t1zW72yD3c+AiPbocRLoJX9sbvOqTY8=; h=X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:Received:Subject:From:Reply-To:To:In-Reply-To:References:Content-Type:Date:Message-ID:Mime-Version:X-Mailer:Content-Transfer-Encoding; b=LJFMdKAC10XYPCv2dB9f1CISaAFZooqUtG66o+n/N0prFg9idmbgEi7nNthsM2JPQK2UuRiRw5fbJHyRNliaIw/6RV0iJYZ2Kv0LCH9p7t+3kVnb9BhxrI+t1jpJ3AhoJ9cDO53Tl1TAaAhDVZ81ww8wysD83qXEMwMpoNZyqgg= X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: IizUxrEVM1kTo6StQqBF5TEpvyJzNUcafqqGR0gPrNUvfpz SBEhtAbrUzgt295e40k0Qp7qfL3Q56ClxSsDAZ1BpYfB9U1CVF_wSZmOIE.Z 5zEnUNlRByHqvtR0KjklTVmuWtG.5QYlWwlRpCtRF_ug5HTAMKn4JmnmbHej TShhj3uERfS2fVtVzhmoRqGk2s09xy47Kt64tGUhpzULZQ6Skn8bFDdLWv6p CEFS7E76CZC6ROOagc9touPnlmUTv0ZC4w9Yhj5R4Orq3yb8UgQf3FFmUzg8 aEeyDP.BIlenlAQCiUu3.EPwILqZOth_o4fk_sj3Xsldbi8.3e58oEZRJf.4 7rHPLSq7jXQU9gw6O0A9u1IACp07K5Ix5nAYjMNF0lg2.EzHioEjNI9pYbXT iFDJUZoAvmTAT.wh2.sm6uIEDa5ybTKBFltE8aZw- X-Yahoo-SMTP: jWG9jiaswBBOCHlPTWD9zJWRnNyiDJE- Received: from [192.168.2.102] (truth@70.230.205.60 with login) by smtp112.sbc.mail.ne1.yahoo.com with SMTP; 31 May 2012 22:00:37 -0700 PDT Reply-To: truth@proposaltech.com To: internals@lists.php.net In-Reply-To: <1338526062.9578.83.camel@inspiron> References: <1338526062.9578.83.camel@inspiron> Content-Type: text/plain; charset="ISO-8859-1" Date: Thu, 31 May 2012 22:00:36 -0700 Message-ID: <1338526836.9578.94.camel@inspiron> Mime-Version: 1.0 X-Mailer: Evolution 2.30.1.2 Content-Transfer-Encoding: 7bit Subject: Re: Bad eval() leading to response code 500 From: truth@proposaltech.com (Todd Ruth) [I'm afraid of getting flamed for how bad the code was in the example in my first email. I've replaced the example in this email. The rest is the same. The example still isn't great, but it's better than before.] It feels like there is a bug in php somewhere. I'm trying to debug this myself before filing a report and am in over my head. The short version of my question may be "How do I set a watch on SG(sapi_headers).http_response_code in the gdb?" I think I need to debug it myself because I haven't been able to reproduce it in a simple case. The following simple case works: That example doesn't return code 500. But my big ugly application does. I get a response code 500 if the eval is given poorly formed code. The exact same request is processed happily if the eval of poorly formed code is commented out or replaced with an eval of good code. The poorly formed code can be as simple as in the above example. I've rebuilt apache 1.3.37 so that I can use gdb. (I'm using php 5.4.3) After about 10 hours I've only gotten as far as learning that r->status becomes 500 while the headers are being prepared at the time of the print. That happens in mod_php5.c on line 231: r->status = SG(sapi_headers).http_response_code; I guess my next step is to find out when SG(sapi_headers).http_response_code became 500. Given that the problem appears/goes away based on whether the eval is given bad code, I'm guessing the response_code is being affected by the eval(), but I'd like to be more concrete about it and maybe even be able to come up with a fix (or at least a good enough description that someone who really understands internals can come up with a fix without much trouble). Perhaps I've completely misunderstood something about php and should be directing this to a different list. My confidence is high that a bad eval() shouldn't ruin the page, so I'm here looking for debugging advice. If I'm in the wrong place, I apologize. Thanks for any pointers! - Todd