http://bugzilla.novell.com/show_bug.cgi?id=509527 Summary: gdb report incorrect address for argc after malloc call Classification: openSUSE Product: openSUSE 11.0 Version: Final Platform: 32bit OS/Version: openSUSE 11.0 Status: NEW Severity: Major Priority: P5 - None Component: Development AssignedTo: pth@novell.com ReportedBy: roberto.bernetti@poste.it QAContact: qa@suse.de Found By: --- User-Agent: Mozilla/5.0 (X11; U; Linux i686; it; rv:1.9.0.10) Gecko/2009042700 SUSE/3.0.10-1.1 Firefox/3.0.10 after an call to "malloc" gdb start to report incorrect call stack Reproducible: Always Steps to Reproduce: 1. this is the example code: #include <stdlib.h> #include <string.h> #include <stdio.h> void init() { char *ptr; ptr = (char *) malloc (2); } int main (int argc, char *argv[]) { int i; char *progname; i=argc; progname = argv[0]; init(); return 0; } 2. Compiling with this command: gcc -o memtest memtest.c -ggdb3 3. run the program using gdb Actual Results: (gdb) s init () at x.c:7 7 ptr = malloc (2); (gdb) where #0 init () at x.c:7 #1 0x0804845e in main (argc=1, argv=0xbffff694) at x.c:15 (gdb) s 8 } (gdb) where #0 init () at x.c:8 #1 0x0804845e in main (argc=0, argv=0x20ff1) at x.c:15 (gdb) s main (argc=0, argv=0x20ff1) at x.c:16 16 return 0; (gdb) where #0 main (argc=0, argv=0x20ff1) at x.c:16 (gdb) q The program is running. Quit anyway (and kill it)? (y or n) y -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.