Skip to content

Conversation

@twose
Copy link
Member

@twose twose commented Jul 10, 2020

HashTable was reallocated (zend_hash_packed_grow) during php_var_dump, so we should call GC_ADDREF to make SEPARATE_ARRAY work

var_dump should have been treated as a read-only function, but the output handler breaks this

It looks like this bug affects all PHP versions

Copy link
Member

@nikic nikic left a comment

Choose a reason for hiding this comment

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

Test failures unrelated. This should be applied to 7.3 upwards.

@php-pulls php-pulls closed this in 150504e Jul 10, 2020
@twose twose deleted the bug79821 branch July 10, 2020 22:24
@twose
Copy link
Member Author

twose commented Jul 11, 2020

@nikic

I'm sorry for my wrong operation...when I applied this patch to PHP7.3, the git committed the changes to the wrong line
I submitted a new patch immediately to prevent other developers' programs from crashing, also solved the segfaults located in debug_zval_dump and var_export

56dec3c

the patch applied to debug_zval_dump solved the segfault, but break the tests about refcount (also breaks the backward compatibility of debug_zval_dump), do you have any ideas?

@nikic
Copy link
Member

nikic commented Jul 11, 2020

@twose Can you just print refcount - 1 in debug_zval_dump, to compensate for the added ref?

@twose
Copy link
Member Author

twose commented Jul 11, 2020

OK, that‘s what I thought too :)

@twose
Copy link
Member Author

twose commented Jul 11, 2020

@nikic
twose@0fae877
Does it look ok? or just Z_REFCOUNT_P(struc) - 1

@nikic
Copy link
Member

nikic commented Jul 11, 2020

@twose I would just use Z_REFCOUNT_P(struc) - 1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants