[petsc-users] segmentation error

siddhesh godbole siddhesh4godbole at gmail.com
Sun Jan 25 09:23:12 CST 2015


Thanks a lot Dave and Jed! That helped :)
On Jan 25, 2015 7:40 PM, "Jed Brown" <jed at jedbrown.org> wrote:

> Dave May <dave.mayhem23 at gmail.com> writes:
>
> > This type of bizarre unexplainable behaviour usually indicates memory
> > corruption.
> > For example: an illegal read of write from an array.
> > I suggest you run your code through valgrind to rule this out.
> >
> > Also, I would recommend you modify and annotate your functions to enable
> > petsc to generate a stack trace when segv's occur, i.e., declare them
> like
> > this
> >
> > #undef __FUNCT__
> > #define __FUNCT__ "MyFunction"
> > PetscErrorCode MyFunction(void)
> > {
>
> I agree with everything Dave says, but put the following before the
> first statement in the function.
>
>   PetscFunctionBeginUser;
>
> >     PetscFunctionReturn(0);
> > }
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20150125/13aeea3e/attachment.html>


More information about the petsc-users mailing list