Re: [APC-DEV] [PATCH] APC signals + coredump shared memory unmapping
| From: | Gopal V | Date: | Mon, 24 Dec 2007 10:55:49 +0000 |
| Subject: | Re: [APC-DEV] [PATCH] APC signals + coredump shared memory unmapping | ||
| References: | 1 | Groups: | php.apc.dev |
| Request: | Send a blank email to php-apc-dev+get-93@lists.php.net to get a copy of this message | ||
Lucas Nealan wrote:
Although this will technically work in production environments the functionality was engineered to solve a problem in shared development environments that require a really large apc shm size. In these environments when a coredump occurs in the SAPI, PHP or an extension the coredump file mayb be many gigabytes. If enough of these are generated concurrently, writing these large files may bring down a server.Finally, someone taking a closer look at signals !
Signal handlers are registered per child in module RINIT since SAPIs like Apache may register their signal handlers after MINIT. Information about the previous handlers is stored in a module static. I believe this will be safe in ZTS builds since handlers will only be registered once in a non forking mode. If requested I will move these into APC globals.I'm not a great fan of sigsegv handlers. I used to maintain some code which ignored implicit null checks & hooked onto sigsegv to generate NullRef exceptions (ucontext to get $pc ... etc), which sort of is a *big* pain to debug in this case.
I've also made the patch available at the following url in case the attachment is problematic: http://sizzo.org/~screen/patches/apc_signal_unmap.patchMy grand APC yak shaving is stalled due to some personal stuff, but this bit of code makes it *really* easy for me to integrate something else which's been pending for a long time. http://t3.dotgnu.info/blog/php/long-lost-todo.html As I keep telling myself these days - "It's on the roadmap" :( Feel free to get this committed to HEAD if you wish, but I sort of have an un-buildable mess of +/- 600-odd lines in my local build. Cheers, Gopal -- If I learn from my mistakes, pretty soon I'll know everything