|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2011-10-27 17:01 UTC] askalski at gmail dot com
Description: ------------ The _apc_store function (php_apc.c) fails to HANDLE_UNBLOCK_INTERRUPTIONS() when returning the "Unable to allocate memory for pool." error. (Verified that the issue exists in the 3.1.9 sources.) Test script: --------------- n/a Expected result: ---------------- n/a Actual result: -------------- n/a PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Dec 10 02:00:01 2025 UTC |
I don't have a ready-made test case for this, because it involves a local modification to PHP which predates Zend signals. It was a NTS build (Apache prefork) if that matters. Before I go through the trouble of creating a test case (*** see note below) for something which is obvious through code reading, here is the excerpt (APC-3.1.11 beta) that I'm referring to: int _apc_store(char *strkey, int strkey_len, const zval *val, const unsigned int ttl, const int exclusive TSRMLS_DC) { ... ... HANDLE_BLOCK_INTERRUPTIONS(); APCG(current_cache) = apc_user_cache; ctxt.pool = apc_pool_create(APC_SMALL_POOL, apc_sma_malloc, apc_sma_free, apc_sma_protect, apc_sma_unprotect TSRMLS_CC); if (!ctxt.pool) { // XXX Need to HANDLE_UNBLOCK_INTERRUPTIONS() // XXX (Maybe?) Need to NULL out APCG(current_cache)? apc_warning("Unable to allocate memory for pool." TSRMLS_CC); return 0; } *** It takes some effort to force apc_pool_create() to fail. In my particular instance, the SMA spinlock acquisition timed out during a nightly virtual machine snapshot.