Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:95148 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 64670 invoked from network); 14 Aug 2016 21:32:40 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Aug 2016 21:32:40 -0000 Authentication-Results: pb1.pair.com smtp.mail=cmbecker69@gmx.de; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=cmbecker69@gmx.de; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmx.de designates 212.227.15.19 as permitted sender) X-PHP-List-Original-Sender: cmbecker69@gmx.de X-Host-Fingerprint: 212.227.15.19 mout.gmx.net Received: from [212.227.15.19] ([212.227.15.19:53457] helo=mout.gmx.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 3F/B2-36656-673E0B75 for ; Sun, 14 Aug 2016 17:32:38 -0400 Received: from [192.168.2.103] ([79.243.112.54]) by mail.gmx.com (mrgmx003) with ESMTPSA (Nemesis) id 0Lmqxo-1aydw540FQ-00h2rV; Sun, 14 Aug 2016 23:32:34 +0200 To: Stanislav Malyshev , Nikita Popov References: <85e38ba1-58d4-f8a7-33d4-5f4aa7fce44d@gmx.de> <19a35995-a032-3413-cade-919d60d33875@gmail.com> Cc: internals@lists.php.net Message-ID: <8e6deefe-4419-4592-04fd-b8e39f154228@gmx.de> Date: Sun, 14 Aug 2016 23:32:43 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <19a35995-a032-3413-cade-919d60d33875@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:k2eW0ETSxMvroASoELgL2TK6fHOzBNbEfX+EYykPBt9754ek697 vqMDAQFipTbufrgLHr5wUJeRCE3Yf7aTSTr3JTESOWG9+WHqgf2rmTC/ePIvkHMPZOOyzLt cSsR/tcKt2wvwhlD5WhWYCGgrpwno1RyBwL83FG2rpt4ffotnFJxVJCUgx+iKw8db7EOMkO dqVazAZRcHTsa/ZTNOjFw== X-UI-Out-Filterresults: notjunk:1;V01:K0:QSlXveJJVh4=:rxbDRf2KH//CXtR2DcDvwN Gxs1/jALREUQmXa83c2DZnkuwErYQjCfwWqplEMg7oopRN9hkseYWEuj5973oVawg0c7lcIF+ 9J5QtohIKtOmgRt2vUI15vxKpRUXb/Own0l+uIxkwe4KjGHWhALGpfFSZMnwM3uCOK1dmjDR9 /qL40QdsnT+3uArR24dGRoh5W9Gl+Nuz2jxJFx8yafFjl5zeOkjwQ/4h1LH+eIxtPjcbU4uRJ KLQknrIZ5MsbcsL9WcR/7thX+CI8P3uXnypmB6AzLzWpUk5rZ5WGZ+euhiv5AucjM9RmbJE/1 MyGsNwYnRuCLqbGqgbQgZZfE4uluU9F9Z5YBTG7TJcBCO0oOvWb7rJr5e14H226vPibRWadZi jWz2u7vls8P1HQPoN91OqMx1TvBWOY6lHC0Epu0Jj+agUlQqILdnafImsWatqpERjj6Iu23IR awMrU4TwYtMOle9FZSu2Zw+r8Gysdpb1Dmop0u0WH8+bV8+3sDs7w3fkJNRZKHJEZzcdsdvng B8Y0gyas+h8Ku7JmfGF/Me5cAkhDCMz7jae7dxon3JYfOT+/lUg/XxUQ7JfUKJiDlSlG8NDL+ IyHcdbyeHv5OaT2cDdP1s9f9598oLGoKZWkyaBy7Npe3YLs82+FiEJlJ/H0UN8LHuLFvWtr5g jy8+eGmPMJM2d3P3yPgTJbMBzjAdDEwYZ4UgIi/MoK1eNT8JoOS736Wjc0sN1tHFU1h/iRYgn UG8H3O/N+UjXVUpBIg317LhedV9UsIVoM6w7VHOJZovwKxVsQNziOX+CNqXGDhuN0432IZkka Cdc8c+6 Subject: Re: [PHP-DEV] Bug #72828 From: cmbecker69@gmx.de ("Christoph M. Becker") Hi! On 14.08.2016 at 10:21, Stanislav Malyshev wrote: >> You have commented on : >> >> | Unless the allocations explicitly use the system allocator (i.e. do >> | not use emalloc and variants), do NOT introduce NULL checks. >> >> Can you please elaborate, why that shouldn't be done. >> >> Actually, the allocations use safe_emalloc() and emalloc(), >> respectively[1]. However, the only client of the function does > > These do not need null checks. If e* functions can't alloc memory, they > produce fatal error, bail out and do not return. So if it returned, it > succeeded. The only reason why it can return null is a bug. In this case > we'd prefer it crashing fast - bugs in memory allocator are hard to > find, and closer to the source the crash is, easier it to catch it. > > If pe* or system functions are used, then check may be warranted. Thanks! I had already closed the bug report, because the issue affects only PHP 5.6, and I don't think this extraneous NULL check is a real bug. Please re-open if you don't agree, in which case I'll remove the NULL check. -- Christoph M. Becker