Skip to content

Conversation

@alexandre-daubois
Copy link
Member

@alexandre-daubois alexandre-daubois commented Sep 15, 2025

Fix #19801

Also fixes the same issue in debug_zval_dump(). I wasn't able to reproduce the issue with var_export() however.


Note: ext/standard/tests/general_functions/debug_zval_dump_gh19801_memory_leak.phpt should be updated on upmerge to add packed to the internal array representation

@alexandre-daubois alexandre-daubois linked an issue Sep 15, 2025 that may be closed by this pull request
@alexandre-daubois alexandre-daubois marked this pull request as ready for review September 15, 2025 09:05
@ndossche
Copy link
Member

What's wrong with zend_array_release (or similar)? Then you don't need zval wrapping

@alexandre-daubois
Copy link
Member Author

alexandre-daubois commented Sep 15, 2025

Nothing wrong apart that I forgot about it, tests still green with it on my machine. PR updated 🙂

Copy link
Member

@arnaud-lb arnaud-lb left a comment

Choose a reason for hiding this comment

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

Looks good to me! Thank you!

@alexandre-daubois alexandre-daubois merged commit 75217c1 into php:PHP-8.3 Sep 16, 2025
9 checks passed
@alexandre-daubois alexandre-daubois deleted the vd-leak branch September 16, 2025 13:05
alexandre-daubois added a commit that referenced this pull request Sep 16, 2025
* PHP-8.3:
  Fix GH-19801: address leak when calling var_dump() with recursion in __debugInfo() (#19837)
alexandre-daubois added a commit that referenced this pull request Sep 16, 2025
* PHP-8.4:
  Fix GH-19801: address leak when calling var_dump() with recursion in __debugInfo() (#19837)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

var_dump() may leak dumped value

3 participants