[petsc-users] Segmentation Violation
Matthew Knepley
knepley at gmail.com
Fri Aug 10 20:46:23 CDT 2012
On Fri, Aug 10, 2012 at 8:22 PM, Peter Zhoujie Lu <lzj at umich.edu> wrote:
> Dear all,
>
> I have some issue with my code using petsc. The exact same code runs fine
> on a linux box with ifort. Is that still be a possible memory corruption? I
> have some issue with getting valgrind working on 10.7. Is there any better
> way to debug this? Thanks. Here is the error message I got for OSX 10.7
> with gcc.
>
This is almost certainly you passing in an invalid pointer for the Vec you
are creating. Why not just use gdb? Also,
everyone here has valgrind running on OSX.
Matt
> Peter
>
> 0]PETSC ERROR:
> ------------------------------------------------------------------------
> [0]PETSC ERROR: Caught signal number 11 SEGV: Segmentation Violation,
> probably memory access out of range
> [0]PETSC ERROR: Try option -start_in_debugger or -on_error_attach_debugger
> [0]PETSC ERROR: or see
> http://www.mcs.anl.gov/petsc/documentation/faq.html#valgrind[0]PETSCERROR: or try
> http://valgrind.org on GNU/linux and Apple Mac OS X to find memory
> corruption errors
> [0]PETSC ERROR: likely location of problem given in stack below
> [0]PETSC ERROR: --------------------- Stack Frames
> ------------------------------------
> [0]PETSC ERROR: Note: The EXACT line numbers in the stack are not
> available,
> [0]PETSC ERROR: INSTEAD the line number of the start of the function
> [0]PETSC ERROR: is given.
> [0]PETSC ERROR: [0] VecCreateMPIWithArray line 312
> /Users/lvzhoujie/Work/petsc-3.3-p2/src/vec/vec/impls/mpi/pbvec.c
> --------------------------------------------------------------------------
> MPI_ABORT was invoked on rank 0 in communicator MPI_COMM_WORLD
> with errorcode 59.
>
> NOTE: invoking MPI_ABORT causes Open MPI to kill all MPI processes.
> You may or may not see output from other processes, depending on
> exactly when Open MPI kills them.
> --------------------------------------------------------------------------
>
> p.s. I also found /src/ksp/pc/examples/test/ex7.c not working on my
> computer. Here is the error message:
>
> [0]PETSC ERROR: --------------------- Error Message
> ------------------------------------
> [0]PETSC ERROR: Object is in wrong state!
> [0]PETSC ERROR: Must call MatXXXSetPreallocation() or MatSetUp() on
> argument 1 "mat" before MatSetValues()!
> [0]PETSC ERROR:
> ------------------------------------------------------------------------
> [0]PETSC ERROR: Petsc Release Version 3.3.0, Patch 2, Fri Jul 13 15:42:00
> CDT 2012
> [0]PETSC ERROR: See docs/changes/index.html for recent updates.
> [0]PETSC ERROR: See docs/faq.html for hints about trouble shooting.
> [0]PETSC ERROR: See docs/index.html for manual pages.
> [0]PETSC ERROR:
> ------------------------------------------------------------------------
> [0]PETSC ERROR: ./ex7 on a linux-ifo named peter-lu by plu Fri Aug 10
> 21:06:23 2012
> [0]PETSC ERROR: Libraries linked from
> /Users/lvzhoujie/Work/petsc-3.3-p2/linux-ifort-opt/lib
> [0]PETSC ERROR: Configure run at Fri Aug 10 10:44:21 2012
> [0]PETSC ERROR: Configure options --with-pic --download-openmpi=1
> --with-fortran=1 --with-debugging=1 --with-shared-libraries=1
> --download-superlu_dist=yes --with-fortran-interfaces=1
> --with-scalar-type=real --download-f-blas-lapack --with-cc=gcc
> --with-fc=gfortran --with-cxx=c++ --with-petsc-arch=linux-ifort-opt
> --download-parmetis=yes --download-metis
> [0]PETSC ERROR:
> ------------------------------------------------------------------------
> [0]PETSC ERROR: MatSetValues() line 993 in
> /Users/lvzhoujie/Work/petsc-3.3-p2/src/mat/interface/matrix.c
> [0]PETSC ERROR: main() line 25 in src/ksp/pc/examples/tests/ex7.c
> --------------------------------------------------------------------------
> MPI_ABORT was invoked on rank 0 in communicator MPI_COMM_WORLD
> with errorcode 73.
>
> NOTE: invoking MPI_ABORT causes Open MPI to kill all MPI processes.
> You may or may not see output from other processes, depending on
> exactly when Open MPI kills them.
> --------------------------------------------------------------------------
>
>
>
--
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which their
experiments lead.
-- Norbert Wiener
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20120810/fd4f4c5f/attachment.html>
More information about the petsc-users
mailing list