View Issue Details

IDProjectCategoryView StatusLast Update
0000133Xdebugpublic2005-08-10 18:10
Reporterkumar303 Assigned To 
PrioritynormalSeverityblockReproducibilityalways
Status closedResolutionopen 
Summary0000133: PHP scripts exits 0 with xdebug (backtrace enabled) on PHP error
Description

Xdebug 2.0 beta 2
a PHP program will exit 0 when any error occurs and xdebug backtrace is enabled (bug). If I set xdebug.default_enable=0 in ini or xdebug_disable() PHP exits as it should do on error (usually 127 I think). This is a major block for me because I have a test suite that runs scripts with the PHP binary and determines pass/fail from their exit status. And I would like to see the backtraces from my test suite! thanks for working on this much needed extension.

Additional Information

phpinfo()
PHP Version => 5.0.4

System => Linux dev 2.4.18-1-686 #1 Wed Apr 14 18:20:10 UTC 2004 i686
Build Date => May 12 2005 14:12:56
Configure Command => './configure' '--prefix=/vol2/php5' '--with-apxs=/vol2/php5/bin/apxs' '-with-config-file-scan-dir=/vol2/php5/lib/php' '--enable-shared' '--with-zlib=shared' '--with-curl=shared,/vol2/php5' '--with-mcrypt=shared,/vol2/php5' '--with-mhash=shared,/vol2/php5' '--with-openssl=shared' '--with-gettext=shared' '--with-gd=shared' '--enable-wddx=shared' '--with-jpg-dir=/usr' '--with-png-dir=/usr' '--enable-dba=shared' '--with-mysql=shared,/usr/local/mysql' '--with-pgsql=shared,/usr/local/pgsql' '--enable-soap=shared' '--enable-sysvshm=shared' '--enable-sysvmsg=shared' '--enable-sysvsem=shared' '--with-libxml-dir=/vol2/php5'
Server API => Command Line Interface
Virtual Directory Support => disabled
Configuration File (php.ini) Path => /vol2/php5/lib
Scan this dir for additional .ini files => /vol2/php5/lib/php
additional .ini files parsed => /vol2/php5/lib/php/php.ini

PHP API => 20031224
PHP Extension => 20041030
Zend Extension => 220040412
Debug Build => no
Thread Safety => disabled
IPv6 Support => enabled
Registered PHP Streams => php, file, http, ftp
Registered Stream Socket Transports => tcp, udp, unix, udg

This program makes use of the Zend Scripting Language Engine:
Zend Engine v2.0.4-dev, Copyright (c) 1998-2004 Zend Technologies
with Xdebug v2.0.0beta2, Copyright (c) 2002, 2003, 2004, by Derick Rethans


Configuration

PHP Core

Directive => Local Value => Master Value
allow_call_time_pass_reference => Off => Off
allow_url_fopen => On => On
always_populate_raw_post_data => Off => Off
arg_separator.input => & => &
arg_separator.output => & => &
asp_tags => Off => Off
auto_append_file => no value => no value
auto_globals_jit => On => On
auto_prepend_file => no value => no value
browscap => no value => no value
default_charset => no value => no value
default_mimetype => text/html => text/html
define_syslog_variables => Off => Off
disable_classes => no value => no value
disable_functions => no value => no value
display_errors => On => On
display_startup_errors => On => On
doc_root => no value => no value
docref_ext => no value => no value
docref_root => no value => no value
enable_dl => On => On
error_append_string => no value => no value
error_log => /vol2/php5/logs/php-error.log => /vol2/php5/logs/php-error.log
error_prepend_string => no value => no value
error_reporting => 2047 => 2047
expose_php => On => On
extension_dir => /vol2/php5/lib/php/extensions/no-debug-non-zts-20041030 => /vol2/php5/lib/php/extensions/no-debug-non-zts-20041030
file_uploads => On => On
highlight.bg => #FFFFFF => #FFFFFF
highlight.comment => #FF8000 => #FF8000
highlight.default => #0000BB => #0000BB
highlight.html => #000000 => #000000
highlight.keyword => #007700 => #007700
highlight.string => #DD0000 => #DD0000
html_errors => Off => On
ignore_repeated_errors => Off => Off
ignore_repeated_source => Off => Off
ignore_user_abort => Off => Off
implicit_flush => On => Off
include_path => .:/vol2/php5/lib/php => .:/vol2/php5/lib/php
log_errors => On => On
log_errors_max_len => 1024 => 1024
magic_quotes_gpc => Off => Off
magic_quotes_runtime => Off => Off
magic_quotes_sybase => Off => Off
mail.force_extra_parameters => no value => no value
max_execution_time => 0 => 30
max_input_time => 60 => 60
open_basedir => no value => no value
output_buffering => 0 => 4096
output_handler => no value => no value
post_max_size => 8M => 8M
precision => 14 => 14
register_argc_argv => On => Off
register_globals => Off => Off
register_long_arrays => Off => Off
report_memleaks => On => On
report_zend_debug => Off => Off
safe_mode => Off => Off
safe_mode_exec_dir => no value => no value
safe_mode_gid => Off => Off
safe_mode_include_dir => no value => no value
sendmail_from => no value => no value
sendmail_path => /usr/sbin/sendmail -t -i => /usr/sbin/sendmail -t -i
serialize_precision => 100 => 100
short_open_tag => On => On
SMTP => localhost => localhost
smtp_port => 25 => 25
sql.safe_mode => Off => Off
track_errors => Off => Off
unserialize_callback_func => no value => no value
upload_max_filesize => 2M => 2M
upload_tmp_dir => no value => no value
user_dir => no value => no value
variables_order => GPCS => GPCS
xmlrpc_error_number => 0 => 0
xmlrpc_errors => Off => Off
y2k_compliance => On => On
zend.ze1_compatibility_mode => Off => Off

ctype

ctype functions => enabled

curl

CURL support => enabled
CURL Information => libcurl/7.12.0 OpenSSL/0.9.6g zlib/1.1.4

dom

DOM/XML => enabled
DOM/XML API Version => 20031129
libxml Version => 2.6.10
HTML Support => enabled
XPath Support => enabled
XPointer Support => enabled
Schema Support => enabled
RelaxNG Support => enabled

ftp

FTP support => enabled

gd

GD Support => enabled
GD Version => bundled (2.0.28 compatible)
GIF Read Support => enabled
GIF Create Support => enabled
PNG Support => enabled
WBMP Support => enabled
XBM Support => enabled

iconv

iconv support => enabled
iconv implementation => glibc
iconv library version => 2.2.5

Directive => Local Value => Master Value
iconv.input_encoding => ISO-8859-1 => ISO-8859-1
iconv.internal_encoding => ISO-8859-1 => ISO-8859-1
iconv.output_encoding => ISO-8859-1 => ISO-8859-1

libxml

libXML support => active
libXML Version => 2.6.10
libXML streams => enabled

pcre

PCRE (Perl Compatible Regular Expressions) Support => enabled
PCRE Library Version => 4.5 01-December-2003

pgsql

PostgreSQL Support => enabled
PostgreSQL(libpq) Version => 7.4.2
Multibyte character support => enabled
SSL support => enabled
Active Persistent Links => 0
Active Links => 0

Directive => Local Value => Master Value
pgsql.allow_persistent => On => On
pgsql.auto_reset_persistent => Off => Off
pgsql.ignore_notice => Off => Off
pgsql.log_notice => Off => Off
pgsql.max_links => Unlimited => Unlimited
pgsql.max_persistent => Unlimited => Unlimited

posix

Revision => $Revision: 1.60.2.2 $

session

Session Support => enabled
Registered save handlers => files user sqlite
Registered serializer handlers => php php_binary

Directive => Local Value => Master Value
session.auto_start => Off => Off
session.bug_compat_42 => Off => Off
session.bug_compat_warn => On => On
session.cache_expire => 180 => 180
session.cache_limiter => nocache => nocache
session.cookie_domain => no value => no value
session.cookie_lifetime => 0 => 0
session.cookie_path => / => /
session.cookie_secure => Off => Off
session.entropy_file => no value => no value
session.entropy_length => 0 => 0
session.gc_divisor => 1000 => 1000
session.gc_maxlifetime => 1440 => 1440
session.gc_probability => 1 => 1
session.hash_bits_per_character => 5 => 5
session.hash_function => 0 => 0
session.name => PHPSESSID => PHPSESSID
session.referer_check => no value => no value
session.save_handler => files => files
session.save_path => no value => no value
session.serialize_handler => php => php
session.use_cookies => On => On
session.use_only_cookies => Off => Off
session.use_trans_sid => 0 => 0

SimpleXML

Simplexml support => enabled
Revision => $Revision: 1.139.2.4 $
Schema support => enabled

SPL

SPL support => enabled
Interfaces => RecursiveIterator, SeekableIterator
Classes => ArrayObject, ArrayIterator, CachingIterator, CachingRecursiveIterator, DirectoryIterator, FilterIterator, LimitIterator, ParentIterator, RecursiveDirectoryIterator, RecursiveIteratorIterator, SimpleXMLIterator

SQLite

SQLite support => enabled
PECL Module version => 2.0-dev $Id: sqlite.c,v 1.146.2.3 2004/09/26 01:41:40 wez Exp $
SQLite Library => 2.8.14
SQLite Encoding => iso8859

Directive => Local Value => Master Value
sqlite.assoc_case => 0 => 0

standard

Regex Library => Bundled library enabled
Dynamic Library Support => enabled
Path to sendmail => /usr/sbin/sendmail -t -i

Directive => Local Value => Master Value
assert.active => 1 => 1
assert.bail => 0 => 0
assert.callback => no value => no value
assert.quiet_eval => 0 => 0
assert.warning => 1 => 1
auto_detect_line_endings => 0 => 0
date.default_latitude => 31.7667 => 31.7667
date.default_longitude => 35.2333 => 35.2333
date.sunrise_zenith => 90.83 => 90.83
date.sunset_zenith => 90.83 => 90.83
default_socket_timeout => 60 => 60
safe_mode_allowed_envvars => PHP => PHP_
safe_mode_protected_env_vars => LD_LIBRARY_PATH => LD_LIBRARY_PATH
url_rewriter.tags => a=href,area=href,frame=src,input=src,form=fakeentry => a=href,area=href,frame=src,input=src,form=fakeentry
user_agent => no value => no value

tclink

TCLink PHP Module => 3.4-PHP-Linux-i686

tokenizer

Tokenizer Support => enabled

xdebug

xdebug support => enabled
Version => 2.0.0beta2

Supported protocols => Revision
DBGp - Common DeBuGger Protocol => $Revision: 1.66 $
GDB - GNU Debugger protocol => $Revision: 1.77 $
PHP3 - PHP 3 Debugger protocol => $Revision: 1.19 $

Directive => Local Value => Master Value
xdebug.allowed_clients => no value => no value
xdebug.auto_trace => Off => Off
xdebug.collect_includes => On => On
xdebug.collect_params => Off => Off
xdebug.collect_return => Off => Off
xdebug.default_enable => On => On
xdebug.dump.COOKIE => no value => no value
xdebug.dump.ENV => no value => no value
xdebug.dump.FILES => no value => no value
xdebug.dump.GET => no value => no value
xdebug.dump.POST => no value => no value
xdebug.dump.REQUEST => no value => no value
xdebug.dump.SERVER => no value => no value
xdebug.dump.SESSION => no value => no value
xdebug.dump_globals => On => On
xdebug.dump_once => On => On
xdebug.dump_undefined => Off => Off
xdebug.extended_info => On => On
xdebug.idekey => kumar => no value
xdebug.manual_url => http://www.php.net => http://www.php.net
xdebug.max_nesting_level => 100 => 100
xdebug.profiler_enable => Off => Off
xdebug.profiler_output_dir => /tmp => /tmp
xdebug.profiler_output_name => crc32 => crc32
xdebug.remote_autostart => Off => Off
xdebug.remote_enable => Off => Off
xdebug.remote_handler => dbgp => dbgp
xdebug.remote_host => localhost => localhost
xdebug.remote_mode => req => req
xdebug.remote_port => 9000 => 9000
xdebug.show_local_vars => Off => Off
xdebug.show_mem_delta => Off => Off
xdebug.trace_format => 0 => 0
xdebug.trace_options => 0 => 0
xdebug.trace_output_dir => /tmp => /tmp
xdebug.trace_output_name => crc32 => crc32

xml

XML Support => active
XML Namespace Support => active
libxml2 Version => 2.6.10

Additional Modules

Module Name

Environment

Variable => Value
PWD => /home/kumar/public_html/commerce.TR1/units
PHP4_APACHE_CONF => /usr/local/apache/conf/httpd.conf
LCE_DSN => host=dev dbname=test user=lce password=lue4Beer
PS1 => \u@\h:\w\$
PHP5_APACHE_CONF => /vol2/php5/conf/httpd.conf
USER => kumar
PHP_LCE_DSN => lfo_pgsql://lce:lue4Beer@127.0.0.1:5432/test
MAIL => /var/mail/kumar
OLDPWD => /home/kumar/public_html/reports.trunk/test
CVS_RSH => ssh
PYTHONPATH => /home/kumar/public_html/py-dist:/usr/local/lib/svn-python/:/home/kumar/public_html/py-dist:/usr/local/lib/svn-python/:/home/kumar/public_html/py-dist:/usr/local/lib/svn-python/:
LANG => C
SSH_CLIENT => 192.168.50.100 49899 22
LOGNAME => kumar
SHLVL => 1
PROMPT_COMMAND => echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD/#$HOME/~}\007"
SHELL => /bin/bash
CVSROOT => :local:/vol2/cvsroot
HOME => /home/kumar
TERM => vt100
PATH => /home/kumar/bin/:/home/kumar/public_html/reports.trunk/lib/LTest/bin:/home/kumar/public_html/py-dist/py/bin:/vol2/php5/bin:/usr/local/bin:/usr/local/pgsql/bin:/usr/local/apache/bin:/home/kumar/bin:/home/kumar/bin/:/home/kumar/public_html/reports.trunk/lib/LTest/bin:/home/kumar/public_html/py-dist/py/bin:/vol2/php5/bin:/usr/local/bin:/usr/local/pgsql/bin:/usr/local/apache/bin:/home/kumar/bin:/home/kumar/bin/:/home/kumar/public_html/py-dist/py/bin:/vol2/php5/bin:/usr/local/bin:/usr/local/pgsql/bin:/usr/local/apache/bin:/home/kumar/bin:/usr/bin:/bin:/usr/local/bin:/usr/bin/X11:/usr/games
SSHTTY => /dev/pts/8
=> /vol2/php5/bin/php

PHP Variables

Variable => Value
_SERVER["PWD"] => /home/kumar/public_html/commerce.TR1/units
_SERVER["PHP4_APACHE_CONF"] => /usr/local/apache/conf/httpd.conf
_SERVER["LCE_DSN"] => host=dev dbname=test user=lce password=lue4Beer
_SERVER["PS1"] => \u@\h:\w\$
_SERVER["PHP5_APACHE_CONF"] => /vol2/php5/conf/httpd.conf
_SERVER["USER"] => kumar
_SERVER["PHP_LCE_DSN"] => lfo_pgsql://lce:lue4Beer@127.0.0.1:5432/test
_SERVER["MAIL"] => /var/mail/kumar
_SERVER["OLDPWD"] => /home/kumar/public_html/reports.trunk/test
_SERVER["CVS_RSH"] => ssh
_SERVER["PYTHONPATH"] => /home/kumar/public_html/py-dist:/usr/local/lib/svn-python/:/home/kumar/public_html/py-dist:/usr/local/lib/svn-python/:/home/kumar/public_html/py-dist:/usr/local/lib/svn-python/:
_SERVER["LANG"] => C
_SERVER["SSH_CLIENT"] => 192.168.50.100 49899 22
_SERVER["LOGNAME"] => kumar
_SERVER["SHLVL"] => 1
_SERVER["PROMPT_COMMAND"] => echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD/#$HOME/~}\007"
_SERVER["SHELL"] => /bin/bash
_SERVER["CVSROOT"] => :local:/vol2/cvsroot
_SERVER["HOME"] => /home/kumar
_SERVER["TERM"] => vt100
_SERVER["PATH"] => /home/kumar/bin/:/home/kumar/public_html/reports.trunk/lib/LTest/bin:/home/kumar/public_html/py-dist/py/bin:/vol2/php5/bin:/usr/local/bin:/usr/local/pgsql/bin:/usr/local/apache/bin:/home/kumar/bin:/home/kumar/bin/:/home/kumar/public_html/reports.trunk/lib/LTest/bin:/home/kumar/public_html/py-dist/py/bin:/vol2/php5/bin:/usr/local/bin:/usr/local/pgsql/bin:/usr/local/apache/bin:/home/kumar/bin:/home/kumar/bin/:/home/kumar/public_html/py-dist/py/bin:/vol2/php5/bin:/usr/local/bin:/usr/local/pgsql/bin:/usr/local/apache/bin:/home/kumar/bin:/usr/bin:/bin:/usr/local/bin:/usr/bin/X11:/usr/games
_SERVER["SSH_TTY"] => /dev/pts/8
SERVER[""] => /vol2/php5/bin/php
_SERVER["PHP_SELF"] =>
_SERVER["SCRIPT_NAME"] =>
_SERVER["SCRIPT_FILENAME"] =>
_SERVER["PATH_TRANSLATED"] =>
_SERVER["DOCUMENT_ROOT"] =>
_SERVER["argv"] => Array
(
)

_SERVER["argc"] => 0
_ENV["PWD"] => /home/kumar/public_html/commerce.TR1/units
_ENV["PHP4_APACHE_CONF"] => /usr/local/apache/conf/httpd.conf
_ENV["LCE_DSN"] => host=dev dbname=test user=lce password=lue4Beer
_ENV["PS1"] => \u@\h:\w\$
_ENV["PHP5_APACHE_CONF"] => /vol2/php5/conf/httpd.conf
_ENV["USER"] => kumar
_ENV["PHP_LCE_DSN"] => lfo_pgsql://lce:lue4Beer@127.0.0.1:5432/test
_ENV["MAIL"] => /var/mail/kumar
_ENV["OLDPWD"] => /home/kumar/public_html/reports.trunk/test
_ENV["CVS_RSH"] => ssh
_ENV["PYTHONPATH"] => /home/kumar/public_html/py-dist:/usr/local/lib/svn-python/:/home/kumar/public_html/py-dist:/usr/local/lib/svn-python/:/home/kumar/public_html/py-dist:/usr/local/lib/svn-python/:
_ENV["LANG"] => C
_ENV["SSH_CLIENT"] => 192.168.50.100 49899 22
_ENV["LOGNAME"] => kumar
_ENV["SHLVL"] => 1
_ENV["PROMPT_COMMAND"] => echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD/#$HOME/~}\007"
_ENV["SHELL"] => /bin/bash
_ENV["CVSROOT"] => :local:/vol2/cvsroot
_ENV["HOME"] => /home/kumar
_ENV["TERM"] => vt100
_ENV["PATH"] => /home/kumar/bin/:/home/kumar/public_html/reports.trunk/lib/LTest/bin:/home/kumar/public_html/py-dist/py/bin:/vol2/php5/bin:/usr/local/bin:/usr/local/pgsql/bin:/usr/local/apache/bin:/home/kumar/bin:/home/kumar/bin/:/home/kumar/public_html/reports.trunk/lib/LTest/bin:/home/kumar/public_html/py-dist/py/bin:/vol2/php5/bin:/usr/local/bin:/usr/local/pgsql/bin:/usr/local/apache/bin:/home/kumar/bin:/home/kumar/bin/:/home/kumar/public_html/py-dist/py/bin:/vol2/php5/bin:/usr/local/bin:/usr/local/pgsql/bin:/usr/local/apache/bin:/home/kumar/bin:/usr/bin:/bin:/usr/local/bin:/usr/bin/X11:/usr/games
_ENV["SSH_TTY"] => /dev/pts/8
ENV[""] => /vol2/php5/bin/php

PHP License
This program is free software; you can redistribute it and/or modify
it under the terms of the PHP License as published by the PHP Group
and included in the distribution in the file: LICENSE

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

If you did not receive a copy of the PHP license, or have any
questions about PHP licensing, please contact license@php.net.

TagsNo tags attached.
Operating SystemLinux 2.4.18-1-686
PHP Version5.0.4

Activities

derick

2005-08-06 17:08

administrator   ~0000276

Do you have a short reproducing script, the following works fine here:

derick@kossu:~$ cat /tmp/foo.php
<?php
exit(56);

derick@kossu:~$ php-4.4dev /tmp/foo.php ; echo $?
56

kumar303

2005-08-09 22:22

reporter   ~0000278

sorry for delayed response ...
Yes, I can still reproduce it. Looks like your test did not produce an error first. Try a fatal error, like this:

$ php -r "call_to_undefined_fn();"
$ echo $?

I get 0 [the bug]
then, if I add :

$ php -r "xdebug_disable(); call_to_undefined_fn();"
$ echo $?

I get 255, as expected.

My environment is the same as when I first posted the bug. Let me know if you need anything else. thanks, K

derick

2005-08-10 18:10

administrator   ~0000279

Fixed in CVS.

Issue History

Date Modified Username Field Change
2005-07-21 18:08 kumar303 New Issue
2005-08-06 17:08 derick Note Added: 0000276
2005-08-09 22:22 kumar303 Note Added: 0000278
2005-08-10 18:10 derick Status new => closed
2005-08-10 18:10 derick Note Added: 0000279
2016-07-31 12:35 derick Category Debug client (console) => debugclient (debugging tool)
2016-07-31 12:35 derick Category debugclient (debugging tool) => (No Category)