[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Debian sid, PHP cli, xdebug, set_error_handler, mysql_list_dbs, throw = Segmentation fault



On 3/17/2013 2:54 PM, Sven Uhlig wrote:
On 17.03.2013 16:01, Jerry Stuckle wrote:
On 3/17/2013 9:20 AM, Sven Uhlig wrote:
The following PHP code exits in "segmentation fault".

<?php
function error_handler() {
    throw new Exception;
}
set_error_handler('error_handler');
mysql_list_dbs();
?>

No segmentation fault if I do either of these things:
1) disable xdebug
2) don't set_error_handler
3) don't throw exception
4) throw exception after mysql_list_dbs but outside of error_handler

As I only wanted to use mysql_list_dbs() for testing purposes I don't
need an alternative solution. I know that this function is deprecated in
PHP5.4.

Some technical details:
$ strace php test.php 2>&1 |tail -n 3
read(3, "\7\0\0\2\0\0\0\2\0\0\0", 16384) = 11
--- SIGSEGV (Segmentation fault) @ 0 (0) ---
+++ killed by SIGSEGV +++

$ php -v
PHP 5.4.4-14 (cli) (built: Mar  4 2013 14:08:43)
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2012 Zend Technologies
      with Xdebug v2.2.1, Copyright (c) 2002-2012, by Derick Rethans

$ cat /etc/apt/sources.list
deb http://ftp2.de.debian.org/debian/ sid main non-free
deb-src http://ftp2.de.debian.org/debian/ sid main non-free

# (apt-get update && apt-get upgrade)|tail -n 1
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

# uname -a
Linux baldur 3.2.0-4-amd64 #1 SMP Debian 3.2.39-2 x86_64 GNU/Linux

Impossible to tell from the (lack of) information you supplied.

What do you need?

However,
personally, I would start with xdebug.  I've seen more problems with it
than anything else in your list.  I finally got rid of it.

As stated above, disabling xdebug does the trick. But that cannot be a
permanent solution and I think a segmentation fault is always worth fixing.

Sven.



Well, if it happened to me, I'd get a dump of the problem, preferably with a debug version of the binaries, and a trace leading up to the problem. Then I'd dig in and see where the problem lies.

But as I said before - my suspicion would be xdebug.


Reply to: