<div dir="ltr"><div><div><div><div>This type of bizarre unexplainable behaviour usually indicates memory corruption.<br></div>For example: an illegal read of write from an array.<br></div>I suggest you run your code through valgrind to rule this out.<br><br></div>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<br><br>#undef __FUNCT__<br>#define __FUNCT__ "MyFunction"<br></div>PetscErrorCode MyFunction(void)<br>{<br> PetscFunctionReturn(0);<br>}<br><div><br></div><div>and call it like this<br><br></div><div>ierr = MyFunction();CHKERRQ(ierr);</div><div><br></div><div>The CHKERRQ() macro will tell you in which of your functions the segv occurs.<br></div><div>It is an additional useful debugging technique to complement using gdb and valgrind.<br></div><div>All the error checking macros (CHKERRQ) are compiled out when you configure petsc with --with-debugging=no so there is no performance loss from adding the petsc error checking into your code<br></div><div><br><br>Cheers<br></div><div> Dave<br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On 25 January 2015 at 09:25, siddhesh godbole <span dir="ltr"><<a href="mailto:siddhesh4godbole@gmail.com" target="_blank">siddhesh4godbole@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_default" style="font-family:georgia,serif">Hello;<br><br></div><div class="gmail_default" style="font-family:georgia,serif">i received the following error<br> [0]PETSC ERROR: ------------------------------------------------------------------------<br>[0]PETSC ERROR: <b>Caught signal number 11 SEGV: Segmentation Violation, probably memory access out of range</b><br>[0]PETSC ERROR: Try option -start_in_debugger or -on_error_attach_debugger<br>[0]PETSC ERROR: or see <a href="http://www.mcs.anl.gov/petsc/documentation/faq.html#valgrind[0]PETSC" target="_blank">http://www.mcs.anl.gov/petsc/documentation/faq.html#valgrind[0]PETSC</a> ERROR: or try <a href="http://valgrind.org" target="_blank">http://valgrind.org</a> on GNU/linux and Apple Mac OS X to find memory corruption errors<br>[0]PETSC ERROR: likely location of problem given in stack below<br>[0]PETSC ERROR: --------------------- Stack Frames ------------------------------------<br>[0]PETSC ERROR: Note: The EXACT line numbers in the stack are not available,<br>[0]PETSC ERROR: INSTEAD the line number of the start of the function<br>[0]PETSC ERROR: is given.<br>[0]PETSC ERROR: --------------------- Error Message --------------------------------------------------------------<br>[0]PETSC ERROR: Signal received<br>[0]PETSC ERROR: See <a href="http://www.mcs.anl.gov/petsc/documentation/faq.html" target="_blank">http://www.mcs.anl.gov/petsc/documentation/faq.html</a> for trouble shooting.<br>[0]PETSC ERROR: Petsc Release Version 3.5.2, Sep, 08, 2014 <br>[0]PETSC ERROR: ./10D on a arch-linux2-c-debug named iitm by iitm Sun Jan 25 13:50:10 2015<br>[0]PETSC ERROR: Configure options --download-mpich --download-f2cblaslapack=1<br>[0]PETSC ERROR: #1 User provided function() line 0 in unknown file<br>application called MPI_Abort(MPI_COMM_WORLD, 59) - process 0<br>[unset]: aborting job:<br>application called MPI_Abort(MPI_COMM_WORLD, 59) - process 0<br><br><br><br></div><div class="gmail_default" style="font-family:georgia,serif">i dont get it, and this happens just by declaring two extra arrays! when i delete them code runs just fine! where arrays are with 10 elements and all them are zero. <br></div><div class="gmail_default" style="font-family:georgia,serif"><br><br clear="all"></div><div><div><div dir="ltr"><b><font face="georgia, serif">Siddhesh M Godbole</font></b><div><br></div><div><font color="#666666">5th year Dual Degree,</font></div><div><font color="#666666">Civil Eng & Applied Mech.</font></div><div><font color="#666666">IIT Madras</font></div></div></div></div>
</div>
</blockquote></div><br></div>