Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/base/base.c
Original file line number Diff line number Diff line change
Expand Up @@ -1043,6 +1043,8 @@ static void xdebug_error_cb(int orig_type, zend_string *error_filename, const un
xdebug_debugger_error_cb(error_filename, error_lineno, type, error_type_str, ZSTR_VAL(message));

xdfree(error_type_str);

xdebug_old_error_cb(orig_type, error_filename, error_lineno, message);

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was an important bug, we had removed calling the existing php error handler and this resulted in several issues

}
#else
static void xdebug_error_cb(int orig_type, const char *error_filename, const unsigned int error_lineno, zend_string *message)
Expand Down
9 changes: 8 additions & 1 deletion src/debugger/com.c
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,7 @@ static zval *get_client_discovery_address(char **header)
xdfree(header_name);
}

xdebug_arg_dtor(headers);

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Includes some fixes to memory leaks found by USBAN. These had not been seen before because the tests that run this code were skipped

return NULL;
}

Expand Down Expand Up @@ -481,13 +482,19 @@ static void xdebug_init_normal_debugger(xdebug_str *connection_attempts)
remote_addr = get_client_discovery_address(&header);

if (remote_addr && strstr(Z_STRVAL_P(remote_addr), "://")) {
header = NULL;
if (header) {
xdfree(header);
header = NULL;
}
xdebug_log_ex(XLOG_CHAN_DEBUG, XLOG_WARN, "INVADDR", "Invalid remote address provided containing URI spec '%s'.", Z_STRVAL_P(remote_addr));

remote_addr = NULL;
}

if (!remote_addr) {
if (header) {
xdfree(header);
}
xdebug_str_add_fmt(connection_attempts, "%s:%ld (fallback through xdebug.client_host/xdebug.client_port)", XINI_DBG(client_host), XINI_DBG(client_port));
xdebug_log_ex(XLOG_CHAN_DEBUG, XLOG_WARN, "HDR", "Could not discover client host through HTTP headers, connecting to configured address/port: %s:%ld.", XINI_DBG(client_host), (long int) XINI_DBG(client_port));

Expand Down
17 changes: 0 additions & 17 deletions tests/base/bug01048-002.phpt

This file was deleted.

12 changes: 0 additions & 12 deletions tests/base/bug01048.inc

This file was deleted.

40 changes: 0 additions & 40 deletions tests/debugger/bug00494-php80.phpt

This file was deleted.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After removing the tests that targeted versions lower than 8.2 we sometimes were left with versions of the tests which targeted all the versions that we handle. In that case it does not make sense to name them with a specific version, so I renamed them

Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
--TEST--
Test for bug #494: Private attributes of parent class unavailable when inheriting (>= PHP 8.1)
Test for bug #494: Private attributes of parent class unavailable when inheriting
--SKIPIF--
<?php
require __DIR__ . '/../utils.inc';
check_reqs('PHP >= 8.1; dbgp');
check_reqs('dbgp');
?>
--FILE--
<?php
Expand Down
60 changes: 0 additions & 60 deletions tests/debugger/bug00614-php80.phpt

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
--TEST--
Test for bug #614: local variables loses class members (>= PHP 8.1)
Test for bug #614: local variables loses class members
--SKIPIF--
<?php
require __DIR__ . '/../utils.inc';
check_reqs('PHP >= 8.1; dbgp');
check_reqs('dbgp');
?>
--FILE--
<?php
Expand Down
1 change: 0 additions & 1 deletion tests/debugger/bug00790-001.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ Test for bug #790: Debugging with > PHP 5.4 and stderr/stdout doesn't work [1]
<?php
require __DIR__ . '/../utils.inc';
check_reqs('dbgp');
if (is_stripped_debugger()) die('skip Known issue in stripped build');

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug fixed by the change in the error callback

?>
--FILE--
<?php
Expand Down
3 changes: 1 addition & 2 deletions tests/debugger/bug00990-002.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ Test for bug #990: DBGP: Add notification for notices, warnings and errors
<?php
require __DIR__ . '/../utils.inc';
check_reqs('dbgp');
if (is_stripped_debugger()) die('skip Known issue in stripped build');
?>
--FILE--
<?php
Expand Down Expand Up @@ -39,7 +38,7 @@ dbgpRunFile( $filename, $commands );

-> step_into -i 4
<?xml version="1.0" encoding="iso-8859-1"?>
<notify xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" name="error"><xdebug:message filename="file://bug00990-002.inc" lineno="3" type="Fatal error"><![CDATA[Uncaught Error: Class %cMyClass%c not found]]></xdebug:message></notify>
<notify xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" name="error"><xdebug:message filename="file://bug00990-002.inc" lineno="3" type="Fatal error"><![CDATA[Uncaught Error: Class %cMyClass%c not found %A thrown]]></xdebug:message></notify>

<?xml version="1.0" encoding="iso-8859-1"?>
<response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="step_into" transaction_id="4" status="stopping" reason="ok"></response>
Expand Down
3 changes: 1 addition & 2 deletions tests/debugger/bug00990-003.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ Test for bug #990: DBGP: Add notification for notices, warnings and errors
<?php
require __DIR__ . '/../utils.inc';
check_reqs('dbgp');
if (is_stripped_debugger()) die('skip Known issue in stripped build');
?>
--FILE--
<?php
Expand Down Expand Up @@ -39,7 +38,7 @@ dbgpRunFile( $filename, $commands );

-> step_into -i 4
<?xml version="1.0" encoding="iso-8859-1"?>
<notify xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" name="error"><xdebug:message filename="file://bug00990-003.inc" lineno="3" type="Fatal error"><![CDATA[Uncaught Error: Class %cMyClass%c not found]]></xdebug:message></notify>
<notify xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" name="error"><xdebug:message filename="file://bug00990-003.inc" lineno="3" type="Fatal error"><![CDATA[Uncaught Error: Class %cMyClass%c not found %A thrown]]></xdebug:message></notify>

<?xml version="1.0" encoding="iso-8859-1"?>
<response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="step_into" transaction_id="4" status="stopping" reason="ok"></response>
Expand Down
54 changes: 0 additions & 54 deletions tests/debugger/bug01048-001.phpt

This file was deleted.

12 changes: 0 additions & 12 deletions tests/debugger/bug01048.inc

This file was deleted.

Loading
Loading