Subject: Re: Using gdb to alter nmbclusters on 2.0 - core dump
To: None <netbsd-help@netbsd.org>
From: Christos Zoulas <christos@tac.gw.com>
List: netbsd-help
Date: 06/22/2005 18:59:44
In article <Pine.NEB.4.61.0506221628270.24412@ugly.precedence.co.uk>,
Stephen Borrill  <netbsd@precedence.co.uk> wrote:
>I'm trying to alter nmbclusters on 2.0_STABLE in the same as I've been 
>doing for years on 1.6.2 and earlier, but it's dumping core (on GENERIC 
>and pretty-much GENERIC kernels):
>
>  1# gdb --write /netbsd
>GNU gdb 5.3nb1
>Copyright 2002 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 conditions.
>Type "show copying" to see the conditions.
>There is absolutely no warranty for GDB.  Type "show warranty" for details.
>This GDB was configured as "i386--netbsdelf"...(no debugging symbols found)...
>(gdb) set nmbclusters=4096
>(gdb) quit
>Segmentation fault(core dumped)
>  2#
>

Yes, this has been fixed on head, and I asked for a pullup to 2.0 now.
Here it is since it is small...

christos

Index: elf-strtab.c
===================================================================
RCS file: /cvsroot/src/gnu/dist/gdb/bfd/elf-strtab.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- elf-strtab.c	11 Aug 2003 20:27:49 -0000	1.1.1.1
+++ elf-strtab.c	26 Dec 2004 16:55:00 -0000	1.2
@@ -253,6 +253,9 @@
   if (bfd_bwrite ("", 1, abfd) != 1)
     return false;
 
+  if (tab == NULL)
+    return true;
+
   for (i = 1; i < tab->size; ++i)
     {
       register const char *str;