gdb/2188: gdb 6.5 -- internal error with "-var-update *" command

Greg Watson
Tue Jan 2 21:08:00 GMT 2007

The following reply was made to PR gdb/2188; it has been noted by GNATS.

From: Greg Watson <>
 Greg Watson <>,
 Clement Chu <>,
Subject: Re: gdb/2188: gdb 6.5 -- internal error with "-var-update *" command
Date: Tue, 2 Jan 2007 14:06:27 -0700

 I've isolated this problem further. MPI is no longer required to  
 repeat the problem. The environment is FC5, gcc 4.1.0 20060304 (Red  
 Hat 4.1.0-3), gdb 6.5.
 Compile this code with 'gcc -g -o test test.c':
   #include <stdio.h>
   #include <stdlib.h>
   int func(int *x)
            char *env = getenv("HOME");
            printf("env=%s\n", env);
            return 0;
   int main(int argc, char *argv[])
            return 0;
 Debug with gdb. Step over the call to func, then print the stack  
 using 'where':
 $ gdb test
 GNU gdb 6.5
 Copyright (C) 2006 Free Software Foundation, Inc.
 GDB is free software, covered by the GNU General Public License, and  
 you are
 welcome to change it and/or distribute copies of it under certain  
 Type "show copying" to see the conditions.
 There is absolutely no warranty for GDB.  Type "show warranty" for  
 This GDB was configured as "i686-pc-linux-gnu"...Using host  
 libthread_db library
 (gdb) b main
 Breakpoint 1 at 0x8048424: file test.c, line 13.
 (gdb) r
 Starting program: /home/greg/test
 Breakpoint 1, main (argc=1, argv=0xbf9fc8d4) at test.c:13
 13              func(&argc);
 (gdb) n
 14              printf("hello\n");
 (gdb) where
 #0  main (argc=Cannot access memory at address 0x0
 ) at test.c:14

More information about the Gdb-prs mailing list