Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:96792 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 65016 invoked from network); 9 Nov 2016 17:45:24 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 9 Nov 2016 17:45:24 -0000 Authentication-Results: pb1.pair.com smtp.mail=derick@php.net; spf=unknown; sender-id=unknown Authentication-Results: pb1.pair.com header.from=derick@php.net; sender-id=unknown Received-SPF: unknown (pb1.pair.com: domain php.net does not designate 82.113.146.227 as permitted sender) X-PHP-List-Original-Sender: derick@php.net X-Host-Fingerprint: 82.113.146.227 xdebug.org Received: from [82.113.146.227] ([82.113.146.227:50570] helo=xdebug.org) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 22/27-15787-DA063285 for ; Wed, 09 Nov 2016 12:45:18 -0500 Received: from localhost (localhost [IPv6:::1]) by xdebug.org (Postfix) with ESMTPS id C27F510C011; Wed, 9 Nov 2016 17:45:13 +0000 (GMT) Date: Wed, 9 Nov 2016 17:45:13 +0000 (GMT) X-X-Sender: derick@whisky.home.derickrethans.nl To: Nikita Popov cc: "Christoph M. Becker" , PHP Developers Mailing List , Dmitry Stogov In-Reply-To: Message-ID: References: User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Subject: Re: [PHP-DEV] Re: PHP 5.6 static access valgrind issue From: derick@php.net (Derick Rethans) On Wed, 9 Nov 2016, Nikita Popov wrote: > On Wed, Nov 9, 2016 at 4:09 PM, Derick Rethans wrote: > > > On Wed, 9 Nov 2016, Christoph M. Becker wrote: > > > > > On 09.11.2016 at 15:21, Derick Rethans wrote: > > > > > > > > > > And running it with "valgrind php -n index.php", produces: > > > > > > > > root@debian-8-64bit:/home/derick/xdebug-issue-1185# valgrind php -n index.php > > > > ==760== Memcheck, a memory error detector > > > > ==760== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al. > > > > ==760== Using Valgrind-3.10.0 and LibVEX; rerun with -h for copyright info > > > > ==760== Command: php -n index.php > > > > ==760== > > > > ==760== Conditional jump or move depends on uninitialised value(s) > > > > ==760== at 0x797992: zend_std_get_static_method (zend_object_handlers.c:1261) > > > > ==760== by 0x7B66FE: ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_CONST_HANDLER (zend_vm_execute.h:3887) > > > > ==760== by 0x7A379F: execute_ex (zend_vm_execute.h:363) > > > > ==760== by 0x76E2AF: zend_execute_scripts (zend.c:1341) > > > > ==760== by 0x70CC87: php_execute_script (main.c:2613) > > > > ==760== by 0x81A990: do_cli (php_cli.c:998) > > > > ==760== by 0x431996: main (php_cli.c:1382) > > > > ==760== > > > > > zend_std_get_static_method() declares use_heap[1] (if there's support > > > for alloca), but doesn't initialize it with SET_ALLOCA_FLAG()[2]. It > > > seems to me that ALLOCA_FLAG()[3] should be defined like so: > > > > > > # define ALLOCA_FLAG(name) \ > > > zend_bool name = 0; > > > > That sounds about right - Dmitry, Nikita? > > This shouldn't be a problem. alloca is only used in the !key branches, in > which case the flag is initialized by do_alloca. However, it is a problem as my valgrind note says. However, I wouldn't be surprised if this was a (Debian) GCC bug. I can't reproduce this when I change -O2 to -O0 in the Makefile. In the past, I have found a similar issue in Xdebug, where it was really something Xdebug was doing wrong, but in a very vague way (https://github.com/xdebug/xdebug/commit/c36ea38141cb9403ff4bf72602fcf4ae62e5ba1e). However, right now, it's a bug with this GCC version. cheers, Derick -- https://derickrethans.nl | https://xdebug.org | https://dram.io Like Xdebug? Consider a donation: https://xdebug.org/donate.php twitter: @derickr and @xdebug