Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:127201 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 A363A1A00BC for ; Sun, 27 Apr 2025 17:12:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1745773829; bh=m1fL792iSVDsEuwQNynjEfxlaB+NCahKuaPXX9wWzt8=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=S5cI5MRciuVJ9TPkqrj66xamJCM5uvJlBdmzSs37OFq7u09xrOELc34BMXoTnY8nB 4Ov+qmGrIsUoaylfdOkqY7k3svxmJE8h4rU19uUcJYZ9rDJln5f/+DpxnlVER/jICB 3iCGWi12TsB1LUrE8hgnZVYlwffH3GJgsbb7YmI7hhvwgx5yHykkgMy8u1Ma9EGarX H3x0z15VU6HFPwSlEzL4xlzwlmomyIzjz5ENOYagbaNwnZnqNRyZGUFJoftC1cdGdB fXy346DvhPKoaDpxca/FqZ2bUvlMXPI2h6yiSVedKI8vpfC1UsFwembEUceKrD5TfA 8wVQkI3YGy/wQ== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 23C201801D5 for ; Sun, 27 Apr 2025 17:10:29 +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,FREEMAIL_FROM, HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: Error (Cannot connect to unix socket '/var/run/clamav/clamd.ctl': connect: Connection refused) X-Envelope-From: Received: from mail-yw1-f169.google.com (mail-yw1-f169.google.com [209.85.128.169]) (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 ; Sun, 27 Apr 2025 17:10:28 +0000 (UTC) Received: by mail-yw1-f169.google.com with SMTP id 00721157ae682-70821dba48eso30433337b3.0 for ; Sun, 27 Apr 2025 10:12:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1745773966; x=1746378766; darn=lists.php.net; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=6DhzHHVzue0q70aQAGXyl4tFWtJPvRzDyELarWHyzh0=; b=YEA4sjj/VZAAoBa7WBuxEHcjw6DXTm8DxGNrvydfXRWztk4tv3czEbDDP1O8Ct6v5S Ozakm20mFKQrrmiAV9r2+fhi55gIWiDyA9pV8QeGsoZRC3+tFKuO3jVMSxpuBKTiE/YY c30JkEzA/PUM3zxUZswOgUYzFl8BXYvooYuLF6jRHvT1mc93DfA8SjyQ3Brjf9xIxL1V +hxGv+y1+zxH9vwN3yAKEDuy523nK6qoS+7vKOcU2Uk6Ew18EHbcDTErnbyAaLMfDZGI VBtqw7tjeiu6CaXTaPP9ZFxHV02pjDlp6SEAq00P9/sMXWkEZCD94+3UFrIQKLTvE5NV bDpQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1745773966; x=1746378766; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=6DhzHHVzue0q70aQAGXyl4tFWtJPvRzDyELarWHyzh0=; b=pLLXizc3xs7Lv7lVuCJsKGt4mckHOCuOMmcVi3xiZHWNdgJ7ZpzV0dCQowQkLRkZv1 YxvtQF1P3r+RBLg59d8ALEbvO3uD5N9FQlc/+0dU5j8lI+QAt3dv3i193Q6MRDl5P29d xTJV1Y223nuc6JOZczlRfL6tdFwb9qCSRnVx2fabCWg1FD4E56rPz4Y+49VOYBWn9nTT leq8eJpmzrFk/R7pX1gfA2HWfeD2nSLkCWE6GDUkVGrRcTGgf6Jk5lBU95adrwT/JDhi U4KS/GRxsfpop3wVrBoP3F+oRDzROBljsbrcBI0ytN22FPkmCOTi9HtSo3TXwVM6j/or J71Q== X-Forwarded-Encrypted: i=1; AJvYcCVaMKyMtUZTAd8158J+UjCh4j1agW6zo/noLoTdWPoZZKa6zH5ItViRVoz4ljIToRqdBVg23UH/MI4=@lists.php.net X-Gm-Message-State: AOJu0YxpP0kNpwMixnxNsQkMChnzEuiHX1Onf2JPwSJFUwl2sFoq81l9 v1FzIQlzSgd9bULxixD3uW8c6Q2t1pACuF7I5+VEMB6YqAFANpNJUKw5kRpPXlan66mHnhS5OG8 2KIoQ1yFOd7VjIOPR9uwDDNOV5hM= X-Gm-Gg: ASbGnctvqTrADfLoc1wFC8Ev1cBaIK+Zt1M7J/9r6tjO05zYvIFPFfBBjnnjm5hklL+ A+2h1zonywEm1IRiQ/owIpc2EuwOEc10zqGsEEINpAPl4tfYXjutkUBOzWWG0iFlVoK5qpQENFX 15MAzBoPIvOYb5ACmTfDz/hw== X-Google-Smtp-Source: AGHT+IHOzpcO86LQQq7ua8zuD+5Fehkaqyar/+tCUoC+Z65kFPhxqpg+z+Pu0MgsJmQ08Nz9ApXn5CndUkBvOOfvclw= X-Received: by 2002:a05:690c:b83:b0:6f9:4f93:c805 with SMTP id 00721157ae682-7085f1a8b89mr90851187b3.21.1745773965688; Sun, 27 Apr 2025 10:12:45 -0700 (PDT) Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 References: <39597a9c-6854-40c6-a529-32b2b178cb27@app.fastmail.com> <64f44c6f-a1ef-4a26-9063-d4d90fdf678c@app.fastmail.com> In-Reply-To: <64f44c6f-a1ef-4a26-9063-d4d90fdf678c@app.fastmail.com> Date: Sun, 27 Apr 2025 20:12:35 +0300 X-Gm-Features: ATxdqUGznpUJyJiRSjHePima2_d4DQUjVUMgii5SPuR1zLYwr9MMC6R7c5WmTG8 Message-ID: Subject: Re: [PHP-DEV] Concept: Lightweight error channels To: Rob Landers Cc: Larry Garfield , php internals Content-Type: multipart/alternative; boundary="000000000000154bd70633c5ad7d" From: edmond.ht@gmail.com (Edmond Dantes) --000000000000154bd70633c5ad7d Content-Type: text/plain; charset="UTF-8" The HHVM project suggests an interesting Lazy backtrace generation mechanism based on stack unwinding. 1. An exception is generated. 2. The stack enters an unwinding mode. In this mode, PHP gradually collects information into the backtrace. 3. Each frame exit contributes a part of the backtrace. 4. Once the exception is caught, the unwinding process stops. 5. Now a decision can be made: either generate the full backtrace or suppress the exception. Advantages: 1. Allows deferring backtrace generation until the exception is caught. 2. Allows suppressing exceptions without a backtrace, making their creation cost cheap. 3. Allows preserving exceptions with a backtrace only when necessary. Disadvantages: requires added complexity. --000000000000154bd70633c5ad7d Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

The HHVM project sugg= ests an interesting Lazy backtrace generation mechanism based on stack unwi= nding.

  1. An exception is generated.

  2. The stack enters an unwinding mode. In this mode, PHP g= radually collects information into the backtrace.

  3. Each frame exit contributes a part of the backtrace.

  4. Once the exception is caught, the unwinding process sto= ps.

  5. =C2=A0Now a decision c= an be made: either generate the full backtrace or suppress the exception.

=C2=A0=C2=A0
Advantages:
  1. Allows deferring backtrace generation until the excepti= on is caught.

  2. Allows suppressing exceptions without a backtrace, maki= ng their creation cost cheap.

  3. Allows preserving exceptions with a backtrace only when= necessary.

Disadvantages: requires added complexity.

--000000000000154bd70633c5ad7d--