[petsc-users] Crash in MatDuplicate_MPIAIJ_MatPtAP

Miorelli, Federico Federico.Miorelli at CGG.COM
Fri May 6 04:16:32 CDT 2016

Dear All,

I think there may be a bug in PETSc 3.7.0, function MatDuplicate_MPIAIJ_MatPtAP.
Whenever I call MatDuplicate on this type of matrix I'm getting SIGSEGV.

The bug is easily reproduced with the attached file. This is just ex2f from KSP, where I added two additional lines to create an A^T A matrix which is then duplicated.

      call MatTransposeMatMult(A, A, MAT_INITIAL_MATRIX, 1.d0, AtA, ierr)
      call MatDuplicate(AtA,MAT_COPY_VALUES,AtA2,ierr)

[1]PETSC ERROR: ------------------------------------------------------------------------
[1]PETSC ERROR: Caught signal number 11 SEGV: Segmentation Violation, probably memory access out of range
[1]PETSC ERROR: Try option -start_in_debugger or -on_error_attach_debugger
[1]PETSC ERROR: or see http://www.mcs.anl.gov/petsc/documentation/faq.html#valgrind
[1]PETSC ERROR: or try http://valgrind.org on GNU/linux and Apple Mac OS X to find memory corruption errors
[1]PETSC ERROR: likely location of problem given in stack below
[1]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.
[1]PETSC ERROR: [1] MatDuplicate_MPIAIJ_MatPtAP line 78 /state/std2/FEMI/PETSc/petsc-3.7.0/src/mat/impls/aij/mpi/mpiptap.c
[1]PETSC ERROR: [1] MatDuplicate line 4324 /state/std2/FEMI/PETSc/petsc-3.7.0/src/mat/interface/matrix.c



______ ______ ______
Federico Miorelli

Senior R&D Geophysicist
Subsurface Imaging - General Geophysics Italy

CGG Electromagnetics (Italy) Srl
This email and any accompanying attachments are confidential. If you received this email by mistake, please delete
it from your system. Any review, disclosure, copying, distribution, or use of the email by others is strictly prohibited.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20160506/7f6d5157/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ex2.F90
Type: application/octet-stream
Size: 15278 bytes
Desc: ex2.F90
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20160506/7f6d5157/attachment-0001.obj>

More information about the petsc-users mailing list