Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:89186 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 95466 invoked from network); 11 Nov 2015 20:14:41 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 Nov 2015 20:14:41 -0000 Authentication-Results: pb1.pair.com smtp.mail=dmitry@zend.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=dmitry@zend.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 209.85.223.178 as permitted sender) X-PHP-List-Original-Sender: dmitry@zend.com X-Host-Fingerprint: 209.85.223.178 mail-io0-f178.google.com Received: from [209.85.223.178] ([209.85.223.178:34814] helo=mail-io0-f178.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 20/52-16149-0B1A3465 for ; Wed, 11 Nov 2015 15:14:40 -0500 Received: by ioir85 with SMTP id r85so3887443ioi.1 for ; Wed, 11 Nov 2015 12:14:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zend_com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=RCpGAeyRrlsQJK7PXmixOnty5t9q2fsn/AOWj5TuMus=; b=k9ziqMmLw3inx96yz+Hi+8lEEj2Uuyc7Vhq3EZsOWCFSzYPHrbdwJxAvAG4pTQGRPe ofVcksH+HEGxdiHcpuOpiHlVSmhYQgy2IH91exm0l9w23hdqzFHJ5cwLt+g8L9H1IQqD kmWHOBIGNZcs9oV/w/jeGAD7ECfRec48gKT3KHHX6ohXX79co3SmzoKwYuhvSRQxQTNs X+s75L2pM5h8sxo7LlF2WtYz0bAnRy5SMrV2NqXE3KBugOShr7IBBhPDzqdzhlfpEJlR wrwVLb4sVJaJmzoeEay6O65BvfSukc+RQJt/+VLUgpPzb0Q0u7xprsM54oNfUmLTMOfw nWBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=RCpGAeyRrlsQJK7PXmixOnty5t9q2fsn/AOWj5TuMus=; b=JMSWRMjj+CvLrOKbfeKaB0oeVgV0gWz96V7W7sLMb41VHQNXeKfQSGTI3BZ0sx9aq7 iu5psrGeGTHxfF+5kt5LkuhRn6gZCEZuqzNclH7nc5pV10wt7OurbfQyw94f/wyVXd3C rZhwRZVXpmsXr3a1Ij1zsOZ4lN0SsFEwDsqV3DaX3sig5KpariqhT8W77CPFRp+G2WR8 znP+XcFdeiuu4BOlqJKQ78OR1ZguP6Cf83yL5GJ/dpuxrnRs6YXNicbj9bV5ZOGeAeb0 8ZO3ykjf7zzRBvv6xYuqF76lfoHVrCSnUf4YPjZPG9OpagUe5c2AujlgALi7NaJB6Piv MwgA== X-Gm-Message-State: ALoCoQmFmUgwDOmruFX9p670Oxs65dYf164V7kobIm6oJ5bjcA9eyMIlJ1qFAxPxb27M18Kz/NErWBYpvSWDKN+ENQezBK5mE3+Fj4QHpsduMQZwfPD/LQw4UP98dzuOXdMfgjV8JOYL4wvzwhSh9K49u9ZsHMSKYbvct/IGux09AAXvu7bx2Oo= MIME-Version: 1.0 X-Received: by 10.107.8.142 with SMTP id h14mr13347632ioi.116.1447272877475; Wed, 11 Nov 2015 12:14:37 -0800 (PST) Received: by 10.50.73.166 with HTTP; Wed, 11 Nov 2015 12:14:37 -0800 (PST) In-Reply-To: <56439C2D.70600@webbypixel.com> References: <56428A30.4060803@php.net> <56439392.2020608@php.net> <01ab01d11cb7$f9605d10$ec211730$@belski.net> <5643993C.3020908@php.net> <5643999D.2070207@webbypixel.com> <56439C2D.70600@webbypixel.com> Date: Wed, 11 Nov 2015 23:14:37 +0300 Message-ID: To: "Frank M. Kromann" Cc: Anatol Belski , PHP Internals Content-Type: multipart/alternative; boundary=001a113f96fcc166210524497960 Subject: Re: [PHP-DEV] PHP 7 Segmentation fault From: dmitry@zend.com (Dmitry Stogov) --001a113f96fcc166210524497960 Content-Type: text/plain; charset=UTF-8 try to run the same script with valgrind. USE_ZEND_ALLOC=0 valgrind --db-attach=yes php test.php (it is 10 times slower) Show the first reported problem. Thanks. Dmitry. On Wed, Nov 11, 2015 at 10:51 PM, Frank M. Kromann wrote: > Just switched to PHP-7.0 and there is no longer any references to > _live_range but the problem with the segfault is still there. Here is a new > backtrace. > > #0 zend_mm_alloc_small (size=, bin_num=, > heap=) at /home/frank/Source/php-src-7/Zend/zend_alloc.c:1291 > #1 zend_mm_alloc_heap (size=, heap=) at > /home/frank/Source/php-src-7/Zend/zend_alloc.c:1358 > #2 _emalloc (size=2) at > /home/frank/Source/php-src-7/Zend/zend_alloc.c:2442 > #3 0x00000000007e724d in _safe_emalloc (nmemb=nmemb@entry=24, > size=, offset=offset@entry=0) at > /home/frank/Source/php-src-7/Zend/zend_alloc.c:2510 > #4 0x00000000007f0b93 in zend_compile_params (ast=ast@entry=0x7ffff0ab7250, > return_type_ast=return_type_ast@entry=0x0) at > /home/frank/Source/php-src-7/Zend/zend_compile.c:4429 > #5 0x00000000007fa240 in zend_compile_func_decl (result=result@entry=0x0, > ast=ast@entry=0x7ffff0ab7668) at > /home/frank/Source/php-src-7/Zend/zend_compile.c:4879 > #6 0x00000000007f799a in zend_compile_stmt (ast=0x7ffff0ab7668) at > /home/frank/Source/php-src-7/Zend/zend_compile.c:7048 > #7 0x00000000007f8487 in zend_compile_stmt_list (ast=ast@entry=0x7ffff0ab8388) > at /home/frank/Source/php-src-7/Zend/zend_compile.c:4347 > #8 0x00000000007f781e in zend_compile_stmt (ast=ast@entry=0x7ffff0ab8388) > at /home/frank/Source/php-src-7/Zend/zend_compile.c:6992 > #9 0x00000000007f88bf in zend_compile_class_decl (ast=ast@entry=0x7ffff0ab8720) > at /home/frank/Source/php-src-7/Zend/zend_compile.c:5289 > #10 0x00000000007f7938 in zend_compile_stmt (ast=ast@entry=0x7ffff0ab8720) > at /home/frank/Source/php-src-7/Zend/zend_compile.c:7060 > #11 0x00000000007fa67a in zend_compile_top_stmt (ast=0x7ffff0ab8720) at > /home/frank/Source/php-src-7/Zend/zend_compile.c:6966 > #12 0x00000000007fa6bf in zend_compile_top_stmt (ast=0x7ffff0ab4018) at > /home/frank/Source/php-src-7/Zend/zend_compile.c:6961 > #13 0x00000000007cde07 in compile_file (file_handle=, > type=) at Zend/zend_language_scanner.l:607 > #14 0x000000000065434e in phar_compile_file (file_handle=, > type=) at /home/frank/Source/php-src-7/ext/phar/phar.c:3311 > #15 0x00000000007cdf35 in compile_filename (type=2, filename=filename@entry=0x7ffff0a14550) > at Zend/zend_language_scanner.l:647 > #16 0x0000000000899a2f in ZEND_INCLUDE_OR_EVAL_SPEC_CV_HANDLER () at > /home/frank/Source/php-src-7/Zend/zend_vm_execute.h:29114 > #17 0x000000000084cecb in execute_ex (ex=) at > /home/frank/Source/php-src-7/Zend/zend_vm_execute.h:414 > #18 0x00000000007fe607 in zend_call_function (fci=0x7ffff0a89aa0, fci@entry=0x7fffffffa8f0, > fci_cache=fci_cache@entry=0x7fffffffa8c0) > at /home/frank/Source/php-src-7/Zend/zend_execute_API.c:854 > #19 0x000000000082b244 in zend_call_method (object=0x7ffff0aa38d8, > obj_ce=, fn_proxy=, > function_name=0x7ffff0aaf108 > "composer\\autoload\\classloader::loadclass\001", > function_name_len=, retval_ptr=retval_ptr@entry=0x0, > param_count=param_count@entry=1, arg1=0x7ffff0a14430, arg2=arg2@entry=0x0) > at /home/frank/Source/php-src-7/Zend/zend_interfaces.c:104 > #20 0x00000000006c1324 in zif_spl_autoload_call (execute_data= out>, return_value=) at > /home/frank/Source/php-src-7/ext/spl/php_spl.c:425 > #21 0x00000000007fe6a0 in zend_call_function (fci=fci@entry=0x7fffffffab40, > fci_cache=fci_cache@entry=0x7fffffffab10) at > /home/frank/Source/php-src-7/Zend/zend_execute_API.c:873 > #22 0x00000000007feec9 in zend_lookup_class_ex (name=name@entry=0x7ffff0a55e80, > key=0x7ffff0a70420, use_autoload=use_autoload@entry=1) > at /home/frank/Source/php-src-7/Zend/zend_execute_API.c:1036 > #23 0x00000000007ffa18 in zend_fetch_class_by_name > (class_name=0x7ffff0a55e80, key=, fetch_type=fetch_type@entry > =512) > at /home/frank/Source/php-src-7/Zend/zend_execute_API.c:1383 > #24 0x000000000089af51 in ZEND_NEW_SPEC_CONST_HANDLER () at > /home/frank/Source/php-src-7/Zend/zend_vm_execute.h:3354 > #25 0x000000000084cecb in execute_ex (ex=) at > /home/frank/Source/php-src-7/Zend/zend_vm_execute.h:414 > #26 0x000000000089d969 in zend_execute (op_array=, > return_value=) at > /home/frank/Source/php-src-7/Zend/zend_vm_execute.h:458 > #27 0x000000000080db37 in zend_execute_scripts (type=type@entry=8, > retval=retval@entry=0x0, file_count=file_count@entry=3) at > /home/frank/Source/php-src-7/Zend/zend.c:1428 > #28 0x00000000007a2ae0 in php_execute_script > (primary_file=primary_file@entry=0x7fffffffd070) at > /home/frank/Source/php-src-7/main/main.c:2471 > #29 0x000000000089f78a in do_cli (argc=4, argv=0x1167c60) at > /home/frank/Source/php-src-7/sapi/cli/php_cli.c:974 > #30 0x0000000000443467 in main (argc=4, argv=0x1167c60) at > /home/frank/Source/php-src-7/sapi/cli/php_cli.c:1345 > > - Frank > > > On 11/11/15 11:40, Frank M. Kromann wrote: > > Hi Anatol, > > Sorry, I fogot to include the output of the grep. > > [frank@dev php-src-7]$ grep -rn _live_range Zend/ > Zend/zend_opcode.c:83: op_array->last_live_range = 0; > Zend/zend_compile.h:176:typedef struct _zend_live_range { > Zend/zend_compile.h:179:} zend_live_range; > Zend/zend_compile.h:364: int last_live_range; > Zend/zend_compile.h:366: zend_live_range *live_range; > Zend/zend_compile.c:579:static uint32_t > zend_start_live_range(zend_op_array *op_array, uint32_t start) /* {{{ */ > Zend/zend_compile.c:581: zend_live_range *range; > Zend/zend_compile.c:583: op_array->last_live_range++; > Zend/zend_compile.c:584: op_array->live_range = > erealloc(op_array->live_range, sizeof(zend_live_range) * > op_array->last_live_range); > Zend/zend_compile.c:585: range = op_array->live_range + > op_array->last_live_range - 1; > Zend/zend_compile.c:587: return op_array->last_live_range - 1; > Zend/zend_compile.c:591:static void zend_end_live_range(zend_op_array > *op_array, uint32_t offset, uint32_t end) /* {{{ */ > Zend/zend_compile.c:593: zend_live_range *range = op_array->live_range > + offset; > Zend/zend_compile.c:595: if (range->start == end && offset == > op_array->last_live_range - 1) { > Zend/zend_compile.c:596: op_array->last_live_range--; > Zend/zend_compile.c:619: info.u.live_range_offset = > zend_start_live_range(CG(active_op_array), start); > Zend/zend_compile.c:643: zend_end_live_range(CG(active_op_array), > loop_var->u.live_range_offset, end); > Zend/zend_compile.c:6472: range = > zend_start_live_range(CG(active_op_array), > get_next_op_number(CG(active_op_array))); > Zend/zend_compile.c:6485: zend_end_live_range(CG(active_op_array), range, > get_next_op_number(CG(active_op_array))); > Zend/zend_compile.c:6807: uint32_t range = > zend_start_live_range(CG(active_op_array), rope_init_lineno); > Zend/zend_compile.c:6822: zend_end_live_range(CG(active_op_array), range, > opline - CG(active_op_array)->opcodes); > Zend/zend_execute.c:2552: for (i = 0; i < > EX(func)->op_array.last_live_range; i++) { > Zend/zend_execute.c:2553: const zend_live_range *range = > &EX(func)->op_array.live_range[i]; > > > - Frank > > On 11/11/15 11:38, Frank M. Kromann wrote: > > Hi Anatol, > > Here is what I have > > [frank@dev php-src-7]$ git show > commit d1077f7a897d9267a0cad3d64663fd952dd1c6b2 > Merge: e88e3f2 a2e59e7 > Author: Anatol Belski > Date: Wed Nov 11 16:35:07 2015 +0100 > > Merge branch 'PHP-7.0' > > * PHP-7.0: > fix format macro names in UPGRADING.INTERNALS > > [frank@dev php-src-7]$ git status > # On branch master > # Untracked files: > > I think that is the latest from git.php.net? > > - Frank > > On 11/11/15 11:34, Anatol Belski wrote: > > Hi Frank, > > -----Original Message----- > From: Frank M. Kromann [mailto:fmk@php.net ] > Sent: Wednesday, November 11, 2015 8:14 PM > To: Dmitry Stogov > Cc: PHP Internals > Subject: Re: [PHP-DEV] PHP 7 Segmentation fault > > Hi Dmitry, > > Yes this is the master branch. I have previously tested it on the > PHP-7.0 branch with the same result. I will do that again to verify that > the > problem is the same. > > I run vcsclean, buildconf, configure, make at least once a day. I do not > run the > make install as that will break all the sites on my dev box. I'm just > testing the > new binary with a command line script. > > I just did all the steps above and the result is still the same. I'll try > to create a > small script that can be used to reproduce the problem, but it might be > tricky as > it seems to have to do with the number of autoloaded classes, a problem > with > my PHP code (although PHP should not seg fault in that case). > > I've just checked for zend_add_live_range - it's even not in the current > master. Also ` grep -rn _live_range Zend/` finds nothing in PHP-7.0. Could > you please check that you're using up-to-date source tree and the correct > branch? It could be pretty much like something in that direction. > > Thanks > > > > > -- > Frank M. Kromann, M.Sc.E.E. > Web by Pixel, Inc. > > Phone: +1 949 742 7533 > Fax: +1 949 742 7534 > Cell: +1 949 702 1794 > Denmark: +45 78 79 11 48 > > Web: http://webbypixel.com > --001a113f96fcc166210524497960--