segfault in interned strings if initial memory is too low #135

Closed
jpauli opened this Issue Sep 24, 2013 · 2 comments

Projects

None yet

2 participants

@jpauli
jpauli commented Sep 24, 2013

Having opcache.memory_consumption=8 (minimum) and opcache.max_accelerated_files=100000 (maximum) , the allocator allocates buckets in the accelerated_files hashtable, runs out of memory, fails to allocate the interned_strings hashtable BUT still tries to use it, leading to a segfault.

Here is the BT :
#0 0x00007ffff63440de in accel_new_interned_string (arKey=0x7ffff6609058 "zend_version", nKeyLength=13, free_src=0) at /home/julien/workspace/opcache/ZendAccelerator.c:348
#1 0x00007ffff63442ba in accel_use_shm_interned_strings () at /home/julien/workspace/opcache/ZendAccelerator.c:394
#2 0x00007ffff63484e3 in zend_accel_init_shm () at /home/julien/workspace/opcache/ZendAccelerator.c:2453
#3 0x00007ffff634873a in accel_startup (extension=0xf63c00) at /home/julien/workspace/opcache/ZendAccelerator.c:2528
#4 0x00000000007e0edb in zend_extension_startup (extension=0xf63c00) at /home/julien/workspace/php/Zend/zend_extensions.c:154
#5 0x00000000007bffa0 in zend_llist_apply_with_del (l=0xf089e0, func=0x7e0eb1 <zend_extension_startup>) at /home/julien/workspace/php/Zend/zend_llist.c:178
#6 0x00000000007e0f48 in zend_startup_extensions () at /home/julien/workspace/php/Zend/zend_extensions.c:175
#7 0x000000000073e406 in php_module_startup (sf=0xeebca0, additional_modules=0x0, num_additional_modules=0) at /home/julien/workspace/php/main/main.c:2214
#8 0x000000000087c09f in php_cli_startup (sapi_module=0xeebca0) at /home/julien/workspace/php/sapi/cli/php_cli.c:417
#9 0x000000000087e501 in main (argc=6, argv=0xf0a150) at /home/julien/workspace/php/sapi/cli/php_cli.c:1358

@jpauli jpauli added a commit to jpauli/ZendOptimizerPlus that referenced this issue Sep 24, 2013
@jpauli jpauli Fix for #135 29d0976
@jpauli jpauli referenced this issue Sep 24, 2013
Closed

Fix for #135 #136

@jpauli
jpauli commented Sep 24, 2013

See #136

@dstogov dstogov added a commit that referenced this issue Sep 25, 2013
@dstogov dstogov Merge branch 'opcache' of ../php5.5
* 'opcache' of ../php5.5:
  Fixed issue #135 (segfault in interned strings if initial memory is too low)
  Add test for ISSUE #128
  Fixed bug #65665 (Exception not properly caught when opcache enabled)
30dbce4
@dstogov
Member
dstogov commented Sep 25, 2013

Fixed

@dstogov dstogov closed this Sep 25, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment