From owner-freebsd-hackers@FreeBSD.ORG Fri May 15 17:57:04 2015 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 09EFB6D8; Fri, 15 May 2015 17:57:04 +0000 (UTC) Received: from mail-ie0-x22c.google.com (mail-ie0-x22c.google.com [IPv6:2607:f8b0:4001:c03::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C705C1D1E; Fri, 15 May 2015 17:57:03 +0000 (UTC) Received: by iepk2 with SMTP id k2so121840282iep.3; Fri, 15 May 2015 10:57:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=ZEmUa9qmneavETpMzaJW/Rk4gV5007ielMO66E0yknk=; b=R1wE0bUKZKbh910QqasJWIJX03fQwzpbf6AIpwbfpT+fn4ejhmloiIllnDCuKxw7rE mNruRvvP3/5ny/ZUo5lP04OnfzN6CrEOuNqtXgRvdo2IPjinxaDg/BPMInVSvbSvKAsj vY1HJzIlfYGvBY733rGoBl//x3i89sOmWf1zRR3cZJFGAQAEVnLaVEkkP1GEYnK+xiGA D0usMRFXbI9CTx/H6YqFqjM4z9dM/9WxKHgVAY8i5q3HFJcAka1eu1tJW9UxTNM95PpL P3mIQ6DJBxBH8bk/rd2zsYlmWZQ1endzw2rm6ZHqM0txxfuvkZggfAjgVg6Mn3nllum1 +bFg== MIME-Version: 1.0 X-Received: by 10.42.146.202 with SMTP id k10mr22579446icv.34.1431712623197; Fri, 15 May 2015 10:57:03 -0700 (PDT) Received: by 10.107.40.194 with HTTP; Fri, 15 May 2015 10:57:03 -0700 (PDT) In-Reply-To: <555627EC.2020007@ignoranthack.me> References: <554E41EE.2010202@ignoranthack.me> <2063489.pgabuk9nPJ@ralph.baldwin.cx> <55561803.9050102@ignoranthack.me> <19618854.y3EeXVtCGX@ralph.baldwin.cx> <55561D9A.30309@ignoranthack.me> <555627EC.2020007@ignoranthack.me> Date: Fri, 15 May 2015 13:57:03 -0400 Message-ID: Subject: Re: How to get anything useful out of kgdb? From: Ryan Stone To: Sean Bruno Cc: "freebsd-hackers@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 May 2015 17:57:04 -0000 On Fri, May 15, 2015 at 1:07 PM, Sean Bruno wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA512 > > Hrm, when I look at them directly in the crashdump, I don't see > anything useful. > > (kgdb) tid 100058 > [Switching to thread 54 (Thread 100058)]#0 cpustop_handler () at > /home/sbruno/bsd/em_mq/sys/x86/x86/mp_x86.c:987 > 987 CPU_SET_ATOMIC(cpu, &stopped_cpus); > Current language: auto; currently minimal > (kgdb) whe > #0 cpustop_handler () at /home/sbruno/bsd/em_mq/sys/x86/x86/mp_x86.c:98 > 7 > #1 0xffffffff80f76f7a in ipi_nmi_handler () at > /home/sbruno/bsd/em_mq/sys/x86/x86/mp_x86.c:969 > #2 0xffffffff80e3657a in trap (frame=0xffffffff817eb910) at > /home/sbruno/bsd/em_mq/sys/amd64/amd64/trap.c:188 > #3 0xffffffff80e1b273 in nmi_calltrap () at > /home/sbruno/bsd/em_mq/sys/amd64/amd64/exception.S:509 > #4 0x0000000800841841 in ?? () > Previous frame inner to this frame (corrupt stack?) > *Sigh*, kgdb isn't unwinding the trap frame properly. You can try this to figure out where it was running: frame 2 info line *frame->tf_rip That gives you the top of the callstack at the time that the core was taken. To get the rest of it, try: define trace_stack set $frame_ptr=$arg0 set $iters=0 while $frame_ptr != 0 && $iters < $arg1 set $ret_addr=((char*)$frame_ptr) + sizeof(void*) printf "frameptr=%p, ret_addr=%p\n", (void*)$frame_ptr, *(void**)$ret_addr printf " " info line **(void***)$ret_addr set $frame_ptr=*(void**)$frame_ptr set $iters=$iters+1 end end trace_stack frame->tf_rbp 20