[Bf-committers] makesdna.c 64 bit alignment detection bug reminder

Alfredo de Greef eeshlo at yahoo.com
Mon Mar 19 06:15:01 CET 2007


Hi,

A year ago, when I was still working on the yafray
export code, I encountered a problem that turned out
to be a 64 bit related problem, since I use 64 bit
linux.
It was hard to track down but eventually I found the
problem, it was the sdna test code, it doesn't always
detect alignment issues.
See thread here:
http://projects.blender.org/pipermail/bf-committers/2006-May/014757.html
and my commit:
http://projects.blender.org/pipermail/bf-blender-cvs/2006-June/006762.html

I had mailed Ton about this, tried to remind him a few
times, even sent a modified makesdna.c, but he is
probably too busy to remember all this, so I thought
I'd post it here so others can remind him as well ;)

Reason I post this now is that I just compiled Blender
again and just for 'fun' I thought I'd try my patched
makesdna.c again to see if there are still any
problems in sdna.
And I did find two alignement issues, IDPropertyData
struct as used in IDProperty in DNA_ID.h, and the
placement of ImagePaintSettings struct in ToolSettings
in DNA_scene_types.h.

Since I don't know if I'm allowed to make changes in
that area, I didn't commit the required changes (just
some extra padding), but should be easy enough to do
for anyone who has 'clearance' :)

The problem in makesdna is that it doesn't always seem
to detect correct alignment of 'embedded' structs,
structs in structs, my makesdna.c explicitly goes
through all structs, checking each recursively for
alignment at every variable.
According to Ton, makesdna.c is already supposed to do
something similar to this, so my modifcations were
probably a bit overkill, but obviously it has an as of
yet undetected bug somewhere...

This is not the definitive answer to all 64 bit issues
of course, but might be useful info.
apologies for the overly verbose post as always...

Alfredo



 
____________________________________________________________________________________
The fish are biting. 
Get more visitors on your site using Yahoo! Search Marketing.
http://searchmarketing.yahoo.com/arp/sponsoredsearch_v2.php


More information about the Bf-committers mailing list