This is the mail archive of the gdb-patches@sourceware.cygnus.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: gdb 4.18 / libiberty bugfix


"Julian v. Bock" wrote:
> 
> Hi!
> 
> problem:
> gdb segfaulted when demangling a (rather complex) c++ name while reading a
> symbol table.
> 
> bug:
> In the remember_type function (gdb-4.18/libiberty/cplus-dem.c) the typevec
> array of the work structure was zero, but work -> typevec_size was 3, so the
> function didn't allocate memory for typevec. When typevec was accessed gdb
> went down.
> The reason for this seems to be that when work -> typevec is freed in the mop_up
> function (same file; line 882) work -> typevec_size is not set zero.
> 
> solution:
> setting work -> typevec_size to zero after freeing work -> typevec should do
> the trick. After I have done this everything worked fine.
> 
> I hope this bug wasn't already known.

Yup, its already been fixed:

1999-04-20  Jim Blandy  <jimb@zwingli.cygnus.com>

        Fix from Dale Hawkins:
        * cplus-dem.c (mop_up): Set typevec_size to zero, so it'll be 
        reallocated properly if we use it again.

You may want to check out a more recent GDB snapshot.

thanks for reporting it,

	Andrew

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]