[Dune] Preconditioners
Christian Engwer
christian.engwer at uni-muenster.de
Thu Oct 27 14:03:59 CEST 2011
On Thu, Oct 27, 2011 at 11:33:22AM +0200, Alex Evanovic wrote:
> Hi,
>
> I used the tool gdb to debug the program,
The problem with gdb is that you only observe the real segfault. Often
problem happens much earlier. A segfault occures only, when you access
memory that is not assigned to your process. Consider the following
linked list:
struct chunk;
struct chunk {
float data[256];
chunk * next;
};
If your program access chunk.data[256] you will not have a segfault,
because you own the memory at this position, but it is not part of the
array, but you overwrite the next pointer. If you later try to
dereference the next pointer, you will (might) receive a segfault.
> & please find below the information at the segmentation fault. (I use the
> preconditioner SeqJac here).
> *
> Program received signal SIGSEGV, Segmentation fault.
> Dune::algmeta_itsteps<1>::dbjac<Dune::BCRSMatrix<Dune::FieldMatrix<double,
> 1, 1>, std::allocator<Dune::FieldMatrix<double, 1, 1> > >,
> Dune::BlockVector<Dune::FieldVector<double, 1>,
> std::allocator<Dune::FieldVector<double, 1> > >,
> Dune::BlockVector<Dune::FieldVector<double, 1>,
> std::allocator<Dune::FieldVector<double, 1> > >, double> (A=<optimized out>,
> x=<optimized out>, b=<optimized out>,
> w=@0x7fffffffd108) at /home/sj/dune/dune-istl/dune/istl/gsetc.hh:565
> 565 (*j).mmv(x[j.index()],rhs);*
You are using an optimized program for debugging this does usually not
work, because many information are not available any more (see e.g. the
"x=<optimizedo out>").
The last this is, that you usually can not tell problem from the call
stack, but only from the actually program run. You use your debugger
to investigate the state of your program. THus it is necessary to
create an _as small as possible_ test program that will trigger the
described problem.
Try to reduce complexity of your code. Either your problem will vanish
and you get an other clue on the actual problem, or you end up with a
small test cast that really shows a bug in dune and you can create a
bug.report with this test case for further investigation.
> Looking forward to your reply.
>
> Regards,
> Alex
Christian
PS: Are you aware that dune requires you to allow aliasing?
(see http://www.dune-project.org/faq.html#ToC9 and FS#674)
More information about the Dune
mailing list