Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 08 Oct 1998 17:46:24 -0700
From:      Mike Smith <mike@smith.net.au>
To:        Studded <Studded@gorean.org>
Cc:        Mike Smith <mike@smith.net.au>, Archie Cobbs <archie@whistle.com>, FreeBSD-Hackers@FreeBSD.ORG
Subject:   Re: mail in free(): warning: junk pointer, too high to make sense. 
Message-ID:  <199810090046.RAA01827@dingo.cdrom.com>
In-Reply-To: Your message of "Thu, 08 Oct 1998 14:39:14 PDT." <361D3102.3EDDF6FB@gorean.org> 

next in thread | previous in thread | raw e-mail | index | archive | help
> Mike Smith wrote:
>  
> > It means that there are two instances of 'msgvec' with global scope,
> > and the other one needs to be found too.
> > 
> > You could probably just change the 'msgvec' in lex.c to be static in
> > order to achieve that goal; then you need to work out which object(s)
> > are exporting 'msgvec' as globals.
> > 
> > Any chance of you doing that?  Have a look at the output of 'nm' on each
> > of the .o files, and see which (if any) export or reference _msgvec.
> 
> 	ok, when I use the version of lex.c which has msgfoo declared static I
> get no _msgvec in any .o file. When I restore the original lex.c file,
> then declare msgvec static here is what I get:
> 
>  55# for FILE in `ls -1 *.o`; do echo $FILE; nm *.o | grep _msgvec |
> \more; done
> aux.o
> 00001354 b _msgvec
> 
> and identical output for the following files:

That's because there's a bug in your command; you should be passing 
$FILE to nm, not "*.o"

> However, looking at the files where msgvec is used, the only place it's
> declared globally is lex.c. When I tested the binary compiled with the
> static declaration in lex.c using gdb + AJ -> malloc.conf it didn't
> core, and there were no error messages. So perhaps making it static in
> lex.c is the answer after all?

I'm still wondering how it gets corrupted.  Making it static will have 
the effect of moving it around.  The fact that it was corrupted with 
something that looks very much like ASCII has me wondering whether 
there's not a buffer overflow going on.

Can you try 'nm mail | sort | more' and look at the symbols directly 
before msgvec?  I'd be inclined to suspect that there's a fixed-size 
character buffer there that's just not big enough for something on your 
system.

-- 
\\  Sometimes you're ahead,       \\  Mike Smith
\\  sometimes you're behind.      \\  mike@smith.net.au
\\  The race is long, and in the  \\  msmith@freebsd.org
\\  end it's only with yourself.  \\  msmith@cdrom.com



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199810090046.RAA01827>