MantisBT

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0001532XdebugRemote Debuggingpublic2018-03-06 18:282018-03-07 13:09
Reporterpilif 
Assigned Toderick 
PrioritynormalSeveritycrashReproducibilityalways
StatusclosedResolutionfixed 
PlatformDebian LinuxOSDebian LinuxOS Version9
Product Version2.6.0 
Target Version2.6.1Fixed in Version2.6.1 
Summary0001532: SIGABRT when using remote debugging and an error is thrown in eval()
DescriptionWhen using remote debugging and eval()ed code causes any kind of PHP error to be triggered, the interpreter will be killed by a SIGABRT because Xdebug is calling free() on a string literal.
Steps To ReproduceGiven the following test script:

---

<?php eval('trigger_error("flupp", E_USER_NOTICE);');

---

run

XDEBUG_CONFIG="idekey=something" php test.php

Expected results: no crash
Actual result: the interpreter is killed with a SIGABRT
Additional InformationThe bug is in xdebug_dbgp_notification() in xdebug_handler_dbgp.c where in case of eval, xdebug_xml_add_attribute_ex() is called with the "free_name" parameter set to 1, but the attribute name is a string literal, so the later called xdebug_xml_node_dtor() will try to free that literal which doesn't fly in later versions of the C library.
TagsNo tags attached.
Operating SystemReproducible every time in Debian 9 and macOS 10.13
PHP Version7.2.0-7.2.4
Attached Files

- Relationships
has duplicate 0001545resolvedderick Script using notice-generating eval crashes with trap 6 

-  Notes
(0004610)
pilif (reporter)
2018-03-06 20:32

note: in order to trigger the bug, you have to use a dbgp client that announces support for notifications. Otherwise xdebug doesn't report the error and thus doesn't trigger the crash.
(0004611)
derick (administrator)
2018-03-07 13:09

Fixed through a PR (https://github.com/xdebug/xdebug/pull/417 [^]) by the reporter. Thanks Philip!

- Issue History
Date Modified Username Field Change
2018-03-06 18:28 pilif New Issue
2018-03-06 20:32 pilif Note Added: 0004610
2018-03-07 13:08 derick Fixed in Version => 2.6.1
2018-03-07 13:08 derick Target Version => 2.6.1
2018-03-07 13:09 derick Note Added: 0004611
2018-03-07 13:09 derick Status new => closed
2018-03-07 13:09 derick Assigned To => derick
2018-03-07 13:09 derick Resolution open => fixed
2018-08-01 10:54 derick Relationship added has duplicate 0001545


Copyright © 2000 - 2018 MantisBT Team
Powered by Mantis Bugtracker