This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug ada/24533] FAIL: a85013b: *** glibc detected *** free(): invalid pointer: 0x00062a00 ***
- From: "dave at hiauly1 dot hia dot nrc dot ca" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 3 Jan 2006 15:03:12 -0000
- Subject: [Bug ada/24533] FAIL: a85013b: *** glibc detected *** free(): invalid pointer: 0x00062a00 ***
- References: <bug-24533-276@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #5 from dave at hiauly1 dot hia dot nrc dot ca 2006-01-03 15:03 -------
Subject: Re: FAIL: a85013b: *** glibc detected *** free(): invalid pointer:
0x00062a00 ***
> The alignment clause takes *bytes*, not *bits*, so you need to use instead:
>
> for atomic_lock_t'Alignment use 16;
>
> The inconsistency between new and free for objects aligned more than
> Standard'Maximum_Alignment is indeed a known latent issue that
> is being worked on and is not trivial to fix, but should not affect the Ada
> run-time itself (except when a wrong clause is defined as was the case here).
>
> Change suggested above pre-approved.
This has been done
2005-12-28 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
* s-osinte-linux-hppa.ads: Correct alignment of atomic_lock_t.
and it doesn't fix the invalid tcb pointers being passed to free().
Reducing the alignment to 8, fixes the pointer problem. This will
work from a locking standpoint, but it's not correct from a struct
layout standpoint. However, it might be ok depending on how ada uses
atomic_lock_t objects.
If ada is going to align malloc'd pointers, then it should keep track
of the adjustment or the original pointer so that the memory can be
freed using the original pointer.
Dave
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24533