Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:110717 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 44390 invoked from network); 24 Jun 2020 20:34:45 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 24 Jun 2020 20:34:45 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id C5F4418054B for ; Wed, 24 Jun 2020 12:22:15 -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=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS8075 40.80.0.0/12 X-Spam-Virus: No X-Envelope-From: Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12olkn2105.outbound.protection.outlook.com [40.92.21.105]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Wed, 24 Jun 2020 12:22:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Y8K83GLGi2dveYW+anjYld0njORuUSbCI0tWFzhyUq/UEYDfqPKlj4aDvOjcP5iMl4+cdeAV7Cx4L8zLyHpTCtz8IZj5YB8QICCcXaiPXpgaKZhHogIOZoBuznX2CAV34WssB+AL4+OFMv4T1pFT6ayMvz2styOkOuqLPppJKJKZoPLYrUO2GkBoBY7gcs9QvhulXbKGJifzOGmjH6YwKkHLezQX9lWJTYud+G+OrsBW91vbsCUvhE1v81E2Azr8iqy6tI/jR3973oRXUa5KBefnPfEWP04lFImT//ysjJFRiT3iG8XD4FdVhb0HB/rYH63vTjOXcz7iHZyolLq2yg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=rTKQLPSAg04wkwuJShm655PJxTzk0qmTeFB1pBVRDP8=; b=YCtqvsl5Hh7DDqgMDDnrOG8TpXpgA1zCNjyhVttd1OuRheoKHKntw6bhUk9T2gt3e22BqUrDU10Yo8/q6giKT0FepdlKb/ubVF2oYzErys7Gxx0thGn7FC4HCykHNcStw2m+bOmWV4i605mwivzzXLnbCraUyGuek3EU/qVD8wmuC7RNqFwov7VzWX3s6utg9IZ9XOKgJo0hmhKNK1RafHvj+qfXcRPFsD1CtnorlzahLx7wuKRAkn4/rmuruN2l+OVq+1aQlQXjP9X9tTHosMyVz6w8lP8ExtHP2ro1yYgDWhuga+WDOhIHihoLoIlU7A3n1Et0wC5kpDH01ae3tA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hotmail.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=rTKQLPSAg04wkwuJShm655PJxTzk0qmTeFB1pBVRDP8=; b=Kms1GZ0G4b6df/A5nHV0o0RPuqnTTLmEczz6ZSIdasmNB9EnizCyAp7V97SNTMvWmDnvOxOHdxyRN7HQrRvFVv6AD9Pg/GZWMzC0BKggjTiCTkQyoET6kcb6bG5XBx3CywEt3Amib7cB1SKErvl/m7K88XBfc6iM4Qu2EUcvGyZC5VkRAL9Via5IcR7iJevpGFBKIsLsLzx1HYQpERWE4oByyxL5V6rolxzJlWkeIB9axbnBMMOUaLyyuIZarZEzOU0EDvdiicKFSR7/V8KtszJX4xfOondn0mNLX6Sulw46w0g9JHF5JnEBYCCNFq4uYonFSn4eFhI5C70pkrz7EQ== Received: from BN8NAM12FT047.eop-nam12.prod.protection.outlook.com (2a01:111:e400:fc66::51) by BN8NAM12HT110.eop-nam12.prod.protection.outlook.com (2a01:111:e400:fc66::454) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3131.13; Wed, 24 Jun 2020 19:22:13 +0000 Received: from DM6PR07MB6618.namprd07.prod.outlook.com (2a01:111:e400:fc66::43) by BN8NAM12FT047.mail.protection.outlook.com (2a01:111:e400:fc66::318) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3131.13 via Frontend Transport; Wed, 24 Jun 2020 19:22:13 +0000 Received: from DM6PR07MB6618.namprd07.prod.outlook.com ([fe80::f0c8:f413:c7c1:e934]) by DM6PR07MB6618.namprd07.prod.outlook.com ([fe80::f0c8:f413:c7c1:e934%4]) with mapi id 15.20.3109.027; Wed, 24 Jun 2020 19:22:13 +0000 To: "internals@lists.php.net" Thread-Topic: Making the hardcoded string length limit of Throwable->getTraceAsString() configurable Thread-Index: AQHWSluH9mWyvPhluEKGvr5yJRT+2g== Date: Wed, 24 Jun 2020 19:22:13 +0000 Message-ID: Accept-Language: en-CA, en-US Content-Language: en-CA X-MS-Has-Attach: X-MS-TNEF-Correlator: x-incomingtopheadermarker: OriginalChecksum:8F1D9FEFCC8A2BD40B24A5BC228B44438CA4DF046A328E9A59F6DE10C7B8DC63;UpperCasedChecksum:364C7A9DC9C5682B6AA14F7BF00E3F986C030B0BAE2FDF8AE66E37EE39960F02;SizeAsReceived:6748;Count:41 x-tmn: [mBdbKA/1O/w/YCh38bTvavA7BMvLiQ1f] x-ms-publictraffictype: Email x-incomingheadercount: 41 x-eopattributedmessage: 0 x-ms-office365-filtering-correlation-id: 9b796f05-8d4d-4270-186e-08d81873e625 x-ms-traffictypediagnostic: BN8NAM12HT110: x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: uHdp2ARe/rTTks24E59j3QN3FCqTrY+W3g8JRzXNklV1ZtbYOoAenLyxne1p8yyGROYqK976KSaf/slffj4d+idBsNIInrQ0p4E+gG7Lr/eVsQKlhaeV5UAuK6e4hF4xqZozpbTwGTeduKqiHEPEyWBoRqugFfjgfp+Nv9p2W19dIkcit7uBJ7ebwMI4oBldBI2JvvPLUDmTCtDcODCxLskRqM5XgT8rVaGFUtHWp/+tIiz4IYqH16Y3k8+rjk6s x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:0;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR07MB6618.namprd07.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:;DIR:OUT;SFP:1901; x-ms-exchange-antispam-messagedata: v8KFkgz0IJONUPoQsYK7DfCQT5eoKbrTCpMRbuIo4QILZp7K0bkz7V4yAxgkgyySB0ZWPxXmjIEuTgC2U2PGnScsZdGkRndQN+fbMQsH1IdIGsIdwPx5ErWZNg7yYFmkANMWXc5jHO2zEOm239cGbw== x-ms-exchange-transport-forked: True Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: hotmail.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-AuthSource: BN8NAM12FT047.eop-nam12.prod.protection.outlook.com X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-Network-Message-Id: 9b796f05-8d4d-4270-186e-08d81873e625 X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-originalarrivaltime: 24 Jun 2020 19:22:13.3781 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Internet X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN8NAM12HT110 Subject: Making the hardcoded string length limit of Throwable->getTraceAsString() configurable From: tysonandre775@hotmail.com (tyson andre) Hi internals,=0A= =0A= By default, strings in parameter lists are truncated to 15 bytes by default= in Throwable->getTraceAsString()=0A= (and Throwable->__toString() as a consequence).=0A= (in Zend/zend_exception.c in `static void _build_trace_args(zval *arg, smar= t_str *str)`)=0A= =0A= This limit is too short to see relevant information such as file paths, ful= l urls, etc, which makes reporting bugs in applications inconvenient.=0A= =0A= Would there be any interest in an ini setting such as `exception_string_len= gth_limit` as a non-negative value to raise this (either allowed to be 0 or= more or 15 or more, defaulting to 15)=0A= =0A= It's possible to manually work around it by calling Throwable->getTrace(), = but inconvenient,=0A= and there's always a concern about the user-space trace generation having i= ts own issues=0A= (e.g.=A0https://github.com/phan/phan/blob/3.0.3/src/Phan/Debug/Frame.php#L2= 5-L132)=0A= =0A= In applications that don't have a custom exception handler, users could rai= se this to make creating bug reports easier.=0A= =0A= ```=0A= php > test('12345678901234567890');=0A= Warning: Uncaught Exception in php shell code:1=0A= Stack trace:=0A= #0 php shell code(1): test('123456789012345...')=0A= #1 {main}=0A= =A0 thrown in php shell code on line 1=0A= ```=0A= =0A= Thanks,=0A= - Tyson=