Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:60701 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 42931 invoked from network); 1 Jun 2012 04:47:49 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 1 Jun 2012 04:47:49 -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.126 as permitted sender) X-PHP-List-Original-Sender: truth@proposaltech.com X-Host-Fingerprint: 98.139.212.126 nm22-vm0.bullet.mail.bf1.yahoo.com Received: from [98.139.212.126] ([98.139.212.126:27430] helo=nm22-vm0.bullet.mail.bf1.yahoo.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id F9/D0-45898-27948CF4 for ; Fri, 01 Jun 2012 00:47:49 -0400 Received: from [98.139.212.152] by nm22.bullet.mail.bf1.yahoo.com with NNFMP; 01 Jun 2012 04:47:44 -0000 Received: from [68.142.200.225] by tm9.bullet.mail.bf1.yahoo.com with NNFMP; 01 Jun 2012 04:47:43 -0000 Received: from [66.94.237.125] by t6.bullet.mud.yahoo.com with NNFMP; 01 Jun 2012 04:47:43 -0000 Received: from [127.0.0.1] by omp1030.access.mail.mud.yahoo.com with NNFMP; 01 Jun 2012 04:47:43 -0000 X-Yahoo-Newman-Id: 868906.54358.bm@omp1030.access.mail.mud.yahoo.com Received: (qmail 48514 invoked from network); 1 Jun 2012 04:47:43 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1338526063; bh=SvkioQoWuJDRCX6LFRbGr8ygzQ42AnlVNSjsmoRQmG0=; h=X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:Received:Subject:From:To:Content-Type:Date:Message-ID:Mime-Version:X-Mailer:Content-Transfer-Encoding; b=ir9yKNljWZoVNuzIl+hcXBD+S6E2VCRxdXSSb8Y6gR7SsR3mbwgW7doLoqMLgS7NYR8M4KJt0SjlVKU4YVEOR/x83HIX+fFFVpSteGq5HKUwhwOfHSQUtsu8Ie/4C7qCYSBd3ZyokZj8LzdnlUMVxoKBmIPMUWGXoTrmpH1U3Q4= X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: l_YnougVM1le.eIbw7C2ZIePjwjdGz_6fVpU12n.BgvWDAo 8sNJYXTlOkSwCkrprkHBLbp5Z23ImHVuL8xcAhd5iTX9YWsrcnypKR6Pf9Ks bT9_pQsAvT17F8rvjmQPVyC.UvBdKjAcHFlxNaI.tw5sA2WeBr9qMG1SJXJz mN74CmJk8vuKnLzM3C7HiGiOK7_sATZuvDdF4VwcP3q8AMTLvilxOS9TonD3 6N2RAcvffpE8swPsyGxRdZS_UzXrE3qzDCT4Ssf7KMPklwUkgBEowRMKXJSo cj6FD4zQJSPkRlYy9zqi0Tr4v0cfXH4oGJe208uTlIE0mxSsfQbcOwyFqYwO aP05Rda7_pE9Ct_bcPM47P8koEvoBnCgUlQlJuA5RxJLBxGHYTTSMiRm6.Es AuX3FJD9U5Obyxes.cR1DPv.VVWHMOz_YyFTuggQ- X-Yahoo-SMTP: jWG9jiaswBBOCHlPTWD9zJWRnNyiDJE- Received: from [192.168.2.102] (truth@70.230.205.60 with login) by smtp105.sbc.mail.ne1.yahoo.com with SMTP; 01 Jun 2012 04:47:43 +0000 UTC To: internals@lists.php.net Content-Type: text/plain; charset="ISO-8859-1" Date: Thu, 31 May 2012 21:47:42 -0700 Message-ID: <1338526062.9578.83.camel@inspiron> Mime-Version: 1.0 X-Mailer: Evolution 2.30.1.2 Content-Transfer-Encoding: 7bit Subject: Bad eval() leading to response code 500 From: truth@proposaltech.com (Todd Ruth) 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 always gives success. In my big ugly application, 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 the above example ('$y=0+;'). 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