Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:108297 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 24183 invoked from network); 28 Jan 2020 19:04:33 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 28 Jan 2020 19:04:33 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id F05C4180548 for ; Tue, 28 Jan 2020 09:14:59 -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=-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,SPF_HELO_PASS,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS8075 40.64.0.0/10 X-Spam-Virus: No X-Envelope-From: Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12olkn2047.outbound.protection.outlook.com [40.92.22.47]) (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 ; Tue, 28 Jan 2020 09:14:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LzZnc8tbBthje6COPiPISSxiN3TZUXFBVGxrmxvJRjE8tIJxdm5K45IQ8GptPK3e2rFV18nZE2luE4IhD5OR5cLChTJxZ4FxfIVc3LmuhaNNZgyf6D84KY5Mba6dooGL8paDa4ZLTNcYPtiE8ChkDoiHR+mnUJBFHnAf0X4CM3ZiKe02uoYM/j/2K+6QUFGEBvYLGcFdUkZ6SlCqQc1ZkiWdC/fiTWI1LDzVBq7Pw1U0T3GpESzp5agRpz+ptGRbIITtPMw0zJlGJ/Ih2KIN3Jo4fVHd/0D5uAG7exTwvJWE5ZJ7in3qXPsqQtV76p0+3yYrt43pqArksVupFXU5iQ== 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=IyMJdx+bSkp3W+LkDTTOZMVL0XqyXNDsehTEiupolGI=; b=OKFL2KWyT3g0MvoTWHDg1EyudK1WIAqoDuVetbAFgLklLQ9/OTQ4kb3Yo/LgbbIJ6uiCWiMkT4ZBjtWwL4QSEcuQc7/8HKz0ayLpWXbPKDZbeg0Dmcd/qG71JzHreDisRlCdzkap6fRoGYi9cqDsUOIpU/gStYLI7G5cMlVsqZfdKf49+YEybnHxYnK8iOqipg1xR56if0Z8J/ZOWTF0fB362aCGnsXGR/p/HTj1uA4F7oOddP7CItD4Nkc653gaJz+NmTwc3oT+QrQHQzuDYbqvR2UvlJGlaMFkBP6g0QQon3XkugPz4v1SoUXVrOg3+Bg1RKWj1ZJSuT/cWuKMiw== 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=IyMJdx+bSkp3W+LkDTTOZMVL0XqyXNDsehTEiupolGI=; b=BOQ0CNinzO1ApQo+Iur2EEI2EDAl5VKNqDmsZFCmwXg5dCHYBsSNRyUIVHT6ZfDS0YJIWuAuXdEh40ncVbtT/qMAtm/dklWBmIAED42BQcVvzmMuXcZohWCsNmQoBC0t7Ceh9qDv5emZTy6GEX9RNd+4A8B20QTm2ZWNgtfMZg5tasMdkw+2WQY0YmnShLt8OlEiRo8cN+WD9lDdHtffFYdL2eA36OG1OcMyLSWnmuA3bq4Pba3orx1GDzOM5vFqYQ98NZTT/TcGTlkXm8VmiS++QDGZTNQiilhWGqF8MbXZzAavVKK5wSbbRGhsdPO+v1aLW2IgDE1BtiALV/fU7A== Received: from BN8NAM12FT019.eop-nam12.prod.protection.outlook.com (10.13.182.59) by BN8NAM12HT254.eop-nam12.prod.protection.outlook.com (10.13.183.183) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2686.12; Tue, 28 Jan 2020 17:14:57 +0000 Received: from DM5PR07MB3067.namprd07.prod.outlook.com (10.13.182.52) by BN8NAM12FT019.mail.protection.outlook.com (10.13.183.160) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2686.12 via Frontend Transport; Tue, 28 Jan 2020 17:14:57 +0000 Received: from DM5PR07MB3067.namprd07.prod.outlook.com ([fe80::29e3:53bf:163e:5beb]) by DM5PR07MB3067.namprd07.prod.outlook.com ([fe80::29e3:53bf:163e:5beb%3]) with mapi id 15.20.2665.026; Tue, 28 Jan 2020 17:14:57 +0000 To: Benjamin Morel , PHP Internals Thread-Topic: [PHP-DEV] How to debug a segmentation fault? Thread-Index: AQHV1fgMRGyLBah1gUGPr6kq4bV9NagATidQ Date: Tue, 28 Jan 2020 17:14:57 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-CA, en-US Content-Language: en-CA X-MS-Has-Attach: X-MS-TNEF-Correlator: x-incomingtopheadermarker: OriginalChecksum:7CFF0C35B4244A73BEA6D7C1BE49ADE476FC46BFD1A0889AC713840E47A5620D;UpperCasedChecksum:8AF5FC703C1C3BF13C376200BEE0E76C5109F06B2DD9DD5FC55CED10EDEB1F11;SizeAsReceived:6962;Count:45 x-ms-exchange-messagesentrepresentingtype: 1 x-tmn: [+6IW3fT7m1J6W42b0F5+32CGlrBlJuBB] x-ms-publictraffictype: Email x-incomingheadercount: 45 x-eopattributedmessage: 0 x-ms-office365-filtering-correlation-id: 50aab8ed-6d35-4688-ebf4-08d7a41599c9 x-ms-traffictypediagnostic: BN8NAM12HT254: x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: Nv7jQ6DRLB6mfofsgdFCU1ACOp3LkVd9sDUtNnVWJEteJjqIZnmtbY+eWyh2vBUsBl0Vun+3uUionSzYIUZBnQuncHtzLqyQCEGtZzOwTAimqgFjLev7KvXJCiVi+dg6QCjIChdctPXNwBXKKU1vB8HlL+9huO+CjuSCSZro/jssrGlEtlqDKAzF74lUwQYbwUeixkaIUoGuVLHLiyQapWE2PV5/Ji3dtnZuPmkDzrA= x-ms-exchange-antispam-messagedata: RKJq5IVAPqRq77NXIONWC+7+wWdzLxOUXuFDQ9S8fIJ+SE8Ee3gUzGdnEqQc7jfixLyl/XtrQIFCCxHwSBXKFjdCa7WB3S1M/JK1LAMstL079ScReCB2by6gNhJIqDY2PIawngcX5s/WQUY58LjSeQ== 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-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-Network-Message-Id: 50aab8ed-6d35-4688-ebf4-08d7a41599c9 X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-originalarrivaltime: 28 Jan 2020 17:14:57.7330 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Internet X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN8NAM12HT254 Subject: Re: [PHP-DEV] How to debug a segmentation fault? From: tysonandre775@hotmail.com (tyson andre) > I'm encountering a SIGSEGV in PHP-FPM on PHP 7.4.2 in a Symfony app. The= =0A= > bug seems to happen during the rendering of a Twig template; this makes i= t=0A= > hard for me to pinpoint the code that triggers the segfault.=0A= > =0A= > Could you please tell me what the procedure to collect information is, so= =0A= > that I can file a useful bug report?=0A= =0A= I'm not sure if there are official recommendations, but what I've done befo= re for httpd:=0A= =0A= 1. Do you have a line in your syslogs (e.g. /var/log/messages or elsewhere = for ip (instruction pointer) segfaulted in libphp7.so or elsewhere, etc. If= you run objdump --disassemble-all on the shared library where the crash oc= curs, you might know slightly more, but not very much, and would want to ge= nerate a core dump instead.=0A= =0A= For something like "segfault at ffffffff00000008 ip 00007f2ca2ef7121 sp = 00007ffeef578850 error 5 in libphp7.so[7f2ca2a83000+b95000]", it'd have cra= shed at the instruction on 0x00007f2ca2ef7121 - 0x7f2ca2a83000 in libphp7.s= o=0A= =0A= 2. I haven't tried these instructions before, but you probably want to enab= le core dumps. https://ma.ttias.be/generate-php-core-dumps-segfaults-php-fp= m/ (first google result) may help.=0A= Then, you can run 'gdb /usr/local/php/modules/libphp7.so /tmp/coredumpxx= x' to see the stack trace where the dump occurred to include it, and includ= e it in a bug report. (the path or shared library you want may differ)=0A= If you can install debugging symbols (I'm not sure what the package is c= alled - something like php-debuginfo or running debuginfo-install ....?), o= r build php with --enable-debug and reproduce the crash, that would also he= lp.=0A= Make sure to turn off core dumps and restart php-fpm when you're done.= =0A= =0A= Using a build of php configured with --enable-debug would also tell you i= f a ZEND_ASSERT failed before the segmentation fault (I think, I forget how= it works with fpm)=