Subject: Re: The _weirdest_ segfault...
To: David Brownlee <firstname.lastname@example.org>
From: Andreas Falck <email@example.com>
Date: 05/17/2000 22:20:01
Oh yeah, it could help too :)
'i' is the size of the token:
Program received signal SIGSEGV, Segmentation fault.
0x160541330 in malloc ()
i=5 chrashes too, even though it worked above. But this works:
i=8 works, but the next segfault comes from within the readline lib!
#0 0x160541330 in malloc ()
#1 0x160235c3c in xmalloc ()
#2 0x1602210a8 in maybe_save_line ()
... (libreadline functions)
On Wed, 17 May 2000, David Brownlee wrote:
> What is i at that point (can you add a printf() directly before
> the malloc())
> It could be general memory corruption, but its much easier to
> verify the args passed first :)
> -- www.netbsd.org: No hype required --
> On Wed, 17 May 2000, Andreas Falck wrote:
> > > Out of curiosity, what value are you passing to malloc()?
> > >
> > Of course, I forgot:
> > temp = malloc((i + 1) * (sizeof(char)));
> > It allocates memory for a token out of a whitespace-separated string.
> > /Andreas