From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11400 invoked by alias); 26 Aug 2016 09:06:32 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Received: (qmail 11384 invoked by uid 89); 26 Aug 2016 09:06:31 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=1.8 required=5.0 tests=AWL,BAYES_50,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 spammy=H*MI:CY1PR0501MB1178, H*r:ip*10.160.145.14, HX-MS-Exchange-CrossTenant-id:sk:042bf9d, Hx-spam-relays-external:10.160.145.14 X-HELO: NAM03-DM3-obe.outbound.protection.outlook.com Received: from mail-dm3nam03on0082.outbound.protection.outlook.com (HELO NAM03-DM3-obe.outbound.protection.outlook.com) (104.47.41.82) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 26 Aug 2016 09:06:21 +0000 Received: from CY1PR0501MB1178.namprd05.prod.outlook.com (10.160.145.14) by CY1PR0501MB1178.namprd05.prod.outlook.com (10.160.145.14) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.587.5; Fri, 26 Aug 2016 09:06:18 +0000 Received: from CY1PR0501MB1178.namprd05.prod.outlook.com ([10.160.145.14]) by CY1PR0501MB1178.namprd05.prod.outlook.com ([10.160.145.14]) with mapi id 15.01.0587.013; Fri, 26 Aug 2016 09:06:18 +0000 From: Paul Marquess To: "gdb@sourceware.org" Subject: collecting data from a coring process Date: Fri, 26 Aug 2016 09:06:00 -0000 Message-ID: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Paul.Marquess@owmobility.com; x-ms-office365-filtering-correlation-id: 70e5e3b3-7d02-44de-7d22-08d3cd903da8 x-microsoft-exchange-diagnostics: 1;CY1PR0501MB1178;6:zoNO189pMAjhLOE7AySL23AqV5nA+S4LML7wXnsza6mv9SIKnriMMEU4gsZu3Ag/pWLhiYAbClOtu/IFhmihGaEZgSHEELrI9eOqiCrrNyaJLAkCQQfiq7TvB7IoDaN2tnwkLFPV58+zsOkTa9OfgDPfK/5xz4NLrhYplgTAjPzeqqbK4vDF/b0nmU2q1zBoZoIM+N9rt8YtpcMsLiXcE/dMNdBgBxHLhxPbxjlBnn4sssMVjPRKYQbnS+svlEwjd+L5uogU+ZiKZzFGSiwceCIoyHvLcgQkwCTtmalfkD8=;5:HXa5SjpsyvF2ghdgo40PMbBxO0OxIcFxlmSRD5x2k0qxB1hETj22fNaI1CHTqXVbIaQTos09NG7YxYpPK7I+60RLB6qJHu+Zfcg1bLwMLDYCixW+dBSZu3jLVA/a0u1IpwdtwSQuqugg9u1eXVf4hg==;24:pxN5fSW61EasnI+dw3UpmMiEn5E+fR9tfT78RmLhhSIeeOKAdXAxcg7dzUlST2ykOVpqYCElj0RjsAyEMcVI2oJO75zIl1SIC/yaUYG6gzQ=;7:Y0kdGCH6+0mXZfU42zGnMnDnZNvGT3YlpHfsEkn23rUERV8aumwVLZULLjwBgPDij04j5cgzfOmjqtpURLBTlGfOkMEq+69j+WdnTn0mf/vO30jc2UT/ppkgPJfEQj/M7+abkFon09Y8i4uZjmOGwdrV6nhHMjX8Q/e5ruoWtctQTttQ+N3mwkVjLV/A6TrJadlWY6IdzjvKrYauKsf3/CRTjGLsOaa5DFvWcMP8V3BrYToZx06z5ghu891Ge0y1 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CY1PR0501MB1178; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(6040176)(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001);SRVR:CY1PR0501MB1178;BCL:0;PCL:0;RULEID:;SRVR:CY1PR0501MB1178; x-forefront-prvs: 00462943DE x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(6009001)(7916002)(189002)(199003)(5002640100001)(99286002)(97736004)(50986999)(3280700002)(7846002)(68736007)(7696003)(7736002)(33656002)(81166006)(81156014)(92566002)(1730700003)(66066001)(9686002)(10400500002)(450100001)(54356999)(189998001)(8676002)(8936002)(11100500001)(110136002)(5640700001)(3660700001)(101416001)(586003)(77096005)(102836003)(2900100001)(86362001)(105586002)(229853001)(76576001)(6116002)(2351001)(5890100001)(2501003)(74316002)(305945005)(87936001)(107886002)(2906002)(5660300001)(122556002)(106356001)(3846002);DIR:OUT;SFP:1101;SCL:1;SRVR:CY1PR0501MB1178;H:CY1PR0501MB1178.namprd05.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; received-spf: None (protection.outlook.com: owmobility.com does not designate permitted sender hosts) spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: owmobility.com X-MS-Exchange-CrossTenant-originalarrivaltime: 26 Aug 2016 09:06:18.0266 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 042bf9d6-5c89-4240-a963-35f806e16660 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR0501MB1178 X-IsSubscribed: yes X-SW-Source: 2016-08/txt/msg00047.txt.bz2 I have an existing Linux application that uses gdb to collect data from a p= rocess if it cores. Currently I've been doing that with gdb after the core = is written to disk. No problem there. The requirements have now changed and it won't be possible to allow the cor= e file to be written to disk. That means I need a way to (somehow) get gdb = to collect the data while the process is still in memory. My first thought was to add a script in /proc/sys/kernel/core_pattern to ca= tch the process as it is coring. Then I get gdb to attach to the PID of the= process that is about to core. Unfortunately, when I tried that, gdb gives= me this error Unable to attach: program terminated with signal SIGSEGV, Segmentation = fault. No stack. That seems to imply that by the time /proc/sys/kernel/core_pattern kicks in= it is too late to use the PID with gdb. Anyone know of a way to do this? Preferably one that doesn't involve changi= ng the process itself. cheers Paul