Re: glib segfault



On Mon, 25 Jan 1999, Havoc Pennington wrote:

> 
> On Mon, 25 Jan 1999, Sebastian Wilhelmi wrote:
> > 
> > > gnome-apt is dying here, I see there have been a flurry of changes to 
> > > this code recently. I don't see the problem offhand, maybe it's more
> > > obvious to whoever's been hacking on it.
> > 
> > Off hand I can't see, where the problem might be, So please have a deeper
> > look into that.
> > 
> 
> If I change the initial bufsize to 2, it goes away. However, that could be
> pure coincidence; I don't know.
> 
> Stepping through the code using bufsize 1, buffer is properly NULL for the
> first free, g_malloc returns a pointer which remains unchanged until the
> next g_free(), and that second free segv's.
> 
> (BTW, bufsize definitely needs to be more than 1 here anyway - starting
> with 2, it reaches 256 before it succeeds on my machine, so you may as
> well start with something bigger.)

yes, that's right, i set the buffer size to 1 to trigger underruns on
different systems untill we know the error handling works right.
since the buffer is used to hold the contents of the passwd fields, we
should choose a buffer size that comes close to the sum of the average
contents of pw_name (8+1) + pw_passwd (13+1) + pw_gecos (20+1) + pw_dir (14+1)
+ pw_shell (9+1), e.g. something around 69.

> 
> I've totally rebuilt glib and libgnome, but conceivably I need to make
> clean in gtk/ORBit/imlib instead of relying on .deps, and that explains
> it. It doesn't look much like a need-to-rebuild segfault to me though.
> 
> Thanks,
> Havoc
> 

---
ciaoTJ



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]