https://bz.apache.org/bugzilla/show_bug.cgi?id=61498

            Bug ID: 61498
           Summary: Buffer overflow detected when over 1024 file
                    descriptor
           Product: Apache httpd-2
           Version: 2.4.6
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: major
          Priority: P2
         Component: All
          Assignee: [email protected]
          Reporter: [email protected]
  Target Milestone: ---

I have 2.4.6-45.el7.centos.4 on Centos 7.
I have hundreds of virtual hosts with ErrorLog for all of them. 

When I count how many file descriptor my httpd process is using
(/proc/xxxx/fd), if it's over 1024, Apache generates a Buffer Overflow :

*** buffer overflow detected ***: /usr/sbin/httpd terminated
======= Backtrace: =========
/lib64/libc.so.6(__fortify_fail+0x37)[0x7fb23a6ee077]
/lib64/libc.so.6(+0x10d230)[0x7fb23a6ec230]
/lib64/libc.so.6(+0x10efe7)[0x7fb23a6edfe7]
/usr/lib64/php/modules/memcache.so(mmc_pool_select+0x4b9)[0x7fb2228ab2f9]
/usr/lib64/php/modules/memcache.so(mmc_pool_run+0x68)[0x7fb2228abb38]
/usr/lib64/php/modules/memcache.so(zif_memcache_get+0x18f)[0x7fb2228a501f]
/etc/httpd/modules/libphp5.so(+0x2f06c1)[0x7fb22da966c1]
/etc/httpd/modules/libphp5.so(execute_ex+0x38)[0x7fb22da2a788]
/etc/httpd/modules/libphp5.so(zend_execute_scripts+0x18b)[0x7fb22d9ef06b]
/etc/httpd/modules/libphp5.so(php_execute_script+0x282)[0x7fb22d989d22]
/etc/httpd/modules/libphp5.so(+0x2f20ad)[0x7fb22da980ad]
/usr/sbin/httpd(ap_run_handler+0x40)[0x7fb23c123690]
/usr/sbin/httpd(ap_invoke_handler+0x69)[0x7fb23c123bd9]
/usr/sbin/httpd(ap_internal_redirect+0x5c)[0x7fb23c137acc]
/etc/httpd/modules/mod_rewrite.so(+0x4e9c)[0x7fb2348d7e9c]
/usr/sbin/httpd(ap_run_handler+0x40)[0x7fb23c123690]
/usr/sbin/httpd(ap_invoke_handler+0x69)[0x7fb23c123bd9]
/usr/sbin/httpd(ap_process_async_request+0x20a)[0x7fb23c13800a]
/usr/sbin/httpd(ap_process_request+0x14)[0x7fb23c1382e4]
/usr/sbin/httpd(+0x52c32)[0x7fb23c134c32]
/usr/sbin/httpd(ap_run_process_connection+0x40)[0x7fb23c12cc90]
/etc/httpd/modules/mod_mpm_prefork.so(+0x380f)[0x7fb231d2080f]
/etc/httpd/modules/mod_mpm_prefork.so(+0x3a55)[0x7fb231d20a55]
/etc/httpd/modules/mod_mpm_prefork.so(+0x46ee)[0x7fb231d216ee]
/usr/sbin/httpd(ap_run_mpm+0x4e)[0x7fb23c107f6e]
/usr/sbin/httpd(main+0xa86)[0x7fb23c100d76]
/lib64/libc.so.6(__libc_start_main+0xf5)[0x7fb23a600b35]
/usr/sbin/httpd(+0x1eeaf)[0x7fb23c100eaf]

If I disable a few virtual hosts to get below that threshold, it's starting up.

I confirmed that my limits are ok :
cat /proc/xxxxx/limits
Limit                     Soft Limit           Hard Limit           Units
Max cpu time              unlimited            unlimited            seconds
Max file size             unlimited            unlimited            bytes
Max data size             unlimited            unlimited            bytes
Max stack size            8388608              unlimited            bytes
Max core file size        0                    unlimited            bytes
Max resident set          unlimited            unlimited            bytes
Max processes             256005               256005               processes
Max open files            30000                30000                files
Max locked memory         65536                65536                bytes
Max address space         unlimited            unlimited            bytes
Max file locks            unlimited            unlimited            locks
Max pending signals       256005               256005               signals
Max msgqueue size         819200               819200               bytes
Max nice priority         0                    0
Max realtime priority     0                    0
Max realtime timeout      unlimited            unlimited            us

I had to add this, otherwise I was having a too many open file :
/etc/systemd/system/httpd.service.d/limits.conf
[Service]
LimitNOFILE=30000

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to