------- Comment #6 from charlet at adacore dot com 2006-01-03 15:10 ------- Subject: Re: FAIL: a85013b: *** glibc detected *** free(): invalid pointer: 0x00062a00 ***
> 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. Hmm, so that means that 16 is bigger than Standard'Maximum_Alignment... Is it really the case that the C headers mandate an alignment of 16 for this type which is not guaranteed by malloc ? These alignment issues are very tricky, and GCC also has several notions of maximum alignments, so this are is definitely of that is causing many troubles with Ada when using GCC 3.x or 4.x Ada does not do anything with these directly, so things should be OK, except that it's easy to get a subtle alignment issue/discrepency. > 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. Right, and this is a non trivial task, hence my previous comment. Arno -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24533