|
From: Jeremy F. <je...@go...> - 2003-11-25 08:32:11
|
On Mon, 2003-11-24 at 03:32, Nicholas Nethercote wrote: > On Mon, 24 Nov 2003, Salim SAYOURI wrote: > > > It seems that the pointers used in Judy array are aligned on 8 bytes! And > > launching valgrind with the option --alignment=8 solves the problem. > > This is a fairly common problem... perhaps we should just change > Valgrind's allocator to align heap blocks on 8-byte boundaries? I know > that programs should, strictly speaking, be able to handle 4-byte > alignments. But it does cause difficult-to-understand problems with > Memcheck. Not sure. Malloc is required to return a block which is suitably aligned for any type, which means 8 bytes on the x86 (or perhaps even 16 bytes, given that SSE instructions need 16 byte alignment). I don't think there's any problem with returning 8 byte aligned blocks. J |
|
From: Nicholas N. <nj...@ca...> - 2003-11-24 12:06:07
|
On Mon, 24 Nov 2003, Dennis Lubert wrote: > This sounds like programming at microsoft. I would not try to spent time on > fixing tools/programs so that they work with invalid behaviour, guessing > what the user wants. Programs should be able to handle 4 bytes alignment. > If not, then they are not very well implemented. Anyone who needs this > should use valgrinds suppression feature, I think this is what it was > designed for : Not showing errors to users, which are well known. Looks like this is a divisive issue. It's unfortunate that the errors reported by Memcheck when 8-byte alignment is assumed don't make it at all obvious what the problem is. Which is the lesser evil -- not reporting bugs that occur because of alignment assumptions, or people not using Valgrind at all because they can't understand why it's complaining? Maybe a FAQ entry about this is a good compromise. N |