Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

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

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

jpauli opened this issue Sep 24, 2013 · 2 comments

Comments

@jpauli
Copy link

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 mentioned this issue Sep 24, 2013
@jpauli
Copy link
Author

jpauli commented Sep 24, 2013

See #136

dstogov added a commit that referenced this issue Sep 25, 2013
* '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)
@dstogov
Copy link
Collaborator

dstogov commented Sep 25, 2013

Fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants