Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:76998 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 29466 invoked from network); 31 Aug 2014 19:06:35 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 31 Aug 2014 19:06:35 -0000 Authentication-Results: pb1.pair.com smtp.mail=jocelyn.fournier@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=jocelyn.fournier@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.212.172 as permitted sender) X-PHP-List-Original-Sender: jocelyn.fournier@gmail.com X-Host-Fingerprint: 209.85.212.172 mail-wi0-f172.google.com Received: from [209.85.212.172] ([209.85.212.172:39312] helo=mail-wi0-f172.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 63/85-30065-A3273045 for ; Sun, 31 Aug 2014 15:06:35 -0400 Received: by mail-wi0-f172.google.com with SMTP id n3so11518226wiv.11 for ; Sun, 31 Aug 2014 12:06:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:message-id:date:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=GTQlgzyavQpPKs5DuRI1I3y0JzwB3SI/MbLe2wBaqqY=; b=V+nu9KEUXjpQzM0A1AU0tkt4xjkodjvCp5GjjsyV/8VYOstkJsbP2crXCIrWe9NWSE malwpWc3H9EawD4+gKS0K8IeM0gD9mTFyyzYTP4XdveqOA0teYkYdVftKvaVPLFQY4P0 kka0Gye89YkvAcWSg9JsHB+qvd9hQ9kl5nNpSBS7P5nxgB7hKKv7gA8zwdBJmo3m6Leg z6wwEZyTpy4bo0FtEL/1mojWPEfa/puofGof/ofteUv36E6qf+8B0YTbd2kN76P5Y5cS hC7qRyuowQGTADxTH5OSpivcVyjTqdrPiMc2mFgqw28DI9FYKwRapKM5U5ihsabTvHko EUcA== X-Received: by 10.180.74.198 with SMTP id w6mr17056418wiv.7.1409511990901; Sun, 31 Aug 2014 12:06:30 -0700 (PDT) Received: from MacBook-Pro-de-jocelyn-fournier.local ([2a01:e35:2ea9:c3d0:3101:1fe0:2e8:ca5a]) by mx.google.com with ESMTPSA id s3sm18275318wis.3.2014.08.31.12.06.29 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 31 Aug 2014 12:06:30 -0700 (PDT) X-Google-Original-From: jocelyn fournier Message-ID: <54037234.2030200@gmail.Com> Date: Sun, 31 Aug 2014 21:06:28 +0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:31.0) Gecko/20100101 Thunderbird/31.0 MIME-Version: 1.0 To: Stas Malyshev , Nikita Popov CC: PHP Internals , Dmitry Stogov References: <54027B6D.7060708@sugarcrm.com> <54036DEA.8060902@sugarcrm.com> In-Reply-To: <54036DEA.8060902@sugarcrm.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [PHP-DEV] destructors and output_buffering From: jocelyn.fournier@gmail.com (jocelyn fournier) Hi, Another possible behaviour would be to trigger a fatal when trying to access a partially destroyed object in ob_start. It took me a while to actually figure out why the memory was corrupted when doing stuff in ob_start() (even before playing with the AMQP lib). Having a fatal would allow me to save a lot of time, and it should not introduce any BC issue since any existing code accessing a partially destroyed object could randomly crash at some point. Jocelyn Le 31/08/2014 20:48, Stas Malyshev a écrit : > Hi! > >> Instead of iterating through all objects and setting a flag, can't we >> set a global flag that object dtors are not called after this point? > We could, but that would probably break some code that expects dtors to > be actually called. E.g. in the bug, the library there seems to do a lot > from the dtor, and if we just shut it down it may break the library. I > don't think we can do this in 5.x. > > And I don't think we could get rid of the object flag in that case, > since there could be cases of circular links that may still require this > flag to avoid double calling of dtor (even not on shutdown). > >> This both solves the issue of new objects being created after the fact >> and makes shutdown less expensive. > I'm not sure expense of the shutdown is that big a deal though. Bigger > deal is avoiding crashes on the shutdown. > It seems to be that disabling dtors on all objects there is a bit too > harsh - after all, for most of them it is fine, it's just those that > linger after the OB code run _and_ have dependencies on other objects > that create trouble. Another dtor round, for example, should resolve it, > or just marking only those that linger as destroyed. This seems to have > less impact that just banning dtors altogether.