[ODE] segv with memory allocation using dALLOCA16

Levy Alon alonl at techunix.technion.ac.il
Wed Nov 21 03:23:01 MST 2001


Hello everyone,

  I have a segmentation fault with my program, and it occurs in
step.cpp:795 :


    int mskip = dPAD(m);
    dReal *A = (dReal*) ALLOCA (m*mskip*sizeof(dReal));
->  dSetZero (A,m*mskip);
    for (i=0; i<nb; i++) {

  I have compiled a small test program to check just dALLOCA16 (ALLOCA is
#define-ed to be dALLOCA16 in the beginning of step.cpp). It turns out
that when requesting a larger then available memory segment it still
returns a non null pointer. So I'm guessing that's whats happening and
causing the seg fault (A isn't null when the segv occurs on line 795).

  Is there any way to correct this?

  btw I am running on linux with g++ 2.95.4 and the latest (cvs) ode
(updated a couple of hours ago).

  the original problem in my program occours with nb=101, nj=124. Has
anyone tried a bigger or same sized matrix succesfully? on what
hardward/software?

Alon




More information about the ODE mailing list