Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:71427 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 15988 invoked from network); 23 Jan 2014 10:34:53 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Jan 2014 10:34:53 -0000 Authentication-Results: pb1.pair.com smtp.mail=pierre.php@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=pierre.php@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.217.173 as permitted sender) X-PHP-List-Original-Sender: pierre.php@gmail.com X-Host-Fingerprint: 209.85.217.173 mail-lb0-f173.google.com Received: from [209.85.217.173] ([209.85.217.173:46316] helo=mail-lb0-f173.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E2/51-08036-B40F0E25 for ; Thu, 23 Jan 2014 05:34:52 -0500 Received: by mail-lb0-f173.google.com with SMTP id y6so1298126lbh.32 for ; Thu, 23 Jan 2014 02:34:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=zGxDj81xEuDSlncxnUW9t1qopAkg9dzwzcp86djouDo=; b=fzygseYYVyL6EsIiYRcGMBvVjmgkm2yZE6k9fcp1GRbME8RvCwd7aNg6h66pjnuoDE ZfPrt2yM3hEuott/HtYMb0sQ9sDKV28gDzFlGlN0AXZUdp6w0Vt+kKm3yvVyOZ0vniwS NU7HoA4371txQX2FZCZs3uD4AGp6XpO57CM2fBiB8ewTNP+4NkVAiaCmUVgTuRYbLugU mi5HV2aAIBS2X1ShzC+ZDg0Wlvnx3aW42hW6cmgU2Mk8H57x5xmGpQRPMJqj7DeT4kQ2 eqELxtxyyJPOn27JYnk2qnQHXXkFSRmD4+QrGlBAumXZcJFDUA5NAtlzHGMWMM1t6HOd dSoA== MIME-Version: 1.0 X-Received: by 10.152.120.135 with SMTP id lc7mr1150441lab.38.1390473288847; Thu, 23 Jan 2014 02:34:48 -0800 (PST) Received: by 10.112.35.134 with HTTP; Thu, 23 Jan 2014 02:34:48 -0800 (PST) In-Reply-To: References: Date: Thu, 23 Jan 2014 11:34:48 +0100 Message-ID: To: Dmitry Stogov Cc: Nikita Popov , Anatol Belski , PHP Developers Mailing List Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] [RFC] 64 bit platform improvements for string length and integer From: pierre.php@gmail.com (Pierre Joye) re, On Thu, Jan 23, 2014 at 10:13 AM, Pierre Joye wrote: > On Thu, Jan 23, 2014 at 9:42 AM, Dmitry Stogov wrote: >> I completely agree with Nikita. >> Why to rename LONG->INT STRLEN->STRSIZE in thousands places? >> Why not just define zend_long and zend_ulong to be 64-bit on 64-bit >> platforms and use them instead of int, ulint, zend_int, zend_uint, long, >> ulong where it's necessary. >> >> Anatol, I understood your point about catching incompatibility code at >> compile-time, but I'm not sure if the new features cost such huge code base >> changes. > > To catch 64bit issues at compile is immensely valuable. We had so many > issues in the past, some of them leading to security issues. It is > also a one time job, with a little extra effort for two years. > Besides the portability improvements, code review and correctness is > one of the goal of this RFC. I can't remember to know any widely known > and sane project relying on on other type for buffer length. PHP does > not have to be different :) > >> 1) 64-bit integers on Windows (they are already 64-bit on other systems) > > Almost all :) > >> 2) 64-bit string length. I don't think many people are interested in that. >> Fortunately, the patch doesn't change the zval size, so it shouldn't make a >> lot of harm. However, usage of "zend_size_t" instead of "int" is a bit >> annoying. I would change it into the same "zend_long" or "zend_ulong". > > It is not about being interested but preventing many security issues > as well, by default. The large buffer availability is a good side > effect. The implementation correctness is also drastically improved in > this case. After a short chat with Dmitry, it seems that the only open questions are: - renaming . pros . 100% compile time checks, unvaluable . clarity, no magic as we have now . code correctness, any 64bit port guides cover things the way we implemented it . cons . renaming will create extra work for the next 2 years . annoying (while I can live with it given the benefits in the long run) - SAPIs We have discussed many times the removal of the dead SAPIs. I think it is time to remove them and keep only those maintained and actually working (some sapis are not even possible to use anymore) I think we can clear these questions during the vote phases, as options. If anyone has an idea how to keep the advantage brought by the renaming (compile checks, clarity, code correctness) without actually doing the renaming in extensions, please fire it :) Cheers, -- Pierre @pierrejoye | http://www.libgd.org