[ODE] Small memory bug in gimpact

Jon Watte (ODE) hplus-ode at mindcontrol.org
Tue Nov 20 18:15:40 MST 2007


That is the whole point. The only reason that code is there is to break 
into the debugger when malloc() returns NULL. Which it does either when 
you have corrupted the heap (most likely), or when you're trying to run 
a model larger than your system can handle (less likely).

Cheers,

          / h+


Chunky Kibbles wrote:
> Heya, I'm fairly certain this qualifies as a bug in gimpact.
>
> In gim_memory.cpp [in ODE 0.9], lines118-129:
> void * gim_alloc(size_t size)
> {
> 	void * ptr = 0;
> 	ptr = malloc(size);
> 	/*if (g_allocfn) ptr = g_allocfn(size); else ptr = * malloc(size);//_mm_malloc(size,0);*/
> 	if(ptr==0)
> 	{
> 		float * fp = 0;
> 		*fp = 0.0f;
> 	}
> 	return ptr;
> }
>
> That *fp=0.0f is always assigning a value to the memory pointed to by
> a a null pointer, which throws an exception here.
>
> Thanks,
> Gary (-;
> _______________________________________________
> ODE mailing list
> ODE at ode.org
> http://ode.org/mailman/listinfo/ode
>
>
>   


More information about the ODE mailing list