Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:108331 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 36231 invoked from network); 30 Jan 2020 14:37:12 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 30 Jan 2020 14:37:12 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id A5F6018054D for ; Thu, 30 Jan 2020 04:48:06 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-ot1-f45.google.com (mail-ot1-f45.google.com [209.85.210.45]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Thu, 30 Jan 2020 04:47:59 -0800 (PST) Received: by mail-ot1-f45.google.com with SMTP id i6so2969386otr.7 for ; Thu, 30 Jan 2020 04:47:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=LDof71O5vTNsjVE2lg3ckwsqGDxvyjhGHGzuNQdXYxI=; b=brVClm07oxa16y7PRVTghIyj813cG0PuuwH73ClQPHQd1mx3sIoAuMP+8F4YSJ3Cvy psPCCPTqxy/fz/j47Nib/2aPc8gy7Mvg5nxcbl75cb/PzlVaZfdCeABL/vQbSKd6Nh5w tNXTGU20/dCydiqdvAtUdC9VmTsTu2Gb2IiUBlKthtJcNzkI8AhNHox3oRqS8rCtWSTk rcVS5rrWTXsKGUSykveY6kucvZlnNfC6QmCHfhDyzmWGMN9cbo0fwwqaGB+TuVFjdKvg MYT/IUFQFTJaiQFq6eQn4VrHykZ0/vfr65yNJ7/3yeY1OzpIEUNi6n5vtSBc0rYOsZwh a9Aw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=LDof71O5vTNsjVE2lg3ckwsqGDxvyjhGHGzuNQdXYxI=; b=oGgm0L0kLalmPuBSy53Zmgr1CbBtHN3JQWlPIYG0EFEUgUZX7l1FVMbrMVWqVNlgFr 9U2XCZRrwatEPNGyvd4Msejw/lIzJiHBfkOWjzICTX7cPsiBoWiuZBGjvhyIvPs4MbF9 Sx2NQAhQdUrBrZ8z8IBuYIEs6Bkcu+Ahbctf38DiHtQ++0gvlDrTs/UBIKqNhIlGdnw4 ikHJR/p2mYYsxLR9VkSkpEPCqarb7suZ+Wa0h6mJQMdo6CP1y7W5zxFNPlQDhllXwcy/ 9tM1vmLCFUcNCwpHeCnZDdJRIQtiXaBWRLcPMfiRzZlBKkB1yEy0JndoZkJESb6gAIUp WwxQ== X-Gm-Message-State: APjAAAVpNQp+eWvbFchNeXUP6r3eqVI48zolcnXjVtFjX2DmQCFco08Q URTcQutwt8LA2NR8Hw9vHoLQfL+2n7yIUAeDcA0= X-Google-Smtp-Source: APXvYqx23EHafiwYgj9sC+62Gandca8qC69IfAIzMekk/x631pPL0RGZSgYiI/H94RBXosjI1vxBy/oAk/zwhA1Ciqw= X-Received: by 2002:a05:6830:184:: with SMTP id q4mr3431952ota.232.1580388476498; Thu, 30 Jan 2020 04:47:56 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: Date: Thu, 30 Jan 2020 13:47:45 +0100 Message-ID: To: tyson andre Cc: "bishop@php.net" , PHP Internals Content-Type: multipart/alternative; boundary="000000000000bfde69059d5add4a" Subject: Re: [PHP-DEV] How to debug a segmentation fault? From: benjamin.morel@gmail.com (Benjamin Morel) --000000000000bfde69059d5add4a Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable > > Infinite recursion leading to a segfault is **a known bug with no plans t= o > be fixed that I know of,** which I've encountered many times. That's unfortunate; as I said in the bug report, it's so easy to trigger and so easy to miss when reviewing the code! And the process crashing instead of reporting an error is really a pity. An explicit error message would be nice, but as I understand this would require setting a hard limit on the call stack depth, which may bring other issues. Thank you, =E2=80=94 Benjamin On Thu, 30 Jan 2020 at 03:59, tyson andre wrote= : > > Sorry, I didn't notice that https://bugs.php.net/bug.php?id=3D79194 was > already [solved and] closed with a similar answer. > > In addition to phpspy, a tool I forgot to mention was Phan. ( > https://github.com/phan/phan) > > `phan --redundant-condition-detection` will enable many of Phan's checks, > including code that looks like a function or method calling itself > unconditionally, or with the same args. > I got the idea for adding a check for PhanInfiniteRecursion > (and PhanPossiblyInfiniteRecursionSameParams) after investigating a simil= ar > segfault over a year ago ago > (and considering most of those solutions), > to detect that type of bug before it ran. > > https://github.com/phan/phan/blob/master/internal/Issue-Types-Caught-by-P= han.md#phaninfiniterecursion > has an example of what it detects --000000000000bfde69059d5add4a--