Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:103630 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 20825 invoked from network); 24 Dec 2018 15:50:34 -0000 Received: from unknown (HELO NAM01-BN3-obe.outbound.protection.outlook.com) (40.107.74.98) by pb1.pair.com with SMTP; 24 Dec 2018 15:50:34 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=RWSoftware.onmicrosoft.com; s=selector1-zend-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=2QOaMcYp+cz/F52JVjWfWMvmGXtIQ5rwT6uvEGI9QcY=; b=LDqRww+FhgXAn25QKwiKGW1p1R9Clln1ITZbikrDnIGGRv5u3jQ5NxDIG4fCNxXO/Gd/tDVExksf6yHeK7/XWuxBliL7AvUFQZLi3ornMndVtBEvSKFVnhawixW46Tp5OnHVuuZmfX3LtljNo9vf5Xr+A1NCu/unIlrciE/xZd4= Received: from DM6PR02MB5932.namprd02.prod.outlook.com (20.179.68.220) by DM6PR02MB5962.namprd02.prod.outlook.com (20.179.69.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1446.21; Mon, 24 Dec 2018 12:20:55 +0000 Received: from DM6PR02MB5932.namprd02.prod.outlook.com ([fe80::f807:fcaa:cf5e:b0b0]) by DM6PR02MB5932.namprd02.prod.outlook.com ([fe80::f807:fcaa:cf5e:b0b0%5]) with mapi id 15.20.1446.026; Mon, 24 Dec 2018 12:20:55 +0000 To: Levi Morrison CC: internals Thread-Topic: [PHP-DEV] [RFC][Vote] Covariant Returns and Contravariant Parameters Thread-Index: AQHUl/AqXVQDKTyJX0uvYhkVZIp9sqWHwGIygABrD7KAACiCAIAAeZEAgAUDC8Y= Date: Mon, 24 Dec 2018 12:20:54 +0000 Message-ID: References: , In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=dmitry@zend.com; x-originating-ip: [212.232.72.197] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;DM6PR02MB5962;6:Yg7Hbb1jCarP/BmMLL8LRMaPrHHkbFNGDP/v3YBw5Eh0pcw58SzcAm1BYpLn4Gd4UIGvT5PJFLLUZu/VUdtW0pJ9HEfiPeOnmH8kB2L7FDUZIzAgIlwB6ZTU7n2MXiZmvJsNtwY9D/5DPXSuBr60z8Utif6F2h6OARzPiai0KxjTgBaDmhoVKeK2OaXRsu78M4xPi6SbsoSF5IR4Nms7XznrKH/heAKxi+IWcyEUfNfyczpZPRhRhUU9XfpEHfj8lR3vEYHuRPx5Ept7Yyor3DzZrZP3g45QQ8KcX/9fzWZj57+MoTegHbuaxN7tWBwEo3q7vzxi8cK49x785SES/qfd5dPPhVJA3h5Zh0lQznt4J0Q0sURL6KIM9KbIB/BsaXacl/wiBFNZA+q/56kVlcBNNbCu217gEJyn8gzKoPQ68h2ox5K7Gn4RvB1o1D/9dbzPrTYHbfFOGjL/+QEUxw==;5:8sCgiiDSMsvx0+Udka18jfShGOZyrw4JZzHoGjR/2W7E8gnNzd/W+Axnm6UhOiVRYZhc90U0HGgCsUVK/j9InXRnfFUEVY42NT4Y3fIInnPY9T2TXLWHZn9ab/q0hHaVxRT6vCUwFs2KBiF93zwNuxtGZyYPx2Tf6tlxuocO3Mw=;7:x88KQp0edzQFvcinEtYrtsbMLpp3HzyxGa6V1N89huaJwejf8RaD0RSchDt4+HSC78GEr2cKIZogEwOYUkgx8YvwAaNLTHN2nqJzqeSKIMPeiWbEgfEKSyIObCYaQQOkWZV1C65BYq6iOENs7rWvjA== x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-correlation-id: e6692258-7e76-4079-66ec-08d6699a40ca x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060)(7193020);SRVR:DM6PR02MB5962; x-ms-traffictypediagnostic: DM6PR02MB5962: x-microsoft-antispam-prvs: x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(3230021)(908002)(999002)(5005026)(6040522)(2401047)(8121501046)(3231475)(944501520)(52105112)(93006095)(93001095)(10201501046)(3002001)(6041310)(20161123560045)(20161123562045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(201708071742011)(7699051)(76991095);SRVR:DM6PR02MB5962;BCL:0;PCL:0;RULEID:;SRVR:DM6PR02MB5962; x-forefront-prvs: 0896BFCE6C x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(366004)(396003)(346002)(136003)(376002)(39830400003)(189003)(199004)(8936002)(53936002)(8676002)(81156014)(81166006)(55016002)(6606003)(5660300001)(66066001)(74316002)(7736002)(97736004)(9686003)(236005)(54896002)(6916009)(14454004)(99286004)(6306002)(68736007)(256004)(86362001)(14444005)(4326008)(19627405001)(229853002)(11346002)(186003)(476003)(53546011)(102836004)(6506007)(93886005)(25786009)(486006)(3846002)(2906002)(561944003)(6116002)(33656002)(7696005)(966005)(6436002)(71190400001)(71200400001)(6246003)(26005)(446003)(316002)(606006)(105586002)(76176011)(478600001)(106356001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM6PR02MB5962;H:DM6PR02MB5932.namprd02.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: zend.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: y+rz3qDmvRU58c1Nz57G56HxMMibQxvkvDB20NkRBJHRJ4xkgpWpjdkTi5+rw7QULtyjqJB/orkjNyNG80oyZk1dDC+KPZnCpParntS7CwwxVGJHEp4YiJIhR3mpXGWnNYvAZljlZx+kddSs4kr9xt8eew3d1iejPVJkK3TJ4usIKBV30bvCiQqk10ydrEPDwyUTV+u6rPUG+Q7+bEZnj1RJw35g+cuN583a8NcewTbx8PFWEa/Bsn4GYz7frSVyIOr5Xr2h4j8u8SujDwH+bHcvgGOim7Ra36eUnl1/hr3dcqUQWdLbshl9R5Q7VJDK spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: multipart/alternative; boundary="_000_DM6PR02MB5932BD07A788466EA2880114BFBB0DM6PR02MB5932namp_" MIME-Version: 1.0 X-OriginatorOrg: zend.com X-MS-Exchange-CrossTenant-Network-Message-Id: e6692258-7e76-4079-66ec-08d6699a40ca X-MS-Exchange-CrossTenant-originalarrivaltime: 24 Dec 2018 12:20:54.9458 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 32210298-c08b-4829-8097-6b12c025a892 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR02MB5962 Subject: Re: [PHP-DEV] [RFC][Vote] Covariant Returns and Contravariant Parameters From: dmitry@zend.com (Dmitry Stogov) --_000_DM6PR02MB5932BD07A788466EA2880114BFBB0DM6PR02MB5932namp_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Levi, I made just few tests, to understand that the implementation is at least in= complete. The warning message depends on class declaration order and may be emitted o= r not. 1. This test produces a warning (as RFC proposes) 2. But this test misses warning - The patch is incompatible with opcache (crashes on Wordpress, Drupal, and= probably any real-life app). - the incompatibility with opcache, doesn't allow to check the performance = implication of the patch - the patch has merge conflicts and travis tests doesn't run. Personally, I'm not against the proposal, but I'm definitely against this i= mplementation. Probably, it's better to cancel the voting and restart when the implementat= ion is ready. It's pity to see, that nobody tries the implementation but blindly vote... Thanks. Dmitry. ________________________________ From: Dmitry Stogov Sent: Friday, December 21, 2018 10:28:05 AM To: Levi Morrison Cc: internals Subject: Re: [PHP-DEV] [RFC][Vote] Covariant Returns and Contravariant Para= meters On 12/21/18 3:12 AM, Levi Morrison wrote: > On Thu, Dec 20, 2018 at 3:35 PM Dmitry Stogov wrote: >> >> Hi Levi, >> >> >> It looks like the patch broke something related to opcache. >> >> It crashes at least on Wordpress and Drupal. >> >> The backtrace https://gist.github.com/dstogov/a2305381a5c9982cceca9e4e25= 2d26c7 shows use-after-free in opcache (works fine with master). >> >> Inability to work with opcache, doesn't allow to check the performance i= mpact. >> >> >> It also broke few tests. Some crash. Some produce different warning/erro= rs. >> >> >> $ make test TESTS=3D"Zend tests" >> >> ... >> >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> FAILED TEST SUMMARY >> --------------------------------------------------------------------- >> ZE2 ArrayAccess and ArrayAccessReferenceProxy with references to main ar= ray [tests/classes/array_access_011.phpt] >> Bug #21478 (Zend/zend_alloc.c :: shutdown_memory_manager produces segfau= lt) [Zend/tests/bug21478.phpt] >> Generator methods can yield by reference [Zend/tests/generators/generato= r_method_by_ref.phpt] >> Testing to implement Serializable interface by traits [Zend/tests/traits= /interface_003.phpt] >> Handling of public fields with traits needs to have same semantics as wi= th normal inheritance, however, we do add strict warnings since it is easie= r to run into something unexpeted with changing traits. [Zend/tests/traits/= property009.phpt] >> iterable type#004 - Parameter covariance [Zend/tests/type_declarations/i= terable_004.phpt] >> iterable type#005 - Return type covariance [Zend/tests/type_declarations= /iterable_005.phpt] >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> >> I'll try to play with patch and make a full code review on next week. >> >> >> It would be great, if you fix opcache compatibility. >> >> If it can't be done in reasonable time, it's probably better to cancel v= oting and restart when ready. > > What OS and compiler are these on? Linux (Fedora 28), GCC 8.2.1. > How are you ensuring that opcache > is on when these tests are run? I have not been experiencing these > issues, so maybe I am not running it correctly. If I cannot reproduce > them soon then I will agree to cancel the voting. You should enable opcache in your php.ini zend_extension=3Dopcache.so opcache.enable=3D1 opcache.enable_cli=3D1 opcache.optimization_level=3D-1 opcache.protect_memory=3D1 ; this is for testing only Memory corruption bugs may lead to crash or not because of "luck", but it's possible to see them using valgrind. $ make test TESTS=3D"-m tests/classes/array_access_011.phpt" $ cat tests/classes/array_access_011.mem This shows almost the same backtrace, as I already published. Looks like an incorrect reference-counting on some string. > > There are some known issues outside of Zend. Notably some internal > classes do not have valid method signatures with regards to > inheritance which this patch exposed. These need fixed regardless of > this RFC and I have begun work on some of them (see > https://github.com/php/php-src/pull/3686 for one example). That PR looks fine. There is also a problem that this PR has merge conflict with master and travis doesn't run tests. Thanks. Dmitry. --_000_DM6PR02MB5932BD07A788466EA2880114BFBB0DM6PR02MB5932namp_--