From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 76865 invoked by alias); 14 May 2019 16:17:53 -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 76855 invoked by uid 89); 14 May 2019 16:17:53 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-5.6 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.1 spammy=UD:a.m, am, a.m, H*i:sk:tencent X-HELO: simark.ca Received: from simark.ca (HELO simark.ca) (158.69.221.121) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 14 May 2019 16:17:52 +0000 Received: from [172.16.0.120] (192-222-181-218.qc.cable.ebox.net [192.222.181.218]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 213981E05F; Tue, 14 May 2019 12:17:50 -0400 (EDT) Subject: Re: looking for gdb's help To: XXX <710492440@qq.com>, bug-gdb , "gdb@sourceware.org" References: From: Simon Marchi Message-ID: <1b1927f5-d0e8-c873-9dcf-45e6783d4cac@simark.ca> Date: Tue, 14 May 2019 16:17:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2019-05/txt/msg00024.txt.bz2 On 2019-05-14 3:26 a.m., XXX wrote: > hello! > > i have a question about gdb debugging. while a signal cause a core dump, how can i get which thread cause the signal. the _siginfo only records the pid, not thread id. while debugging the core file, the current thread is not the thread which cause the core signal. > > > i am looking for your reply, thank you! > Is this core dump created by the Linux kernel? IIRC, the Linux kernel typically places the signalled thread first in the list of of threads, such that when I open a core dump in GDB, thread 1 is usually the one that caused the problem. Simon From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 77430 invoked by alias); 14 May 2019 16:17:57 -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 77371 invoked by uid 89); 14 May 2019 16:17:57 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-5.5 required=5.0 tests=AWL,BAYES_00,SPF_FAIL autolearn=no version=3.3.1 spammy=hello!, H*r:bug-gdb@gnu.org, HTo:U*bug-gdb, H*r:sk:DHE_RSA X-HELO: eggs.gnu.org Received: from eggs.gnu.org (HELO eggs.gnu.org) (209.51.188.92) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 14 May 2019 16:17:56 +0000 Received: from fencepost.gnu.org ([2001:470:142:3::e]:38815) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hQa7l-0001JV-7D for gdb@sourceware.org; Tue, 14 May 2019 12:17:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49852) by fencepost.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1hQa7k-00025h-1Y for bug-gdb@gnu.org; Tue, 14 May 2019 12:17:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hQa7j-0001FH-7J for bug-gdb@gnu.org; Tue, 14 May 2019 12:17:51 -0400 Received: from simark.ca ([158.69.221.121]:38887) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hQa7j-0001EB-3N for bug-gdb@gnu.org; Tue, 14 May 2019 12:17:51 -0400 Received: from [172.16.0.120] (192-222-181-218.qc.cable.ebox.net [192.222.181.218]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 213981E05F; Tue, 14 May 2019 12:17:50 -0400 (EDT) Subject: Re: looking for gdb's help To: XXX <710492440@qq.com>, bug-gdb , "gdb@sourceware.org" References: From: Simon Marchi Message-ID: <1b1927f5-d0e8-c873-9dcf-45e6783d4cac@simark.ca> Date: Tue, 14 May 2019 22:04:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 158.69.221.121 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-SW-Source: 2019-05/txt/msg00025.txt.bz2 Message-ID: <20190514220400.rS6H84b5EFLv9rHHOy1qqiyGfAsmOLHO_0slG0crk74@z> On 2019-05-14 3:26 a.m., XXX wrote: > hello! > > i have a question about gdb debugging. while a signal cause a core dump, how can i get which thread cause the signal. the _siginfo only records the pid, not thread id. while debugging the core file, the current thread is not the thread which cause the core signal. > > > i am looking for your reply, thank you! > Is this core dump created by the Linux kernel? IIRC, the Linux kernel typically places the signalled thread first in the list of of threads, such that when I open a core dump in GDB, thread 1 is usually the one that caused the problem. Simon