#94 [Opn]: segmentation fault when connecting to database

From: Date: Mon, 13 Oct 2003 14:01:30 +0000
Subject: #94 [Opn]: segmentation fault when connecting to database
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-22649@lists.php.net to get a copy of this message
ID: 94 Updated by: datenpunk@php.net Reported By: nikolaj dot jansen at telfort dot nl Status: Open Bug Type: DB_DataObject Operating System: redhat linux PHP Version: 4.3.2 New Comment: Have you tried upgrading to the latest php version? You say you are using 4.3.2 on one host and 4.3.3RC3 on the other. A segfault usually is caused by php itself and not by PEAR but it makes no sense to file a bug for php if you don't use the most recent version. Previous Comments: ------------------------------------------------------------------------ [2003-10-13 09:49:13] nikolaj dot jansen at telfort dot nl nope, no optimizer installed... ------------------------------------------------------------------------ [2003-10-13 09:44:55] datenpunk@php.net Do you have Zend Optimizer enabled? Zend Optimizer has some problems with oeverload() AFAIK. Try to lower your optimization level in php.ini: zend_optimizer.optimization_level=14 hth Daniel Khan ------------------------------------------------------------------------ [2003-10-13 09:38:02] nikolaj dot jansen at telfort dot nl Description: ------------ segmentation fault when connecting to db. This happens only on our production server, not on my development machine (debian, php 4.3.3RC3). Both use latest DataObject version. Using exit(); at several points I found the offending line in function _connect(): // it's not currently connected! // try and work out what to use for the dsn ! $options= &$_DB_DATAOBJECT['CONFIG']; $dsn = @$this->_database_dsn; if (!$dsn) { if (!$this->_database) { #Offending line############ $this->_database = @$options["table_{$this->__table}"]; ###################### } if (@$this->_database && @$options["database_{$this->_database}"]) { $dsn = $options["database_{$this->_database}"]; } else if ($options['database']) { $dsn = $options['database']; } } Reproduce code: --------------- This is a dump of the $options array(17) { ["dont_die"]=> string(1) "0" ["database"]=> string(29) "mysql://root@localhost/websms" ["#schema_location"]=> string(15) "../../../../etc" ["schema_location"]=> string(35) "/home/sta01/www/testsite/etc/websms" ["class_location"]=> string(9) "generated" ["require_prefix"]=> string(12) "DataObjects/" ["class_prefix"]=> string(11) "WEBSMS_DBO_" ["ignore_sequence_keys"]=> string(0) "" ["extends_location"]=> string(18) "grap_dbo.class.php" ["extends"]=> string(8) "GRAP_DBO" ["generator_class_rewrite"]=> string(0) "" ["debug"]=> int(3) ["debug_force_updates"]=> string(1) "0" ["production"]=> string(1) "0" ["table_VoucherLog"]=> string(6) "websms" ["table_Statistics"]=> string(6) "websms" ["database_websms"]=> string(40) "mysql://websms:XXXXXXX@localhost/websms" } Expected result: ---------------- I expected it to happily connect ;) Actual result: -------------- Through a webbrowser a zero sized result, through command line a segmentation fault (no core dump) ------------------------------------------------------------------------ -- Edit this bug report at http://pear.php.net/bugs/bug.php?id=94&edit=1

« previous php.pear.dev (#22649) next »