Re: [PHP] php 5.0.5 segfaults apache2 on ubuntu, 5.0.4 ok

2005-10-25 Thread Petr Smith

I just found this is known bug and was already fixed in CVS.

http://bugs.php.net/bug.php?id=34450edit=2

thanks to all!

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] php 5.0.5 segfaults apache2 on ubuntu, 5.0.4 ok

2005-10-21 Thread Jon Hill

I think this could be related to your _destruct method
Can't you just rely on the parent class destruct method?
Sorry to be a bit vague, I'll look into it a little further.

Jon

I've just installed php 5.0.5 to newest ubuntu breezy and apache2
started (sometimes) segfaulting (teste two computers with ubuntu hoary
and ubuntu breezy - same results).

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] php 5.0.5 segfaults apache2 on ubuntu, 5.0.4 ok

2005-10-21 Thread Petr Smith

Hi,

thanks! that was it! when destruct method is removed, all problems are 
gone.


I really don't know why I added the __destruct method to this mysql 
wrapper. Maybe I saw it somewhere in discussion at php manual bottom


This code segfaults my apache:

?php

class test extends mysqli {
public function __construct() {
parent::__construct(localhost, root, , mysql);
}

public function __destruct() {
$this-close();
}
}

$obj = new test();

?

Accessing this page means immeadiate apacha segfault and actual 
connection close. Anybody please test this on 5.0.5 and verify if it's 
reproducible.


Petr


I think this could be related to your _destruct method
Can't you just rely on the parent class destruct method?
Sorry to be a bit vague, I'll look into it a little further.


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] php 5.0.5 segfaults apache2 on ubuntu, 5.0.4 ok

2005-10-21 Thread Jon Hill


 Accessing this page means immeadiate apacha segfault and actual 
connection close. Anybody please test this on 5.0.5 and verify if it's 
reproducible.


I am running PHP 5.0.5 on Apache 2 and get the following in my error log 
if I include the destruct method.


Jon

*** glibc detected *** /usr/local/apache/bin/httpd: free(): invalid 
pointer: 0x09bdca78 ***

=== Backtrace: =
/lib/libc.so.6[0x2a1424]
/lib/libc.so.6(__libc_free+0x77)[0x2a195f]
/usr/local/apache/modules/libphp5.so(my_no_flags_free+0x16)[0x1284da6]
/usr/local/apache/modules/libphp5.so(vio_delete+0x29)[0x12a20a9]
/usr/local/apache/modules/libphp5.so(end_server+0x3a)[0x129e74a]
/usr/local/apache/modules/libphp5.so(cli_advanced_command+0x129)[0x129e569]
/usr/local/apache/modules/libphp5.so(mysql_close+0x4d)[0x12a079d]
/usr/local/apache/modules/libphp5.so[0x11573b3]
/usr/local/apache/modules/libphp5.so(zend_objects_store_call_destructors+0x45)[0x125f091]
/usr/local/apache/modules/libphp5.so(shutdown_destructors+0x51)[0x1241f15]
/usr/local/apache/modules/libphp5.so(zend_call_destructors+0x49)[0x124c8d9]
/usr/local/apache/modules/libphp5.so(php_request_shutdown+0x3fa)[0x121acd6]
/usr/local/apache/modules/libphp5.so[0x127d87e]
/usr/local/apache/bin/httpd(ap_run_handler+0x3a)[0x80b6a1a]
/usr/local/apache/bin/httpd(ap_invoke_handler+0x56)[0x80b6d92]
/usr/local/apache/bin/httpd(ap_process_request+0x141)[0x809e929]
/usr/local/apache/bin/httpd[0x809a36d]
/usr/local/apache/bin/httpd(ap_run_process_connection+0x3a)[0x80c04c2]
/usr/local/apache/bin/httpd[0x80b51ba]
/usr/local/apache/bin/httpd[0x80b53a3]
/usr/local/apache/bin/httpd[0x80b5436]
/usr/local/apache/bin/httpd(ap_mpm_run+0x7b4)[0x80b5bf8]
/usr/local/apache/bin/httpd(main+0x57f)[0x80baec7]
/lib/libc.so.6(__libc_start_main+0xc6)[0x252de6]
/usr/local/apache/bin/httpd(apr_dbm_get_usednames_ex+0xbd)[0x807bad1]
=== Memory map: 
[Fri Oct 21 16:00:59 2005] [notice] child pid 3808 exit signal Aborted (6)

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] php 5.0.5 segfaults apache2 on ubuntu, 5.0.4 ok

2005-10-20 Thread Petr Smith

Hi,

I've just installed php 5.0.5 to newest ubuntu breezy and apache2
started (sometimes) segfaulting (teste two computers with ubuntu hoary
and ubuntu breezy - same results).

Is says something like this:

[Thu Oct 20 12:32:21 2005] [notice] child pid 13161 exit signal
Segmentation fault (11)
[Thu Oct 20 12:32:21 2005] [notice] child pid 13191 exit signal
Segmentation fault (11)

Apache2 is breezy version Server version: Apache/2.0.54
Server built:   Oct  4 2005 07:42:46

It does this only in some applications (for example phpMyAdmin works ok)
 but PHP 5.0.4 worked ok. I tried to isolate some code which do the
segfaults but withou big success.

This code could be involved.. I don't know. It works sometimes,
sometimes not.


this line maybe?: parent::__construct($config['host'],
$config['username'], $config['password'], $config['db']);


class MySQL extends mysqli {
static function getInstance($configuration) {
static $dbObj = null;

if (is_null($dbObj)) {
$dbObj = new Mysql($configuration);
}
return $dbObj;
}

function __construct($configuration) {
$config = $configuration-getDbConfig();

try {
parent::__construct($config['host'], 
$config['username'],
$config['password'], $config['db']);
} catch (WarningException $we) {
if (mysqli_connect_error()){
throw new DBConnectException(mysqli_connect_error(),
mysqli_connect_errno());
}
}   
parent::query(SET NAMES 'utf8');
}

   function __destruct() {
@$this-close(); 
   }

function query($query) {
if (($result = parent::query($query)) != false) {
if (eregi(^select, $query)) {
return new QueryResult($result);
} else {
return new QueryResult(false, 
$this-affected_rows);
}
} else {
throw new SQLException($this-error, $this-errno, 
$query);
}
}

function getInsertId() {
return $this-insert_id;
}
}



I think this is some new bug in 5.0.5 version and I want to help to fix
it. But I don't know how. What should I do?

Thanks,

Petr

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php