Re: Segmentation fault from free()

Robert Schiele <[email protected]> Tue, 24 Aug 2004 23:49:59 +0200
Newsgroups org.kernel.vger.linux-gcc,org.kernel.vger.linux-c-programming
Message-ID <[email protected]>
On Tue, Aug 24, 2004 at 05:25:07PM -0400, Lei Yang wrote:
> Do you mean that something 'free' needs has been destroyed?

Free memory has is managed by the heap data structure. If you free an address
twice or free an adress that was never allocated, the data structure will get
corrupted. Often this does occur silently, but in a later state a malloc or
free call with this corrupted data structure might crash your application.

> Why this wouldn't happen with small files?

I don't know your application and thus I am not even sure that this is the
source of your problem. This was just a wild guess as it is a typical error in
such situations.

Robert

-- 
Robert Schiele			Tel.: +49-621-181-2517
Dipl.-Wirtsch.informatiker	mailto:[email protected]
signature.asc (application/pgp-signature, 189 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFBK7gHxcDFxyGNGNcRAjVzAKDjvmqq24vftLG8AjM/ASH1PJY/zgCfQdIk
u5sOrAnhPuAr1CTCj3upxWI=
=Uan+
-----END PGP SIGNATURE-----