NetBSD Problem Report #46028

From njoly@thanos.sis.pasteur.fr  Wed Feb 15 19:22:32 2012
Return-Path: <njoly@thanos.sis.pasteur.fr>
Received: from mail.netbsd.org (mail.netbsd.org [149.20.53.66])
	by www.NetBSD.org (Postfix) with ESMTP id EF0FA63BCF4
	for <gnats-bugs@gnats.NetBSD.org>; Wed, 15 Feb 2012 19:22:31 +0000 (UTC)
Message-Id: <20120215192220.4D4B324C3B@thanos.sis.pasteur.fr>
Date: Wed, 15 Feb 2012 20:22:20 +0100 (CET)
From: njoly@pasteur.fr
Reply-To: njoly@pasteur.fr
To: gnats-bugs@gnats.NetBSD.org
Subject: gdb do not identify main() frame for core analysis
X-Send-Pr-Version: 3.95

>Number:         46028
>Category:       port-alpha
>Synopsis:       gdb do not identify main() frame for core analysis
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    port-alpha-maintainer
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Feb 15 19:25:03 +0000 2012
>Originator:     Nicolas Joly
>Release:        NetBSD 5.99.65
>Organization:
Institut Pasteur
>Environment:
System: NetBSD thanos.sis.pasteur.fr 5.99.65 NetBSD 5.99.65 (GENERIC-$Revision: 1.343 $) #3: Wed Feb 15 16:36:57 CET 2012 njoly@thanos.sis.pasteur.fr:/local/src/NetBSD/obj.alpha/sys/arch/alpha/compile/THANOS alpha
Architecture: alpha
Machine: alpha
>Description:
When doing post-mortem core analysis with gdb, it does not seems to properly
identify frame from main() function. Live analysis does not exhibit the
problem.

njoly@thanos [~/tmp]> cat sample.c 
#include <signal.h>
int main() {
  raise(SIGSEGV); }
njoly@thanos [~/tmp]> cc -g -O2 -o sample sample.c
njoly@thanos [~/tmp]> ./sample 
zsh: segmentation fault (core dumped)  ./sample

njoly@thanos [~/tmp]> gdb sample sample.core 
GNU gdb (GDB) 7.3.1
Copyright (C) 2011 Free Software Foundation, Inc.
[...]
Core was generated by `sample'.
Program terminated with signal 11, Segmentation fault.
#0  0x000000016018b7e4 in _lwp_kill () from /usr/lib/libc.so.12
(gdb) bt
#0  0x000000016018b7e4 in _lwp_kill () from /usr/lib/libc.so.12
#1  0x000000016018b6b8 in raise (s=<optimized out>)
    at /local/src/NetBSD/src/lib/libc/gen/raise.c:48
Cannot access memory at address 0x1ffffaf68

njoly@thanos [~/tmp]> gdb sample
GNU gdb (GDB) 7.3.1
[...]
Reading symbols from /home/njoly/tmp/sample...done.
(gdb) run
Starting program: /home/njoly/tmp/sample 

Program received signal SIGSEGV, Segmentation fault.
0x000000016018b7e4 in _lwp_kill () from /usr/lib/libc.so.12
(gdb) bt
#0  0x000000016018b7e4 in _lwp_kill () from /usr/lib/libc.so.12
#1  0x000000016018b6b8 in raise (s=<optimized out>)
    at /local/src/NetBSD/src/lib/libc/gen/raise.c:48
#2  0x00000001200009ac in main () at sample.c:3

>How-To-Repeat:
>Fix:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.