Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:110721 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 99134 invoked from network); 25 Jun 2020 03:29:58 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 25 Jun 2020 03:29:58 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 209E81804E1 for ; Wed, 24 Jun 2020 19:17:31 -0700 (PDT) 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_H2,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-il1-f182.google.com (mail-il1-f182.google.com [209.85.166.182]) (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 ; Wed, 24 Jun 2020 19:17:30 -0700 (PDT) Received: by mail-il1-f182.google.com with SMTP id z2so3985065ilq.0 for ; Wed, 24 Jun 2020 19:17:30 -0700 (PDT) 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=g4VyBCUjXQ5RRnMuCS5RZN4XwTPZrbCgyC+nB7JxFes=; b=ARxdHsv86hB1hCJEdoVKFG/Tm+yLbnke5qaEeXF1m8Fts3eyBpwnxmB8vj+9lXZn+z Tblf8yyZ66UYR5+EzzuKga66jn8rbElp+AH+MzH70ThGq1s08s/YO9OOTrffhhngrukJ 7gUsqqW/eL+a0MU04TkbD/iHzvViZcxt3CZhcB1D2wej53R+ms8sFqrI6KpKb6c7Gc+2 Xq+wi5VlXmkm5mn5s771z+mObyKOf62f12W5vMIj+xjjC8bXrUqxfpcrH04na3S/eyxI TXozLNgIvpw1uP/RBvQYFbt4rRc0WTUUEqVjaT7TVDqrDs24cxl3ii5iksA92C1c7mhm IQ5A== 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=g4VyBCUjXQ5RRnMuCS5RZN4XwTPZrbCgyC+nB7JxFes=; b=S13uH35Ovm1dqCWdtItK8CLa+Fan6yx5AjJppYBCX4x+0i6JGWqY4+qUkbBiiqXQ6c gCwNF8gAS6NRS3uEJ5FoKsuPNT8Bx/xqhSMQb4WECsB3Y521YGv0ZCiTcoui7GPdsYZp xU+/csWohAHozbJZJ6vqV4l+psE5czH2TpUL5slzXinhQe04+esZ3iljA9AyfyEQUn+E 7LyOKq+H0i+QFAUfP7JaQPh5KkUv9EcVhQMALgKkHZaHO/2AnC56pL2rbPTDqxMA4epZ IFMz5NHRVRqT5xMtkyXQi3xN7M34a8FI40M6jdJcMgRkjuUQ4sp2eGmW05LcemXn/Onw JZeg== X-Gm-Message-State: AOAM531JYyVdOFyy81iahKLHV/mpjUXuM3EWlYpDfQx6WmywsEWNw6HG IrESbtkHwrtRvQpEbreABYJ58YWbTdkutpdQozc= X-Google-Smtp-Source: ABdhPJxGtsn/BT/+of6PXBTeOTF9p1r/xFt5zgsRWeSMfBoSGUcCBNqnOzvnCtfEGk40vMaAxq3Wl5UwbU1iLxBV+fQ= X-Received: by 2002:a92:4a04:: with SMTP id m4mr33421217ilf.228.1593051450211; Wed, 24 Jun 2020 19:17:30 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Wed, 24 Jun 2020 20:17:18 -0600 Message-ID: To: tyson andre Cc: Internals Content-Type: multipart/alternative; boundary="000000000000cca72f05a8df317e" Subject: Re: [PHP-DEV] Making the hardcoded string length limit of Throwable->getTraceAsString() configurable From: ryan.jentzsch@gmail.com (Ryan Jentzsch) --000000000000cca72f05a8df317e Content-Type: text/plain; charset="UTF-8" Why is there a 15 byte limit in the first place? On Wed, Jun 24, 2020, 1:22 PM tyson andre wrote: > > Hi internals, > > By default, strings in parameter lists are truncated to 15 bytes by > default in Throwable->getTraceAsString() > (and Throwable->__toString() as a consequence). > (in Zend/zend_exception.c in `static void _build_trace_args(zval *arg, > smart_str *str)`) > > This limit is too short to see relevant information such as file paths, > full urls, etc, which makes reporting bugs in applications inconvenient. > > Would there be any interest in an ini setting such as > `exception_string_length_limit` as a non-negative value to raise this > (either allowed to be 0 or more or 15 or more, defaulting to 15) > > It's possible to manually work around it by calling Throwable->getTrace(), > but inconvenient, > and there's always a concern about the user-space trace generation having > its own issues > (e.g. > https://github.com/phan/phan/blob/3.0.3/src/Phan/Debug/Frame.php#L25-L132) > > In applications that don't have a custom exception handler, users could > raise this to make creating bug reports easier. > > ``` > php > test('12345678901234567890'); > Warning: Uncaught Exception in php shell code:1 > Stack trace: > #0 php shell code(1): test('123456789012345...') > #1 {main} > thrown in php shell code on line 1 > ``` > > Thanks, > - Tyson > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: https://www.php.net/unsub.php > > --000000000000cca72f05a8df317e--