[FUG-BR] FreeBSD 10.0 Apache Segmentation fault (11)

Victor Volpe victor_volpe em bol.com.br
Segunda Setembro 15 13:08:15 BRT 2014


Olá,

Após mudar do FreeBSD 9.x para o 10.0 venho enfrentando problemas os quais nunca tive anteriormente. A princípio me incomodou bastante o fato de o sistema base não acompanhar mais o GCC nem o Bind, de qualquer forma isso é assunto para outra ocasião. Meu problema é que estou tendo diversos Segmentation fault (11) no Apache e não consigo encontrar uma solução. O problema acontece em qualquer script PHP e não gera nenhum tipo de erro nos logs. O mesmo comportamento ocorre em um servidor Cloud de testes, eliminando assim a possibilidade de um problema relacionado ao hardware do meu servidor. Ocorre tanto no PHP 5.4.32 quanto no 5.6.0. Estou começando a acreditar que seja um problema de conflito com o sistema operacional. Já postei estas informações no bugs.php.net, issues.apache.org e forums.freebsd.org, porém sem solução. Espero que com a ajuda de vocês consiga enxergar uma luz no fim do túnel.

Sistema operacional: FreeBSD 10.0-RELEASE-p7 amd64 (Instalado do zero, não é upgrade)

error_log:
[Sun Sep 14 22:15:20.114756 2014] [core:notice] [pid 80717:tid 34410095616] AH00052: child pid 81760 exit signal Segmentation fault (11)
[Sun Sep 14 22:15:22.180905 2014] [core:notice] [pid 80717:tid 34410095616] AH00052: child pid 81727 exit signal Segmentation fault (11)
[Sun Sep 14 22:27:14.973207 2014] [core:notice] [pid 80717:tid 34410095616] AH00052: child pid 81807 exit signal Segmentation fault (11)

Apache 2.4.10 compilado com:
./configure --prefix=/usr/apache --exec-prefix=/usr --sysconfdir=/etc/apache --enable-modules=none --enable-mods-static="authn_core authn_file authz_host authz_groupfile authz_user authz_core auth_basic socache_shmcb so include filter mime log_config env expires headers setenvif version ssl unixd status autoindex suexec cgi negotiation dir actions userdir alias rewrite"

PHP 5.6.0 compilado com:
./configure --prefix=/usr/php5 --exec-prefix=/usr --with-apxs2=/usr/bin/apxs --with-config-file-path=/etc --with-openssl --with-zlib --with-bz2 --with-curl --enable-ftp --with-gd --with-jpeg-dir --with-png-dir --with-zlib-dir --enable-mbstring --with-mcrypt --with-mssql --with-mysql --with-mysql-sock=/tmp/mysql.sock --with-mysqli=/usr/local/bin/mysql_config --enable-sockets --enable-zip

Customizações do php.ini:
expose_php = Off
error_reporting = E_ALL & ~E_NOTICE
date.timezone = "America/Sao_Paulo"
default_charset = ""

Debug no gdb:
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 807418000 (LWP 100188/httpd)]
0x00000008038b6157 in zend_stack_push (stack=0x808a9e4e8, element=0x808a9e4c8, size=<value optimized out>) at zend_stack.c:42
42              stack->elements[stack->top] = (void *) emalloc(size);
Current language:  auto; currently minimal
(gdb) bt
#0  0x00000008038b6157 in zend_stack_push (stack=0x808a9e4e8, element=0x808a9e4c8, size=<value optimized out>) at zend_stack.c:42
#1  0x000000080387ee63 in compile_file (file_handle=<value optimized out>, type=<value optimized out>, tsrm_ls=0x8089a4900) at zend_language_scanner.l:583
#2  0x0000000803752abf in phar_compile_file (file_handle=0x7ffffdbed920, type=2, tsrm_ls=0x8089a4900) at phar.c:3411
#3  0x00000008038b9735 in zend_execute_scripts (type=2, tsrm_ls=0x8089a4900, retval=0x0, file_count=1) at zend.c:1307
#4  0x000000080394cb8a in php_handler (r=0x80ba1c0a0) at sapi_apache2.c:669
#5  0x0000000000471fdb in ap_run_handler ()
#6  0x00000000004728bd in ap_invoke_handler ()
#7  0x00000000004b8489 in ap_process_async_request ()
#8  0x00000000004b301e in ap_process_http_async_connection ()
#9  0x00000000004b2d12 in ap_process_http_connection ()
#10 0x000000000048326b in ap_run_process_connection ()
#11 0x000000000053b2df in process_socket ()
#12 0x0000000000537b29 in worker_thread ()
#13 0x000000080208c4a4 in pthread_create () from /lib/libthr.so.3
#14 0x0000000000000000 in ?? ()
(gdb) bt full
#0  0x00000008038b6157 in zend_stack_push (stack=0x808a9e4e8, element=0x808a9e4c8, size=<value optimized out>) at zend_stack.c:42
No locals.
#1  0x000000080387ee63 in compile_file (file_handle=<value optimized out>, type=<value optimized out>, tsrm_ls=0x8089a4900) at zend_language_scanner.l:583
        original_lex_state = {yy_leng = 0, yy_start = 0x0, yy_text = 0x0, yy_cursor = 0x0, yy_marker = 0x0, yy_limit = 0x0, yy_state = 0, state_stack = {top = 0, max = 0, elements = 0x0}, in = 0x0, lineno = 0, filename = 0x0,
  script_org = 0x0, script_org_size = 0, script_filtered = 0x0, script_filtered_size = 0, input_filter = 0, output_filter = 0, script_encoding = 0x0}
        retval_znode = {op_type = 1, u = {op = {constant = 1, var = 1, num = 1, hash = 1, opline_num = 1, jmp_addr = 0x1, zv = 0x1, literal = 0x1, ptr = 0x1}, constant = {value = {lval = 1, dval = 4.9406564584124654e-324, str = {
          val = 0x1 <Error reading address 0x1: Bad address>, len = 22}, ht = 0x1, obj = {handle = 1, handlers = 0x16}}, refcount__gc = 1, type = 1 '\001', is_ref__gc = 0 '\0'}, op_array = 0x1}, EA = 51444928}
        original_active_op_array = (zend_op_array *) 0x0
        original_in_compilation = 0 '\0'
        compiler_result = <value optimized out>
        retval = <value optimized out>
#2  0x0000000803752abf in phar_compile_file (file_handle=0x7ffffdbed920, type=2, tsrm_ls=0x8089a4900) at phar.c:3411
        __bailout = {{_sjb = {34417748607, 140737450531104, 140737450530424, 140737450530720, 140737450531232, 0, 0, 34504067328, 140737450476415, 34389426431, 1280, 34359738368}}}
        __bailout = {{_sjb = {34417748607, 140737450531104, 140737450530424, 140737450530720, 140737450531232, 0, 0, 34504067328, 140737450476415, 34389426431, 1280, 34359738368}}}
        __orig_bailout = (sigjmp_buf *) 0x7ffffdbed9a0
        name = 0x0
        phar = (phar_archive_data *) 0x50
        name = 0x0
        res = <value optimized out>
        failed = Error accessing memory address 0x0: Bad address.

Obrigado.


Mais detalhes sobre a lista de discussão freebsd