[Bf-committers] 64-bit bug loading .blend files containing scriptlinks

Ton Roosendaal ton at blender.org
Sat Nov 19 12:59:13 CET 2005


Hi,

this is struct ScriptLink:

typedef struct ScriptLink {
	struct ID **scripts;
	short *flag;
	
	short actscript, totscript;
	int pad;
} ScriptLink;

It only has 2 pointers... further, Blender structs are stuffed with  
pointers, on reading a 32 bits file, the 64 bits Blender DNA should  
detect this and reallocate the struct with correct data in it. The only  
thing that could use testing is endianness and 64 bits. But I assume  
the 32 bits file you tried is from a linux intel system too?

-Ton-



On 18 Nov, 2005, at 23:48, Ken Hughes wrote:

> This is the first real 64-bit bug I've seen (which is good).  A .blend  
> file from a 32-bit system which contains three scriptlinks is loaded  
> on my AMD64 system under linux.  As read_struct() load the file, it  
> gets to the structure for the scriptlinks and allocates memory for 3  
> pointers for a total of 12 bytes.  Later, when lib_link_scriptlink()  
> is called, it goes through trying to relink the objects, but thinks  
> slink->scripts is pointer at 8-byte pointers.  The result is memory  
> errors on exit (either from MEM_freen() or glibc).  For now I've  
> verified using a hack in lib_link_scriptlink() that correctly  
> converting the 32-bit pointers to 64-bit pointers and reallocating the  
> proper storage fixes the problem.
>
> Any suggestions what to do?  I'm not familiar with this part of the  
> source tree at all.
>
> Ken
> _______________________________________________
> Bf-committers mailing list
> Bf-committers at projects.blender.org
> http://projects.blender.org/mailman/listinfo/bf-committers
>
>
------------------------------------------------------------------------ 
--
Ton Roosendaal  Blender Foundation ton at blender.org  
http://www.blender.org



More information about the Bf-committers mailing list