[ODE] Re: ALLOCA

Olivier Michel Olivier.Michel at cyberbotics.com
Mon Jun 21 14:12:06 MST 2004


Hi,

I finally patched the whole ODE against the stack overflow common 
problem using the ALLOCA replacement discussed earlier on this list. I 
had to change the invocation of ALLOCA in many files to make the patch 
simple and convenient to use. I wrote this patch very carefully. By 
default, it is off (and no changes occur comparing the normal version of 
ODE, i.e., stack allocation with risk of stack overflow). You have to 
edit the config/user-settings to turn it on and all the files will use 
the ALLOCA replacement after a recompilation. You can specify the size 
of the memory chunk used in config/user-settings as documented in this 
file (by default I set 4MB, but you can change it).

I would *really* appreciate if someone could commit it into the current 
CVS tree (after checking again it doesn't break anything, I have checked 
this myself, but you may also want to do so). This would avoid me having 
to rewrite it as soon as the source files change in the CVS.

Many thanks!

Here is a "cvs -nq update" output with my modfied version:

$ cvs -nq update
cvs server: WARNING: global `-l' option ignored.
? ode/src/dynamic_memory.cpp
? ode/src/dynamic_memory.h
M Makefile
M config/user-settings.example
M ode/src/collision_space.cpp
M ode/src/collision_space_internal.h
M ode/src/lcp.cpp
M ode/src/matrix.cpp
M ode/src/ode.cpp
M ode/src/quickstep.cpp
M ode/src/step.cpp
M ode/src/stepfast.cpp
M ode/src/timer.cpp
M ode/src/util.cpp

All the modified and new files are here:

http://cyberboticspc1.epfl.ch/ftp/ode_dynamic_memory.tar.bz2

Checking in should as simple as decompressing this archive into a fresh 
ode directory and commiting changes (assuming you have the ode distro in 
/home/user/ode):

cd /home/user
tar xjf ode_dynamic_memory.tar.bz2
cd ode
cvs add ode/src/dynamic_memory.cpp
cvs add ode/src/dynamic_memory.h
cvs commit -m"added dynamic memory replacement for ALLOCA"

Maybe a line in the CHANGELOG could be useful as well.

Thanks!

-Olivier


More information about the ODE mailing list