From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14919 invoked by alias); 5 Jun 2008 10:18:01 -0000 Received: (qmail 14894 invoked by uid 71); 5 Jun 2008 10:18:01 -0000 Resent-Date: 5 Jun 2008 10:18:01 -0000 Resent-Message-ID: <20080605101801.14893.qmail@sourceware.org> Resent-From: gdb-gnats@sources.redhat.com (GNATS Filer) Resent-To: nobody@sources.redhat.com Resent-Cc: gdb-prs@sources.redhat.com Resent-Reply-To: gdb-gnats@sources.redhat.com, orium69@gmail.com Received: (qmail 12357 invoked by uid 48); 5 Jun 2008 10:08:09 -0000 Message-Id: <20080605100809.12356.qmail@sourceware.org> Date: Thu, 05 Jun 2008 10:18:00 -0000 From: orium69@gmail.com Reply-To: orium69@gmail.com To: gdb-gnats@sources.redhat.com X-Send-Pr-Version: gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: backtrace/2463: Backtracing recursive main function call Mailing-List: contact gdb-prs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-prs-owner@sourceware.org X-SW-Source: 2008-q2/txt/msg00057.txt.bz2 >Number: 2463 >Category: backtrace >Synopsis: Backtracing recursive main function call >Confidential: no >Severity: non-critical >Priority: medium >Responsible: unassigned >State: open >Class: sw-bug >Submitter-Id: net >Arrival-Date: Thu Jun 05 10:18:01 UTC 2008 >Closed-Date: >Last-Modified: >Originator: orium69@gmail.com >Release: gdb-6.8 >Organization: >Environment: Linux localhost 2.6.23.16 #2 SMP Thu Feb 28 23:17:05 WET 2008 i686 i686 i386 GNU/Linux gcc version 4.2.3. gdb 6.8, configured as "i686-pc-linux-gnu" >Description: The gdb fails to print a correct backtrace of a program which segfaults with stack overflow in function main(). See how to repeat for more details. >How-To-Repeat: Create a file (coiso.c) with: int main(int argc, char **argv) { return main(argc+1,NULL); } Compile it and run it in gdb as shown: [orium@localhost tmp]$ gcc -ggdb -O0 coiso.c [orium@localhost tmp]$ gdb a.out GNU gdb 6.8 Copyright (C) 2008 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "i686-pc-linux-gnu"... (gdb) r Starting program: /tmp/a.out Program received signal SIGSEGV, Segmentation fault. 0x08048362 in main (argc=261948, argv=0x0) at coiso.c:6 6 return main(argc+1,NULL); (gdb) bt #0 0x08048362 in main (argc=261948, argv=0x0) at coiso.c:6 (gdb) print argc $1 = 261948 The gdb says argc is 261948 but the stack has only one function! >Fix: >Release-Note: >Audit-Trail: >Unformatted: