Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:14543 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 87616 invoked by uid 1010); 2 Feb 2005 23:11:04 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 87542 invoked from network); 2 Feb 2005 23:11:03 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 2 Feb 2005 23:11:03 -0000 X-Host-Fingerprint: 208.251.75.60 mail.faxwatch.com Linux 2.4/2.6 Received: from ([208.251.75.60:37253] helo=mail.faxwatch.com) by pb1.pair.com (ecelerity HEAD (r4105:4106)) with SMTP id 79/08-25397-40E51024 for ; Wed, 02 Feb 2005 18:11:00 -0500 Received: by mail.faxwatch.com (Postfix, from userid 104) id 3FF07B14187; Wed, 2 Feb 2005 16:10:47 -0700 (MST) Received: from [192.168.0.231] (unknown [192.168.0.231]) by mail.faxwatch.com (Postfix) with ESMTP id 146A9B1411C for ; Wed, 2 Feb 2005 16:10:47 -0700 (MST) Mime-Version: 1.0 (Apple Message framework v619.2) Content-Transfer-Encoding: 7bit Message-ID: <8db0b0f12ba0c7d3445ec67fc0391112@uhduh.com> Content-Type: text/plain; charset=US-ASCII; format=flowed To: internals@lists.php.net Date: Wed, 2 Feb 2005 16:11:26 -0700 X-Mailer: Apple Mail (2.619.2) Subject: PHP 5.0.3 Variable Bug or Something More? From: me@uhduh.com (Chris Cowan) I've ran across some strangeness which I can't figure out. When I run the following code I get a Seg Fault / Bus Error in my apache log (SegFault on Linux and Bus Error on Mac OS X). $rate_id = Core_Request::get('rate_id','integer',true); $plan_id = Core_Request::get('plan_id','integer',true); $min_seats = Core_Request::get('min_seats','integer',true); $max_seats = Core_Request::get('max_seats','integer',true); $rate = Core_Request::get('rate','float',true); $DB = Core_DB::getInstance(); $query = "update subscription_prices set "; $query .= "min_seats = $min_seats , "; $query .= "max_seats = $max_seats , "; $query .= "rate = $rate "; $query .= "where plan_id = $plan_id "; $query .= "and rate_id = $rate_id "; $DB->query($query); $DB->commit(); When I change the variable from $max_seats to $_max the error goes away. Also it appears that the $DB->query(); and $DB->commit(); calls are being executed and the session is being written to the database. I've also had this happen on the following: $flat_rate = Core_Request::get('flat_rate','float',true); $flat_seats = Core_Request::get('flat_seats','integer',true); $plan_id = Core_Request::get('plan_id','integer',true); $DB = Core_DB::getInstance(); $query = "update subscription_plans set "; $query .= "flat_seats = $flat_seats , "; $query .= "flat_rate = $flat_rate "; $query .= "where plan_id = $plan_id "; $DB->query($query); $DB->commit(); To fix this I ended up changing the name of the variables from $flat_seats and $flat_rate to $seats and $rates to get the bus error to disappear. I've tested this on Mac OS X Client 10.3.7 running Apache 1.3.33 and PHP 5.0.3 as well as Debian Linux with the same set up. Here is the output from "ktrace httpd -X" with the crash at the bottom. http://www.fwi-archive.com/~chris/debug.txt Let me know if you need any more information. Chris Cowan