Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:66365 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 5087 invoked from network); 28 Feb 2013 21:02:18 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 28 Feb 2013 21:02:18 -0000 Authentication-Results: pb1.pair.com smtp.mail=rasmus@lerdorf.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=rasmus@lerdorf.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain lerdorf.com from 209.85.128.176 cause and error) X-PHP-List-Original-Sender: rasmus@lerdorf.com X-Host-Fingerprint: 209.85.128.176 mail-ve0-f176.google.com Received: from [209.85.128.176] ([209.85.128.176:48200] helo=mail-ve0-f176.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 85/50-25879-AD5CF215 for ; Thu, 28 Feb 2013 16:02:18 -0500 Received: by mail-ve0-f176.google.com with SMTP id cz10so2244401veb.7 for ; Thu, 28 Feb 2013 13:02:15 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:message-id:date:from:user-agent:mime-version:to:cc :subject:references:in-reply-to:x-enigmail-version:content-type :content-transfer-encoding:x-gm-message-state; bh=A9Fn6e2UjjzJU6MrAg7r3c2uzazCoQ3wwv61PSQ6OqA=; b=RtyHgUvwzjIPf+eWcXrp7hhOQtxkNvi4gygxYp1E/R+2EoaRThjjZNon0qDTVColEc qF/qUaB+dJ3mgQeqnoJqZky/fe1o0mlp6ZfyUvav094EKbxrZg6PYZCUeJeGM0XZwUZN BIxcnxcHnwXpJHfz3BG5XJJpYD4+HF0pWQhOa4E7ohu9rw3oCvUMMO66hZTHlmOG/LAI WCSSKRiO0VtnIWZAS8phMuZX4x4PtC3UA2iRn2P+WYv/jFPa9egWer4u+Lq5JtdIs4mj oXz4DgMIVvFe1e7EcyVLDaJP8+T28jjbQI4nsXEnIMX4lycPE5u5ukdpr5PHTY+3b5YZ 9c7w== X-Received: by 10.220.157.18 with SMTP id z18mr3053922vcw.72.1362085335636; Thu, 28 Feb 2013 13:02:15 -0800 (PST) Received: from [192.168.200.148] (c-50-131-44-225.hsd1.ca.comcast.net. [50.131.44.225]) by mx.google.com with ESMTPS id qj8sm2132570veb.2.2013.02.28.13.02.13 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 28 Feb 2013 13:02:14 -0800 (PST) Message-ID: <512FC5D4.2070903@lerdorf.com> Date: Thu, 28 Feb 2013 13:02:12 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130221 Thunderbird/17.0.3 MIME-Version: 1.0 To: Stas Malyshev CC: Anthony Ferrara , Zeev Suraski , Nikita Popov , PHP Developers Mailing List References: <435a322ccb14090d3bcf6bf8a110396d@mail.gmail.com> <3206872690693024300@unknownmsgid> <512FBDCD.3030507@lerdorf.com> <512FC2F4.1000903@sugarcrm.com> In-Reply-To: <512FC2F4.1000903@sugarcrm.com> X-Enigmail-Version: 1.4.6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Gm-Message-State: ALoCoQn/oqQMcJhYBm8kHJML/FrcJQyWnD088Z7//EhvpgQ98AM9cMVOFXmkrTs9Im0llD7bWWut Subject: Re: [PHP-DEV] [VOTE] Integrating Zend Optimizer+ into the PHP distribution From: rasmus@lerdorf.com (Rasmus Lerdorf) On 02/28/2013 12:49 PM, Stas Malyshev wrote: > Hi! > >> It works fine. You just have to load ZO before xdebug. If you load it >> the other way around bad things happen. This wrong load order currently > > Could you describe the bad things? Maybe we could have some checks in > either of them to prevent it... Of course, we could probably make ZO > just check if xdebug is loaded and react accordingly, but maybe we could > resolve it in a more elegant way... > Well, I did describe it back on Feb.13 and cc'ed you actually, but it was a segfault which looked to be caused by a double-free in a piece of complicated code. It manifested itself on line 203 of this code: 200 } else { 201 list($v, $selector) = 202 $this->variantFromURL($userID) ?: 203 $this->variantForUser($userID) ?: 204 $this->variantForGroup($userID) ?: 205 $this->variantForAdmin($userID) ?: 206 $this->variantForInternal() ?: 207 $this->variantByPercentage($bucketingID) ?: 208 array(self::OFF, 'w'); which, granted, is short-circuited-ternary-abuse, but still. Switching the ZO/Xdebug load order cleared it up. It didn't happen on every request and not on a stripped down test case, so it was hard to narrow down further. But this is often the case for opcode cache-related problems. The segfault looked like this: #0 0x00007fc5e636b6b1 in _zval_dtor_func (zvalue=0x7fc5ee784828) at /home/rlerdorf/php-src/Zend/zend_variables.c:54 54 Z_OBJ_HT_P(zvalue)->del_ref(zvalue TSRMLS_CC); (gdb) bt #0 0x00007fc5e636b6b1 in _zval_dtor_func (zvalue=0x7fc5ee784828) at /home/rlerdorf/php-src/Zend/zend_variables.c:54 #1 0x00007fc5e639f146 in _zval_dtor (execute_data=0x7fc5ebcd3da8) at /home/rlerdorf/php-src/Zend/zend_variables.h:35 #2 i_zval_ptr_dtor (execute_data=0x7fc5ebcd3da8) at /home/rlerdorf/php-src/Zend/zend_execute.h:87 #3 zend_leave_helper_SPEC (execute_data=0x7fc5ebcd3da8) at /home/rlerdorf/php-src/Zend/zend_vm_execute.h:468 #4 0x00007fc5e63d4cb0 in execute (op_array=0x7fc5ee6d4140) at /home/rlerdorf/php-src/Zend/zend_vm_execute.h:410 #5 0x00007fc5e26289c9 in xdebug_execute (op_array=0x7fc5ee6d4140) at /home/rlerdorf/pecl/xdebug/xdebug.c:1435 #6 0x00007fc5e63e7bf1 in zend_do_fcall_common_helper_SPEC (execute_data=) at /home/rlerdorf/php-src/Zend/zend_vm_execute.h:669 #7 0x00007fc5e63d4cb0 in execute (op_array=0x7fc5ee6cd918) at /home/rlerdorf/php-src/Zend/zend_vm_execute.h:410 #8 0x00007fc5e26289c9 in xdebug_execute (op_array=0x7fc5ee6cd918) at /home/rlerdorf/pecl/xdebug/xdebug.c:1435 #9 0x00007fc5e63e7bf1 in zend_do_fcall_common_helper_SPEC (execute_data=) at /home/rlerdorf/php-src/Zend/zend_vm_execute.h:669 #10 0x00007fc5e63d4cb0 in execute (op_array=0x7fc5ee6c9d98) at /home/rlerdorf/php-src/Zend/zend_vm_execute.h:410 #11 0x00007fc5e26289c9 in xdebug_execute (op_array=0x7fc5ee6c9d98) at /home/rlerdorf/pecl/xdebug/xdebug.c:1435 #12 0x00007fc5e63e7bf1 in zend_do_fcall_common_helper_SPEC (execute_data=) at /home/rlerdorf/php-src/Zend/zend_vm_execute.h:669 #13 0x00007fc5e63d4cb0 in execute (op_array=0x7fc5ee6c5240) at /home/rlerdorf/php-src/Zend/zend_vm_execute.h:410 #14 0x00007fc5e26289c9 in xdebug_execute (op_array=0x7fc5ee6c5240) at /home/rlerdorf/pecl/xdebug/xdebug.c:1435 #15 0x00007fc5e63e7bf1 in zend_do_fcall_common_helper_SPEC (execute_data=) at /home/rlerdorf/php-src/Zend/zend_vm_execute.h:669 #16 0x00007fc5e63d4cb0 in execute (op_array=0x7fc5ee2b4868) at /home/rlerdorf/php-src/Zend/zend_vm_execute.h:410 #17 0x00007fc5e26289c9 in xdebug_execute (op_array=0x7fc5ee2b4868) at /home/rlerdorf/pecl/xdebug/xdebug.c:1435 #18 0x00007fc5e63e7bf1 in zend_do_fcall_common_helper_SPEC (execute_data=) at /home/rlerdorf/php-src/Zend/zend_vm_execute.h:669 #19 0x00007fc5e63d4cb0 in execute (op_array=0x7fc5ee713800) at /home/rlerdorf/php-src/Zend/zend_vm_execute.h:410 #20 0x00007fc5e26289c9 in xdebug_execute (op_array=0x7fc5ee713800) at /home/rlerdorf/pecl/xdebug/xdebug.c:1435 #21 0x00007fc5e63e7bf1 in zend_do_fcall_common_helper_SPEC (execute_data=) at /home/rlerdorf/php-src/Zend/zend_vm_execute.h:669 #22 0x00007fc5e63d4cb0 in execute (op_array=0x7fc5ee6f7e20) at /home/rlerdorf/php-src/Zend/zend_vm_execute.h:410 #23 0x00007fc5e26289c9 in xdebug_execute (op_array=0x7fc5ee6f7e20) at /home/rlerdorf/pecl/xdebug/xdebug.c:1435 #24 0x00007fc5e63e7bf1 in zend_do_fcall_common_helper_SPEC (execute_data=) at /home/rlerdorf/php-src/Zend/zend_vm_execute.h:669 #25 0x00007fc5e63d4cb0 in execute (op_array=0x7fc5ee6f5e50) at /home/rlerdorf/php-src/Zend/zend_vm_execute.h:410 #26 0x00007fc5e26289c9 in xdebug_execute (op_array=0x7fc5ee6f5e50) at /home/rlerdorf/pecl/xdebug/xdebug.c:1435 #27 0x00007fc5e63e7bf1 in zend_do_fcall_common_helper_SPEC (execute_data=) at /home/rlerdorf/php-src/Zend/zend_vm_execute.h:669 #28 0x00007fc5e63d4cb0 in execute (op_array=0x7fc5ee682f30) at /home/rlerdorf/php-src/Zend/zend_vm_execute.h:410 #29 0x00007fc5e26289c9 in xdebug_execute (op_array=0x7fc5ee682f30) at /home/rlerdorf/pecl/xdebug/xdebug.c:1435 #30 0x00007fc5e63e7bf1 in zend_do_fcall_common_helper_SPEC (execute_data=) at /home/rlerdorf/php-src/Zend/zend_vm_execute.h:669 #31 0x00007fc5e63d4cb0 in execute (op_array=0x7fc5ee706080) at /home/rlerdorf/php-src/Zend/zend_vm_execute.h:410 #32 0x00007fc5e26289c9 in xdebug_execute (op_array=0x7fc5ee706080) at /home/rlerdorf/pecl/xdebug/xdebug.c:1435 #33 0x00007fc5e63e7bf1 in zend_do_fcall_common_helper_SPEC (execute_data=) at /home/rlerdorf/php-src/Zend/zend_vm_execute.h:669 #34 0x00007fc5e63d4cb0 in execute (op_array=0x7fc594bf8100) at /home/rlerdorf/php-src/Zend/zend_vm_execute.h:410 #35 0x00007fc5e26289c9 in xdebug_execute (op_array=0x7fc594bf8100) at /home/rlerdorf/pecl/xdebug/xdebug.c:1435 #36 0x00007fc5e636ba0d in zend_execute_scripts (type=8, retval=0x0, file_count=3) at /home/rlerdorf/php-src/Zend/zend.c:1315 #37 0x00007fc5e630f757 in php_execute_script (primary_file=0x7fff68d654d0) at /home/rlerdorf/php-src/main/main.c:2492 #38 0x00007fc5e6415bc5 in php_handler (r=0x7fc5edf736c8) at /home/rlerdorf/php-src/sapi/apache2handler/sapi_apache2.c:667 #39 0x00007fc5ebdc1b00 in ap_run_handler () #40 0x00007fc5ebdc53be in ap_invoke_handler () #41 0x00007fc5ebdd086c in ap_internal_redirect () #42 0x00007fc5e67cd7a5 in ?? () from /etc/httpd/modules/mod_rewrite.so #43 0x00007fc5ebdc1b00 in ap_run_handler () #44 0x00007fc5ebdc53be in ap_invoke_handler () #45 0x00007fc5ebdd0a30 in ap_process_request () #46 0x00007fc5ebdcd8f8 in ?? () #47 0x00007fc5ebdc9608 in ap_run_process_connection () #48 0x00007fc5ebdd5807 in ?? () #49 0x00007fc5ebdd5b1a in ?? () #50 0x00007fc5ebdd5e4b in ap_mpm_run () #51 0x00007fc5ebdad900 in main ()