View Issue Details

IDProjectCategoryView StatusLast Update
0002317XdebugCode Coveragepublic2025-02-03 11:50
Reporternielsdos Assigned Toderick  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version3.4.1 
Fixed in Version3.4dev 
Summary0002317: Code coverage leaks memory
Description

When running the xdebug test suite under ASAN I get a memory leak for a majority of the tests, originating in xdebug_code_coverage_start_of_function.
This happens because commit d3a8a6b0 guarded the xdebug_path_free call in xdebug_code_coverage_end_of_function by a NULL check on path->elements.
The original intention of the check was preventing a crash in xdebug_create_key_for_path, but this also prevents freeing the path.

Steps To Reproduce

Compile PHP with ASAN support, and run the xdebug test suite.

Additional Information

There's still a remaining leak in tests/coverage/bug01180.phpt caused by the fact that the path at the same level is overwritten instead of being freed + overwritten.
However, that's tangential.

TagsNo tags attached.
Operating SystemLinux
PHP Version8.3.10-8.3.19

Activities

nielsdos

2025-02-02 14:58

reporter   ~0007169

PR here: https://github.com/xdebug/xdebug/pull/993

derick

2025-02-03 11:50

administrator   ~0007170

Thanks for the patch, I have merged it!

Issue History

Date Modified Username Field Change
2025-02-02 14:57 nielsdos New Issue
2025-02-02 14:58 nielsdos Note Added: 0007169
2025-02-03 11:50 derick Assigned To => derick
2025-02-03 11:50 derick Status new => closed
2025-02-03 11:50 derick Resolution open => fixed
2025-02-03 11:50 derick Fixed in Version => 3.4dev
2025-02-03 11:50 derick Note Added: 0007170