Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:9168 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 66770 invoked by uid 1010); 15 Apr 2004 10:41:10 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 66661 invoked from network); 15 Apr 2004 10:41:09 -0000 Received: from unknown (HELO main.gmane.org) (80.91.224.249) by pb1.pair.com with SMTP; 15 Apr 2004 10:41:09 -0000 Received: from root by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 1BE4Iv-0006qf-00 for ; Thu, 15 Apr 2004 12:41:09 +0200 Received: from ns1.enidan.ch ([217.8.216.11]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 15 Apr 2004 12:41:09 +0200 Received: from per by ns1.enidan.ch with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 15 Apr 2004 12:41:09 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: internals@lists.php.net Date: Thu, 15 Apr 2004 12:29:12 +0200 Lines: 41 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit X-Gmane-NNTP-Posting-Host: ns1.enidan.ch User-Agent: KNode/0.7.2 Sender: news Subject: what is the reasonable thing to with a segfault in php? From: per@computer.org (Per Jessen) Hi, I've got a situation where a seemingly innocent statement produces a segfault. I've tried reducing it to a single reproducable testcase, but without success. The problem is however solidly reproducable in the context in which it occurs. I'm *certain* it is caused by a mistake in *my* code, but I feel it isn't exactly appropriate for php to segfault because of a user error? Very briefly, this is an excerpt where the segfault occurs:

"; $result=mysql_query( $q ) or die("mysql:".mysql_error()); $main_address=mysql_fetch_array( $result, MYSQL_ASSOC ); $q=""; $result=mysql_query( $q ) or die(mysql_error()); $billing_address=mysql_fetch_array( $result, MYSQL_ASSOC ); $q=""; $result=mysql_query( $q ) or die(mysql_error()); $technical_address=mysql_fetch_array( $result, MYSQL_ASSOC ); $editmain=strcasecmp($_REQUEST['contact'],"main")==0; //$editbilling=strcasecmp($_REQUEST['contact'],"billing")==0; //$edittechnical=strcasecmp($_REQUEST['contact'],"technical")==0; ?> If I uncomment either of the last 2 commented-out statements, I get a segfault. I'm using php 4.3.4 and apache 2.0.49 on linux 2.4.24. mysql is 4.0.15. /Per Jessen, Zurich