<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:Consolas;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-family:Consolas">Dear All,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas">I think there may be a bug in PETSc 3.7.0, function MatDuplicate_MPIAIJ_MatPtAP.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas">Whenever I call MatDuplicate on this type of matrix I'm getting SIGSEGV.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas">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.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas"> call MatTransposeMatMult(A, A, MAT_INITIAL_MATRIX, 1.d0, AtA, ierr)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas"> call MatDuplicate(AtA,MAT_COPY_VALUES,AtA2,ierr)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:Consolas"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas">[1]PETSC ERROR: ------------------------------------------------------------------------<span style="color:black;background:black;mso-highlight:black"><o:p></o:p></span></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas">[1]PETSC ERROR: Caught signal number 11 SEGV: Segmentation Violation, probably memory access out of range<span style="color:black;background:black;mso-highlight:black"><o:p></o:p></span></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas">[1]PETSC ERROR: Try option -start_in_debugger or -on_error_attach_debugger<span style="color:black;background:black;mso-highlight:black"><o:p></o:p></span></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas">[1]PETSC ERROR: or see http://www.mcs.anl.gov/petsc/documentation/faq.html#valgrind<span style="color:black;background:black;mso-highlight:black"><o:p></o:p></span></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas">[1]PETSC ERROR: or try http://valgrind.org on GNU/linux and Apple Mac OS X to find memory corruption errors<span style="color:black;background:black;mso-highlight:black"><o:p></o:p></span></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas">[1]PETSC ERROR: likely location of problem given in stack below<span style="color:black;background:black;mso-highlight:black"><o:p></o:p></span></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas">[1]PETSC ERROR: --------------------- Stack Frames ------------------------------------<span style="color:black;background:black;mso-highlight:black"><o:p></o:p></span></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas">[0]PETSC ERROR: Note: The EXACT line numbers in the stack are not available,<span style="color:black;background:black;mso-highlight:black"><o:p></o:p></span></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas">[0]PETSC ERROR: INSTEAD the line number of the start of the function<span style="color:black;background:black;mso-highlight:black"><o:p></o:p></span></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas">[0]PETSC ERROR: is given.<span style="color:black;background:black;mso-highlight:black"><o:p></o:p></span></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas">[1]PETSC ERROR: [1] MatDuplicate_MPIAIJ_MatPtAP line 78 /state/std2/FEMI/PETSc/petsc-3.7.0/src/mat/impls/aij/mpi/mpiptap.c<span style="color:black;background:black;mso-highlight:black"><o:p></o:p></span></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas">[1]PETSC ERROR: [1] MatDuplicate line 4324 /state/std2/FEMI/PETSc/petsc-3.7.0/src/mat/interface/matrix.c<span style="color:black;background:black;mso-highlight:black"><o:p></o:p></span></span></p>
<p class="MsoNormal"><span style="font-family:Consolas"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas">Thanks,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas">Federico<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas"><o:p> </o:p></span></p>
<p class="MsoNormal"><b><span lang="IT" style="font-size:18.5pt;font-family:"Arial","sans-serif";color:#0093D0;mso-fareast-language:IT">______</span></b><b><span lang="IT" style="font-size:18.5pt;font-family:"Arial","sans-serif";color:#6A737B;mso-fareast-language:IT">
</span></b><b><span lang="IT" style="font-size:18.5pt;font-family:"Arial","sans-serif";color:#8CC63F;mso-fareast-language:IT">______</span></b><b><span lang="IT" style="font-size:18.5pt;font-family:"Arial","sans-serif";color:#6A737B;mso-fareast-language:IT">
</span></b><b><span lang="IT" style="font-size:18.5pt;font-family:"Arial","sans-serif";color:#FCB034;mso-fareast-language:IT">______</span></b><b><span lang="IT" style="font-size:18.5pt;font-family:"Arial","sans-serif";color:#6A737B;mso-fareast-language:IT"><o:p></o:p></span></b></p>
<p class="MsoNormal"><span lang="IT" style="color:#404040;mso-fareast-language:IT">Federico Miorelli</span><span lang="IT" style="mso-fareast-language:IT"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="IT" style="color:#1F497D;mso-fareast-language:IT"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="IT" style="color:#1F497D;mso-fareast-language:IT">Senior R&D Geophysicist<o:p></o:p></span></p>
<p class="MsoNormal"><b><span style="font-size:10.0pt;color:#1F497D;mso-fareast-language:EN-GB">Subsurface Imaging - General Geophysics
</span></b><b><span style="font-size:9.0pt;color:#1F497D;mso-fareast-language:EN-GB">Italy</span></b><span style="font-size:8.0pt;color:#404040;mso-fareast-language:EN-GB"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:8.0pt;color:#404040;mso-fareast-language:EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:8.0pt;color:#404040;mso-fareast-language:EN-GB">CGG Electromagnetics (Italy) Srl<o:p></o:p></span></p>
</div>
<p class="MsoNormal"><i><span lang="EN-GB" style="font-size:7.0pt;font-family:"Arial","sans-serif";
color:#6A737B;mso-ansi-language:EN-GB">This email and any accompanying attachments are confidential. If you received this email by mistake, please delete<br>
it from your system. Any review, disclosure, copying, distribution, or use of the email by others is strictly prohibited.<o:p></o:p></span></i></p>
</body>
</html>