Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:81470 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 87379 invoked from network); 31 Jan 2015 07:15:40 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 31 Jan 2015 07:15:40 -0000 Authentication-Results: pb1.pair.com header.from=rasmus@lerdorf.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=rasmus@lerdorf.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain lerdorf.com designates 209.85.192.54 as permitted sender) X-PHP-List-Original-Sender: rasmus@lerdorf.com X-Host-Fingerprint: 209.85.192.54 mail-qg0-f54.google.com Received: from [209.85.192.54] ([209.85.192.54:45710] helo=mail-qg0-f54.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 6B/60-18293-A118CC45 for ; Sat, 31 Jan 2015 02:15:39 -0500 Received: by mail-qg0-f54.google.com with SMTP id q108so41420868qgd.13 for ; Fri, 30 Jan 2015 23:15:36 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type; bh=OW99/f3mTS9F35rJlJNHdwUxLIPGLzyEB+PJyUIGuto=; b=IlVy9OwjZM9Lg+8Ie/jIPIoJRe0DWoVKEO/iyTYuASVYYw9g6+l1w44cFkqXRdsGEv rK1V5vFlbAEtl/ainBQgYjVIyIGXiZ+ZY5dzv92APf2Ci2fa/dwHdjATEy4tORRxj9G7 Waa6bUFM9R1aeEi54pwvuoeNsMS1m+H4sw86nLXYCzSAaFLd2fxwyCzT9saIrELe44y9 fOQU9/x6VTkU3YHpAQoveH31P1amLUxXWTAiLQbc7IHdTDTzrGw2SivUnvoF7R5fKNTS OzF2AZUHpWYbw6G8Z7RQmabMq6eAxWf7+33Anho9Yjrao3ypxDLcrP1yYA+M2fhF3Nih HLqQ== X-Gm-Message-State: ALoCoQmDmT1kqV3M3Is3ce9fcvkfz/uU5Spl3U2+KAHQ5O8Y8xLq2gd2lNXfPS90YxRvDemwegIb X-Received: by 10.224.36.68 with SMTP id s4mr20913520qad.56.1422688536168; Fri, 30 Jan 2015 23:15:36 -0800 (PST) Received: from [192.168.200.14] (c-50-131-44-225.hsd1.ca.comcast.net. [50.131.44.225]) by mx.google.com with ESMTPSA id e7sm12366318qag.10.2015.01.30.23.15.34 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 30 Jan 2015 23:15:35 -0800 (PST) Message-ID: <54CC8115.20705@lerdorf.com> Date: Fri, 30 Jan 2015 23:15:33 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Michael Wallner CC: PHP Internals References: <54CC625E.8030802@lerdorf.com> In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="fd61srIG5ksJHsj0klF3jiAV4e1fDXGId" Subject: Re: [PHP-DEV] Magic getter bug tickled by Moodle From: rasmus@lerdorf.com (Rasmus Lerdorf) --fd61srIG5ksJHsj0klF3jiAV4e1fDXGId Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 01/30/2015 11:13 PM, Michael Wallner wrote: >=20 > On 31 Jan 2015 06:04, "Rasmus Lerdorf" > wrote: >> >> There is something weird going on with PHP7 and the moodle_page class >> and all its magic methods. It dies with a: >> >> /var/www/moodle/blocks/navigation/block_navigation.php(223) : Notice -= >> Undefined property: moodle_page::$navigation >> /var/www/moodle/blocks/navigation/block_navigation.php(223) : Fatal >> error - __clone method called on non-object >> >> That code is: >> >> 222 $this->page->navigation->initialise(); >> 223 return clone($this->page->navigation); >> >> See: >> > https://github.com/moodle/moodle/blob/master/blocks/navigation/block_na= vigation.php#L222-L223 >> >> $this->page_navigation is created on that initial call through the >> wonders of this magic: >> >> https://github.com/moodle/moodle/blob/master/lib/pagelib.php#L757-L772= >> >> Which somehow leads us to read 8 bytes in a free'ed block: >> >> https://gist.github.com/anonymous/f9d1f53b1205d29d86cc >> >> but I am not having much luck dwindling it down to a simpler reproduce= >> case. If you know this code or have a couple of hours to spare, could >> you see if you could reduce it to something more manageable for us? >> >> (and yes, same code is fine in 5.6) >> >=20 > Here's a similar bug, too: https://bugs.php.net/bug.php?id=3D68933&edi= t=3D1 Ah, good catch. Yes, https://gist.github.com/arjenschol/3d94195ca51aa44db1c6 looks like a similar pattern to what Moodle is doing in that part of the code that seems to trigger this. -Rasmus --fd61srIG5ksJHsj0klF3jiAV4e1fDXGId Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlTMgRYACgkQlxayKTuqOuDGNACfQSCsKrmWZwhul8EQGVGo+YOg muYAnA9uwsj6vAuD9L9CkSeX1lpVfnAZ =unIr -----END PGP SIGNATURE----- --fd61srIG5ksJHsj0klF3jiAV4e1fDXGId--