Subject: [FEniCS-users] tensor constant function bug?

From: Patrick Riesen <[email-masked]>
Date: Tue, 22 Sep 2009 16:10:09 +0200

hi,

i get a segfault/*address not mapped* when trying to create a tensor 
constant function as follows:

     // create constant tensor function bcs
     shape.push_back(2); shape.push_back(2);

     values.push_back(0.0);
     values.push_back(0.0);
     values.push_back(0.0);
     values.push_back(0.0);

     _constraint = new Constant(shape, values);

a check with gdb reveals that in Constant.cpp for the function

Constant::Constant(const std::vector<uint>& shape,
                    const std::vector<double>& values)
   : Function(),
     _size(0), _values(0)
{

....

}

the variable _values is not mapped.

i guess the line

_values = new double[values.size()];

is missing before copying the values.

i'm running automatic augustin, but i check your doxygen doc on the web, 
and it's seems to be also missing in your development version.

should i report this to dolfin launchpad somehow?

best,
patrick