I wasn't serious about removing them.

Anyway zend_alloc.c and zend_hash.c don't work with shared memory.
It's possible to reuse zend_alloc.c to allocate blocks from SHM, but it's not its primary purpose. If APC don't do it I don't see how this block/unblock code may protect SHM. It definitely may protect PHP from crashes and memory corruptions during RSHUTDOWN, but only for some cases.

Thanks. Dmitry.

Rasmus Lerdorf wrote:
Dmitry Stogov wrote:
Hi Rasmus,

Rasmus Lerdorf wrote:
Dmitry Stogov wrote:
Hi Lucas,

I took a look into patch and I still don't like it.
I may miss some things and make mistakes so correct me if I'm wrong.

1) It makes some slowdown for all SAPIs except Apache1, because it adds
additional block/unblock code (mainly in zend_alloc.c)

This is the part that has never made sense to me. If we don't need to
block signals in zend_alloc, remove those
HANDLE_[UN]BLOCK_INTERRUPTIONS macros. And since these are a NOP for
all but the Apache1 SAPI, either all other sapis are broken, or these
are not needed at all.

It is a question. Of course this block/unblock code prevents staying the
heap in inconsistent state which can cause SIGSEGV later and new code
must be safer, but slower. :(

If we remove all HANDLE_[UN]BLOCK_INTERRUPTIONS we don't need this patch
at all. :)

That assumes no extensions need critical sections, which is a bad assumption, especially for anything playing with shared memory like opcode caches.

-Rasmus

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to