This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: YAH8LP (Yet another H8 Ld Problem :)


On Thu, 2 Nov 2000, Joel Sherrill wrote:

> We are back to a core dump. It appears to be for a different reason.
> This is from the free at the bottom of the routine
> bfd_coff_reloc16_get_relocated_section_contents().  Is the pointer
> being corrupted?  There is some aliasing of it going on.

It's probably not the pointer but some piece of code writing outside of an
allocated memory block.  eg.

struct foobie *p = malloc (n * sizeof (struct foobie));
.
p[-1].field = crasho;
.
p[n+1].field = alternate_crasho;  // might not bomb on free (p), but free
.                                 // of something else.
free (p);

These sorts of bugs can be difficult to find.  Tools like purify and
electric-fence help.

-- 
Linuxcare.  Support for the Revolution.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]