Uh oh!
There was an error while loading. Please reload this page.
Support neighbouring extension in the ZendMM custom handlers hook in zend_test - #12792
Support neighbouring extension in the ZendMM custom handlers hook in zend_test#12792realFlowControl wants to merge 1 commit into
zend_test#12792Conversation
dd9c57c to
8eab44fCompare8eab44f to
6d67096Compare6d67096 to
4838205ComparerealFlowControl
commented
Feb 15, 2024
@bwoebi can I ping you to review this PR? |
| int flag = 0; | ||
| memcpy(&flag, heap, sizeof(int)); | ||
| int new_flag = 0; | ||
| memcpy(heap, &new_flag, sizeof(int)); |
There was a problem hiding this comment.
Yeah, no.
It works, but we should not do it this way, especially not advertise that in php-src itself.
You probably should include a
#ifndef ZEND_ALLOC_HIDE_STRUCTS
struct _zend_mm_heap {
#if ZEND_MM_CUSTOM
int use_custom_mm_heap;
#endif
}
#endif
to zend_alloc.h, with #define ZEND_ALLOC_HIDE_STRUCTS 1 in zend_alloc.c
and have it public API.
If we rely on such implementation details, it can well just be public.
There was a problem hiding this comment.
Hmm, I get the point and the zend_test_prepare_zendmm_for_call() is super ugly 😉
OTOH I would rather not make the use_custom_mm_heap flag public just for the sake of this test.
I am about to prepare a PR that would add a gc and shutdown custom handler (#13432) that might help solve this.
realFlowControl
commented
Jun 17, 2024
Closing this in favour of #13432 |
This PR will add support for neighouring extensions in the
zend_mm_set_custom_handlers()hook, asUSE_ZEND_ALLOC=0technically installs a custom memory handler in the ZendMM and is used for the ASAN tests.This realtes to #12768 and #12758
As the PHP 8.1 merge window has closed, this targets PHP 8.2