OSDir


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

httpd and php integration


On 10/18/2018 03:42 PM, Rainer Jung wrote:
Am 18.10.2018 um 21:18 schrieb Dennis Clarke:
On 10/18/2018 02:12 PM, Daniel Ruggeri wrote:
php: "5.6.38"


I do build PHP 7.x myself including recent library versions both on some Linux platforms as well as on Solaris Sparc. But the typical use is via PHP-FPM, not mod_php. So httpd integration is done via mod_proxy_fcgi which is part of httpd nowadays. I do not test PHP with the httpd test suite, only with the tests that come with PHP itself.

Yes, I see the php-fpm approach and ye old mod_php was fine for php 5.x
world but the world has moved onwards.

When running the test suite I typically get about 50-80 test failures on Linux and 150-200 test failures on Solaris (of about 13000 non-skipped tests).

I get outright SIGBUS core dump :-(

beta $ TEST_PHP_EXECUTABLE=sapi/cli/php sapi/cli/php run-tests.php

=====================================================================
PHP         : sapi/cli/php
PHP_SAPI    : cli
PHP_VERSION : 7.2.8
ZEND_VERSION: 3.2.0
PHP_OS      : SunOS - SunOS beta 5.10 Generic_150400-61 sun4u
INI actual  : /usr/local/lib/php.ini
More .INIs  :
---------------------------------------------------------------------
PHP : /usr/local/build/php-7.2.8_SunOS5.10_sparc64vii+.001/sapi/phpdbg/phpdbg
PHP_SAPI    : phpdbg
PHP_VERSION : 7.2.8
ZEND_VERSION: 3.2.0
PHP_OS      : SunOS - SunOS beta 5.10 Generic_150400-61 sun4u
INI actual  : /usr/local/lib/php.ini
More .INIs  :
---------------------------------------------------------------------
CWD         : /usr/local/build/php-7.2.8_SunOS5.10_sparc64vii+.001
Extra dirs  :
VALGRIND    : Not used
=====================================================================
TIME START 2018-10-18 19:18:58
=====================================================================
Bus Error(coredump)
beta $
beta $ dbx sapi/cli/php time_1539890338-pid_2068-uid_16411-gid_20002-fid_php.core
For information about new features see `help changes'
To remove this message, put `dbxenv suppress_startup_message 8.2' in your .dbxrc
Reading php
core file header read successfully
Reading ld.so.1
Reading libresolv.so.2
Reading librt.so.1
Reading libm.so.2
Reading libnsl.so.1
Reading libsocket.so.1
Reading libz.so.1.2.8
Reading libxml2.so.2.9.2
Reading liblzma.so.5.2.1
Reading libpthread.so.1
Reading libiconv.so.2.6.0
Reading libc.so.1
Reading libaio.so.1
Reading libmd.so.1
Reading libc_psr.so.1
Reading en_US.UTF-8.so.3
Reading methods_unicode.so.3
t@1 (l@1) program terminated by signal BUS (invalid address alignment)
Current function is set_label
  630           label->next = NULL;
(dbx) where
current thread: t@1
=>[1] set_label(label = 0x101ffa82c, compiler = 0x101ff9780), line 630 in "sljitLir.c" [2] sljit_emit_label(compiler = 0x101ff9780), line 1251 in "sljitNativeSPARC_common.c" [3] php__pcre_jit_compile(re = 0x101ff9570, extra = 0x101ff9600, mode = 0), line 11081 in "pcre_jit_compile.c" [4] php_pcre_study(external_re = 0x101ff9570, options = 1, errorptr = 0xffffffff7fffdb10), line 1630 in "pcre_study.c" [5] pcre_get_compiled_regex_cache(regex = 0xffffffff7d0b5630), line 548 in "php_pcre.c" [6] php_do_pcre_match(execute_data = 0xffffffff7d023810, return_value = 0xffffffff7d01efa0, global = 0), line 729 in "php_pcre.c" [7] zif_preg_match(execute_data = 0xffffffff7d023810, return_value = 0xffffffff7d01efa0), line 1147 in "php_pcre.c" [8] ZEND_DO_ICALL_SPEC_RETVAL_USED_HANDLER(execute_data = 0xffffffff7d01e510), line 617 in "zend_vm_execute.h" [9] execute_ex(ex = 0xffffffff7d01c030), line 59739 in "zend_vm_execute.h" [10] zend_execute(op_array = 0xffffffff7d07e540, return_value = (nil)), line 63776 in "zend_vm_execute.h" [11] zend_execute_scripts(type = 8, retval = (nil), file_count = 3, ... = 0x17d06c060, ...), line 1496 in "zend.c" [12] php_execute_script(primary_file = 0xffffffff7ffff0f8), line 2590 in "main.c"
  [13] do_cli(argc = 2, argv = 0x101c8ed20), line 1011 in "php_cli.c"
  [14] main(argc = 2, argv = 0x101c8ed20), line 1404 in "php_cli.c"
(dbx) list
  630           label->next = NULL;
  631           label->size = compiler->size;
  632           if (compiler->last_label)
  633                   compiler->last_label->next = label;
  634           else
  635                   compiler->labels = label;
  636           compiler->last_label = label;
  637   }
  638
639 static SLJIT_INLINE void set_jump(struct sljit_jump *jump, struct sljit_compiler *compiler, sljit_s32 flags)
(dbx) print label
label = 0x101ffa82c
(dbx) print *label
*label = {
    next = (nil)
    addr = 0
    size = 0
}
(dbx) quit

Which has me wonder how that is possible given that I tend to enforce
a 64-bit alignment with -xmemalign=8s .

Regardless php has been a battle on Solaris sparc. Would love to know how you managed to get any sort of reasonable results.


I did get some false positive fixed by the PHP people, but got somewhat tired of analyzing the big number of failing tests.


I have bug reports filed that seem to rot.
Others I follow or try to follow :

https://bugs.php.net/bug.php?id=49184

That never seems to go away :

beta $ cat /tmp/foo.php
<?php

var_dump(
        filter_input(INPUT_SERVER,'ENV_NAME',FILTER_SANITIZE_STRING),
        $_SERVER['ENV_NAME']
);

?>
beta $ sapi/cli/php /tmp/foo.php
PHP Notice:  Undefined index: ENV_NAME in /tmp/foo.php on line 5
NULL
NULL
beta $

beta $ ENV_NAME=foobar sapi/cli/php /tmp/foo.php
NULL
string(6) "foobar"
beta $

beta $ sapi/cli/php --version
PHP 7.2.8 (cli) (built: Aug 15 2018 03:13:17) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
beta $

In any case ... I trust this build of php 7.2.8 about as far as I can
throw it and I can not throw an M4000 very far at all.  Or lift it.

Dennis