[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Bug-gnubg] match export to html
From: |
Jim Segrave |
Subject: |
Re: [Bug-gnubg] match export to html |
Date: |
Tue, 13 Aug 2002 13:55:28 +0200 |
User-agent: |
Mutt/1.2.5i |
On Tue 13 Aug 2002 (13:04 +0200), Jim Segrave wrote:
> On Tue 13 Aug 2002 (10:19 +0000), Joern Thyssen wrote:
> > On Tue, Aug 13, 2002 at 12:06:45PM +0200, Jim Segrave wrote
> > > On Tue 13 Aug 2002 (08:59 +0200), Achim Mueller wrote:
> > > > When exporting a match to html gnubg saves the file and then says
> > > > goodbye with a segmentation fault.
> > >
> > > On FreeBSD I get:
> > >
> > > (No game) lo mat 1.sgf
> > > (Game over) export match html "/home/jes/1.html"
> > > gnubg in free(): warning: junk pointer, too high to make sense
> > > gnubg in free(): warning: junk pointer, too high to make sense
> > >
> > > This suggests a pointer has been corrupted prior to calling free().
> > > I now know how to find and trap on this warning in gdb, so I should be
> > > able to locate the corruption. I'll try to look at this later today.
> >
> > Don't bother -- I think I know where the problem is. I'll fix it
> > tonight.
>
> OK - it's not the easiest of things to track, so if you know where to
> look, that will save a lot of time.
My curiousity got the best of me over lunch.
in html.c, line 360
you are trying to free the results of basename ( HTMLFilename ( sz, 0 ) )
HTMLFilename ( sz, 0 ) will return a pointer to a malloced string, but
basename will change that pointer, meaning it can't be passed to
free().
Actually, to be sure of cleaning up little mallocs under error
conditions, you need a bit more - patch against
$Id: html.c,v 1.56 2002/08/11 15:59:15 thyssen Exp $
attached.
--
Jim Segrave address@hidden
html.diff
Description: Text document