Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:126120 X-Original-To: internals@lists.php.net Delivered-To: internals@lists.php.net Received: from php-smtp4.php.net (php-smtp4.php.net [45.112.84.5]) by qa.php.net (Postfix) with ESMTPS id DD6A71A00BD for ; Mon, 9 Dec 2024 14:34:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1733754700; bh=411soJLzT2QRzaRzAX5UHH+pAHZ1K488AhQemZFrU8Q=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=AwP1lFwXjgNalZCYHIJmAhyU0NToyDmLT+wDxLWVd7HczQX0t1G6KxXPSXxZ4qA4n GNPkehcOrbxgAg7lIM4DAMG09J9t3Fi5IyESp6ghvkZRU1BneR6FHIrBwrA2t0Frj1 QOQciXNfqcrH5/dlDlVj5cJqPQWYW6wS4kn97N2ebbfz1jIT1BLA/eKjxMRmyhLoNI gvgYToOZ0qhzRtP63hMxoMHwFS8j9wH1CiGEQVBg3JuQ2GDq92GHVU94gi0yfmUHgD 1QR+HJQdFugCwC3J/A2y2y9Zqx0WxmD5ojSF5hsgr3LSPWWbbJZzNGunvwI2AyWr8B bxu52IAk9gNAg== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 685B3180083 for ; Mon, 9 Dec 2024 14:31:39 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=0.6 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from chrono.xqk7.com (chrono.xqk7.com [176.9.45.72]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Mon, 9 Dec 2024 14:31:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bastelstu.be; s=mail20171119; t=1733754883; bh=BE5ICFcxMQ4jQuhEyrsIvbxAobDlXwPaW8dTb6yrNww=; h=MIME-Version:Date:From:To:Cc:Subject:In-Reply-To:References: Message-ID:Content-Type:from:to:cc:subject:message-id; b=XIJFtmtmNCka2IlctG2yfhQy8x9H1BWOiPM/k6auhb3oAz7FrUkh9C7h0mc4wllSN P3HTt+XpJxHo1P+IuHIGN8g7roFyA3iMO3mYWMM41oWAJubrZbRnSY1fdTufmuxsUq bMfZ/GCjeq33dThMzessS9BX23QplaRZflTDqoDz9zga3BuONoQuGOkPuoeuxVzmA0 uvMdVIBw7bjwtvL43uifIhn0rjJU3J756a/RoIzi+kPFri6sBz2IIU7dO39JlSxrPN PzkpXu0D3M/AAmQHHfz6T/71406dm1L+mU3xnFScdM/sil1ZQxngUb+DJI933o5RzT Q2llDk8Lf/0nQ== Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 Date: Mon, 09 Dec 2024 15:34:42 +0100 To: erictnorris@gmail.com Cc: PHP internals Subject: Re: [PHP-DEV] [RFC] [Discussion] Error backtraces v2 In-Reply-To: References: <8f268a8e-1646-455e-a1c2-b030581dcb9f@bastelstu.be> Message-ID: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit From: tim@bastelstu.be (=?UTF-8?Q?Tim_D=C3=BCsterhus?=) Hi Am 2024-12-06 02:08, schrieb Eric Norris: >> The “php.ini Defaults” section should probably refer to the voting >> widget as well. >> >> The first voting widget would probably be better phrased as: >> >> "Add the 'error_backtrace_recording' INI as described?" > > I'm a little nervous about this change, because I was hoping to be a > little more open-ended. For example, I'm not tied to the name > 'error_backtrace_recording', so I wouldn't want someone to vote 'no' > because they didn't like the setting name. Secondly, maybe we don't > want the zend global (which I'll actually get to in a bit), and > similarly I wouldn't want someone to vote 'no' because of that; I > don't actually care about whether it's a global or not, I only care > about getting backtraces for fatal errors. I believe RFCs should be sufficiently precise so that one is able to implement the proposal reasonably unambiguously based on the RFC text alone. Given that you are concerned about the INI setting causing the RFC not to pass, it should be evident that this is such an important topic that it needs the RFC to be clear about what is proposed for voters to be able to vote on the full picture. >> Normally one would expect the "Unlocked" to be printed between "Done" >> and "After", but this is not the case, because the Exception in the >> global keeps a reference to $lock within its backtrace. This would be >> the same if the Exception would instead be a `trigger_error()` that >> remains available via `error_get_last()`. >> >> In other words, we would have a INI setting that changes application >> behavior in subtle ways, which is a no-no. > > Great example, thank you. Since you are stating this is problematic - > and I don't necessarily disagree - does this make allowing backtraces > as implemented for non-fatal errors a non-starter? Presumably having a > backtrace for a fatal error doesn't matter since everything will soon > be destroyed in the process of shutting down. Yes, I agree that having a stacktracke for fatal errors is a non-issue. For non-fatal errors the INI setting definitely is a problem. Unconditionally having a stacktrace for non-fatal errors I'm am not yet sure if this would be a problem or if it would be fine if it is a RFC-agreed-upon (breaking) change. Given that it's common to turn warnings and notices into Exceptions and thus to treat them as hard errors, I'd be inclined to say that the value-add of having backtraces for them is fairly small compared to the possible impact and that it makes sense not to include this in the RFC at all. >> For the previous RFC this apparently was a non-issue, because the >> stack >> was stored as a string. But for your RFC this is an issue, because >> based >> on the tests it's stored as an array. > > I would have preferred to make this a parameter to zend_error_cb, but > I thought that changing the signature of that method might be too much > of a backwards compatibility break (though this would only affect > extensions). Making it a parameter would shorten the lifetime of the Making breaking changes to the internal API is generally fine if there is a reason for making the change. Best regards Tim Düsterhus