Bug #70249 [Com]: Segmentation fault while running PHPUnit tests on phpBB 3.2-dev

From: Date: Fri, 14 Aug 2015 18:41:31 +0000
Subject: Bug #70249 [Com]: Segmentation fault while running PHPUnit tests on phpBB 3.2-dev
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-195213@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=70249&edit=1 ID: 70249 Comment by: a dot cobest at gmail dot com Reported by: rxu at mail dot ru Summary: Segmentation fault while running PHPUnit tests on phpBB 3.2-dev Status: Open Type: Bug Package: Date/time related Operating System: Ubuntu Linux v.15.04 64 bit PHP Version: 7.0.0beta3 Block user comment: N Private report: N New Comment: Same problem while testing Fenom (https://github.com/fenom-template/fenom) template engine (using PHPUnit 4.5.0). MacOS 10.10.5 + MacPorts PHP 7.0.0beta2 (cli) (built: Aug 14 2015 18:46:50) (DEBUG) Copyright (c) 1997-2015 The PHP Group Zend Engine v3.0.0-dev, Copyright (c) 1998-2015 Zend Technologies Configure Command => './configure' '--prefix=/opt/local' '--mandir=/opt/local/share/man' '--infodir=/opt/local/share/info' '--program-suffix=70' '--includedir=/opt/local/include/php70' '--libdir=/opt/local/lib/php70' '--with-config-file-path=/opt/local/etc/php70' '--with-config-file-scan-dir=/opt/local/var/db/php70' '--disable-all' '--enable-bcmath' '--enable-ctype' '--enable-dom' '--enable-filter' '--enable-hash' '--enable-json' '--enable-libxml' '--enable-pdo' '--enable-session' '--enable-simplexml' '--enable-tokenizer' '--enable-xml' '--enable-xmlreader' '--enable-xmlwriter' '--with-bz2=/opt/local' '--with-mhash=/opt/local' '--with-pcre-regex=/opt/local' '--with-libxml-dir=/opt/local' '--with-zlib=/opt/local' '--without-pear' '--disable-cgi' '--enable-cli' '--enable-fileinfo' '--enable-phar' '--disable-fpm' '--enable-debug' '--with-libedit=/opt/local' 'CC=/usr/bin/clang' 'CFLAGS=-pipe '-Os' '-arch' 'LDFLAGS=-L/opt/local/lib '-Wl,-headerpad_max_install_names' '-arch' 'CP! PFLAGS=-I/opt/local/include' 'CXX=/usr/bin/clang++' 'CXXFLAGS=-pipe '-Os' '-arch' '-stdlib=libc++'' $ ggdb --args php70 -n vendor/bin/phpunit Program received signal SIGSEGV, Segmentation fault. 0x00000001003c8043 in zend_mm_alloc_small (heap=0x101800040, size=152, bin_num=12, __zend_filename=0x10055032c "Zend/zend_string.h", __zend_lineno=121, __zend_orig_filename=0x0, __zend_orig_lineno=0) at Zend/zend_alloc.c:1244 1244 heap->free_slot[bin_num] = p->next_free_slot; (gdb) bt #0 0x00000001003c8043 in zend_mm_alloc_small (heap=0x101800040, size=152, bin_num=12, __zend_filename=0x10055032c "Zend/zend_string.h", __zend_lineno=121, __zend_orig_filename=0x0, __zend_orig_lineno=0) at Zend/zend_alloc.c:1244 #1 0x00000001003c482e in zend_mm_alloc_heap (heap=0x101800040, size=152, __zend_filename=0x10055032c "Zend/zend_string.h", __zend_lineno=121, __zend_orig_filename=0x0, __zend_orig_lineno=0) at Zend/zend_alloc.c:1311 #2 0x00000001003c5770 in _emalloc (size=120, __zend_filename=0x10055032c "Zend/zend_string.h", __zend_lineno=121, __zend_orig_filename=0x0, __zend_orig_lineno=0) at Zend/zend_alloc.c:2210 #3 0x00000001003b476a in zend_string_alloc (len=90, persistent=0) at Zend/zend_string.h:121 #4 0x000000010039dd7f in zend_string_init ( str=0x100eff750 "/**\n * @param string $string\n * @param string $pattern\n * @return bool\n */\n public static function match($string, $pattern)\n {\n return fnmatch($pattern, $string);\n }\n\n "..., len=90, persistent=0) at Zend/zend_string.h:157 #5 0x00000001003a6761 in lex_scan (zendlval=0x7fff5fbfc820) at Zend/zend_language_scanner.l:1961 #6 0x00000001003cc7d4 in zendlex (elem=0x7fff5fbfcab0) at Zend/zend_compile.c:1546 #7 0x0000000100396ca4 in zendparse () at Zend/zend_language_parser.c:4179 #8 0x000000010039e7b4 in compile_file (file_handle=0x7fff5fbfd6d0, type=2) at Zend/zend_language_scanner.l:591 #9 0x000000010013f4e0 in phar_compile_file (file_handle=0x7fff5fbfd6d0, type=2) at ext/phar/phar.c:3311 #10 0x000000010039eb14 in compile_filename (type=2, filename=0x10181cf50) at Zend/zend_language_scanner.l:647 #11 0x000000010049f078 in ZEND_INCLUDE_OR_EVAL_SPEC_CV_HANDLER (execute_data=0x10181cef0) at Zend/zend_vm_execute.h:28957 #12 0x000000010046bea4 in execute_ex (ex=0x10181ce40) at Zend/zend_vm_execute.h:409 #13 0x00000001003e773c in zend_call_function (fci=0x7fff5fbfdb70, fci_cache=0x7fff5fbfdae0) at Zend/zend_execute_API.c:855 #14 0x000000010043661c in zend_call_method (object=0x1018c7648, obj_ce=0x101807618, fn_proxy=0x1018c7640, function_name=0x1018c92b8 "composer\\autoload\\classloader::loadclass\001", function_name_len=44, retval_ptr=0x0, param_count=1, arg1=0x10181ce30, arg2=0x0) at Zend/zend_interfaces.c:104 #15 0x000000010019380d in zif_spl_autoload_call (execute_data=0x10181cdd0, return_value=0x7fff5fbfdfb8) at ext/spl/php_spl.c:425 #16 0x00000001003e7867 in zend_call_function (fci=0x7fff5fbfdf60, fci_cache=0x7fff5fbfdf38) at Zend/zend_execute_API.c:874 #17 0x00000001003e8307 in zend_lookup_class_ex (name=0x10194eaf0, key=0x101937310, use_autoload=1) at Zend/zend_execute_API.c:1037 #18 0x00000001003e9562 in zend_fetch_class_by_name (class_name=0x10194eaf0, key=0x101937310, fetch_type=512) at Zend/zend_execute_API.c:1384 ---Type <return> to continue, or q <return> to quit--- #19 0x00000001004b8c0c in ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_CONST_HANDLER (execute_data=0x10181caf0) at Zend/zend_vm_execute.h:5575 #20 0x000000010046bea4 in execute_ex (ex=0x10181c8b0) at Zend/zend_vm_execute.h:409 #21 0x00000001003e773c in zend_call_function (fci=0x7fff5fbfe3c0, fci_cache=0x7fff5fbfe398) at Zend/zend_execute_API.c:855 #22 0x000000010016881e in zim_reflection_method_invokeArgs (execute_data=0x10181c830, return_value=0x10181c530) at ext/reflection/php_reflection.c:3365 #23 0x00000001004969e1 in ZEND_DO_FCALL_SPEC_HANDLER (execute_data=0x10181c370) at Zend/zend_vm_execute.h:835 #24 0x000000010046bea4 in execute_ex (ex=0x101818030) at Zend/zend_vm_execute.h:409 #25 0x000000010046c010 in zend_execute (op_array=0x101873300, return_value=0x0) at Zend/zend_vm_execute.h:450 #26 0x00000001004061a0 in zend_execute_scripts (type=8, retval=0x0, file_count=3) at Zend/zend.c:1399 #27 0x0000000100353bd6 in php_execute_script (primary_file=0x7fff5fbff368) at main/main.c:2475 #28 0x00000001004fd093 in do_cli (argc=3, argv=0x7fff5fbffa80) at sapi/cli/php_cli.c:971 #29 0x00000001004fbebe in main (argc=3, argv=0x7fff5fbffa80) at sapi/cli/php_cli.c:1338 Previous Comments: ------------------------------------------------------------------------ [2015-08-12 16:54:19] rxu at mail dot ru Description: ------------ Installed on Ubuntu 15.04/64bit: PHP 7.0.0-dev (cli) (built: Aug 10 2015 19:09:38) Copyright (c) 1997-2015 The PHP Group Zend Engine v3.0.0-dev, Copyright (c) 1998-2015 Zend Technologies Configure line: './configure' '--prefix=/usr/local/php7' '--with-config-file-path=/usr/local/php7/etc' '--with-config-file-scan-dir=/usr/local/php7/etc/conf.d' '--enable-mbstring' '--enable-zip' '--enable-bcmath' '--enable-pcntl' '--enable-ftp' '--enable-exif' '--enable-calendar' '--enable-sysvmsg' '--enable-sysvsem' '--enable-sysvshm' '--enable-wddx' '--with-curl' '--with-mcrypt' '--with-iconv' '--with-gmp=/usr' '--with-pspell' '--with-gd' '--with-jpeg-dir=/usr' '--with-png-dir=/usr' '--with-zlib-dir=/usr' '--with-xpm-dir=/usr' '--with-freetype-dir=/usr' '--enable-gd-native-ttf' '--enable-gd-jis-conv' '--with-openssl' '--with-mysql=/usr' '--with-pdo-mysql=/usr' '--with-gettext=/usr' '--with-zlib=/usr' '--with-bz2=/usr' '--with-recode=/usr' '--with-mysqli=/usr/bin/mysql_config' '--enable-fpm' '--enable-intl' '--enable-soap' '--without-pear' '--with-apxs2=/usr/bin/apxs2' '--with-libdir=/lib/x86_64-linux-gnu' phpunit --version PHPUnit 4.1.6 by Sebastian Bergmann. (switching to the latest PHPUnit version doesn't solve the problem). date.timezone is not set in php.ini. gdb backtrace: #0 zend_mm_alloc_small (size=<optimized out>, bin_num=0, heap=0x7fffece00040) at /usr/local/src/php/Zend/zend_alloc.c:1271 #1 zend_mm_alloc_heap (size=<optimized out>, heap=0x7fffece00040) at /usr/local/src/php/Zend/zend_alloc.c:1338 #2 zend_mm_realloc_heap (heap=0x7fffece00040, ptr=0x7fffe7ad9200, size=<optimized out>, copy_size=8) at /usr/local/src/php/Zend/zend_alloc.c:1601 #3 0x000000000081ada4 in pass_two (op_array=0x7fffe913f6a8) at /usr/local/src/php/Zend/zend_opcode.c:588 #4 0x0000000000813fc1 in zend_compile_func_decl (result=result@entry=0x0, ast=ast@entry=0x7fffe641d2e8) at /usr/local/src/php/Zend/zend_compile.c:4838 #5 0x000000000081211a in zend_compile_stmt (ast=0x7fffe641d2e8) at /usr/local/src/php/Zend/zend_compile.c:7017 #6 0x0000000000812967 in zend_compile_stmt_list (ast=ast@entry=0x7fffe641d078) at /usr/local/src/php/Zend/zend_compile.c:4289 #7 0x0000000000811f9e in zend_compile_stmt (ast=ast@entry=0x7fffe641d078) at /usr/local/src/php/Zend/zend_compile.c:6961 #8 0x0000000000812c9d in zend_compile_class_decl (ast=ast@entry=0x7fffe641d6e8) at /usr/local/src/php/Zend/zend_compile.c:5234 #9 0x00000000008120b8 in zend_compile_stmt (ast=ast@entry=0x7fffe641d6e8) at /usr/local/src/php/Zend/zend_compile.c:7029 #10 0x00000000008142ba in zend_compile_top_stmt (ast=0x7fffe641d6e8) at /usr/local/src/php/Zend/zend_compile.c:6935 #11 0x00000000008142ff in zend_compile_top_stmt (ast=0x7fffe641d018) at /usr/local/src/php/Zend/zend_compile.c:6930 #12 0x00000000007effe6 in compile_file (file_handle=<optimized out>, type=<optimized out>) at Zend/zend_language_scanner.l:607 #13 0x00000000006a9e0f in phar_compile_file (file_handle=<optimized out>, type=<optimized out>) at /usr/local/src/php/ext/phar/phar.c:3311 #14 0x00000000007f00f5 in compile_filename (type=2, filename=filename@entry=0x7fffece17cc0) at Zend/zend_language_scanner.l:647 #15 0x00000000008a7f27 in ZEND_INCLUDE_OR_EVAL_SPEC_CV_HANDLER () at /usr/local/src/php/Zend/zend_vm_execute.h:29036 #16 0x000000000086318b in execute_ex (ex=<optimized out>) at /usr/local/src/php/Zend/zend_vm_execute.h:406 #17 0x0000000000817643 in zend_call_function (fci=fci@entry=0x7fffffffa790, fci_cache=0x7fffece6aa40, fci_cache@entry=0x7fffffffa760) at /usr/local/src/php/Zend/zend_execute_API.c:852 #18 0x0000000000842904 in zend_call_method (object=0x7fffecee0488, obj_ce=<optimized out>, fn_proxy=0x7fffecee0480, function_name=0x7fffecefc9c8 "composer\\autoload\\classloader::loadclass\001", function_name_len=<optimized out>, retval_ptr=retval_ptr@entry=0x0, param_count=param_count@entry=1, arg1=0x7fffece17ba0, arg2=arg2@entry=0x0) at /usr/local/src/php/Zend/zend_interfaces.c:104 #19 0x00000000007135e0 in zif_spl_autoload_call (execute_data=<optimized out>, return_value=<optimized out>) at /usr/local/src/php/ext/spl/php_spl.c:425 #20 0x00000000008176bc in zend_call_function (fci=fci@entry=0x7fffffffa9e0, fci_cache=fci_cache@entry=0x7fffffffa9b0) at /usr/local/src/php/Zend/zend_execute_API.c:871 #21 0x0000000000817cf2 in zend_lookup_class_ex (name=name@entry=0x7fffecebd5a0, key=0x7fffec2134f0, use_autoload=use_autoload@entry=1) at /usr/local/src/php/Zend/zend_execute_API.c:1034 #22 0x0000000000818668 in zend_fetch_class_by_name (class_name=0x7fffecebd5a0, key=<optimized out>, fetch_type=fetch_type@entry=512) at /usr/local/src/php/Zend/zend_execute_API.c:1381 #23 0x00000000008a90f3 in ZEND_NEW_SPEC_CONST_HANDLER () at /usr/local/src/php/Zend/zend_vm_execute.h:3345 #24 0x000000000086318b in execute_ex (ex=<optimized out>) at /usr/local/src/php/Zend/zend_vm_execute.h:406 #25 0x0000000000817643 in zend_call_function (fci=fci@entry=0x7fffffffac60, fci_cache=0x7fffecff79e0, fci_cache@entry=0x7fffffffac30) at /usr/local/src/php/Zend/zend_execute_API.c:852 #26 0x00000000006c5290 in zim_reflection_method_invokeArgs (execute_data=<optimized out>, return_value=0x7fffece171a0) at /usr/local/src/php/ext/reflection/php_reflection.c:3365 #27 0x00000000008ac5bb in ZEND_DO_FCALL_SPEC_HANDLER () at /usr/local/src/php/Zend/zend_vm_execute.h:835 #28 0x000000000086318b in execute_ex (ex=<optimized out>) at /usr/local/src/php/Zend/zend_vm_execute.h:406 #29 0x00000000008afa5f in zend_execute (op_array=op_array@entry=0x7fffece80000, return_value=return_value@entry=0x0) at /usr/local/src/php/Zend/zend_vm_execute.h:450 #30 0x0000000000825ede in zend_execute_scripts (type=type@entry=8, retval=retval@entry=0x0, file_count=file_count@entry=3) at /usr/local/src/php/Zend/zend.c:1404 #31 0x00000000007c8980 in php_execute_script (primary_file=primary_file@entry=0x7fffffffd1f0) at /usr/local/src/php/main/main.c:2475 #32 0x00000000008b12d3 in do_cli (argc=2, argv=0x11a2ce0) at /usr/local/src/php/sapi/cli/php_cli.c:971 #33 0x000000000044a370 in main (argc=2, argv=0x11a2ce0) at /usr/local/src/php/sapi/cli/php_cli.c:1338 Actual result: -------------- There's no actual test script but a set of unit tests, from the phpBB development repository: https://github.com/phpbb/phpbb/tree/master Tests failed with the segmentation fault here: https://travis-ci.org/phpbb/phpbb/jobs/75044512#L627 Later the cause was tracked down to the datetime test here https://github.com/phpbb/phpbb/blob/179a4700221aa49071b07d638c44b9326c7a14a8/tests/datetime/from_format_test.php#L109-L133 and the issue was fixed by adding the following line to the test case: date_default_timezone_set('Europe/Paris'); See https://github.com/phpbb/phpbb/commit/df334b1da8049c57c09eb052313c0e4d869f6cce Adding date_default_timezone_set('UTC'); didn't solve the problem. If you then try (additionally to the date_default_timezone_set()) to set the date.timezone php.ini value, segmentation fault is back. ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=70249&edit=1

« previous php.bugs (#195213) next »