Re: [RFC] Zend Signal Handling
| From: | Dmitry Stogov | Date: | Wed, 13 Aug 2008 09:10:36 +0000 |
| Subject: | Re: [RFC] Zend Signal Handling | ||
| References: | 1 2 3 4 5 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-39911@lists.php.net to get a copy of this message | ||
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:That assumes no extensions need critical sections, which is a bad assumption, especially for anything playing with shared memory like opcode caches. -RasmusDmitry Stogov wrote: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. :)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.