User provided function() line 0 in unknown directory unknown file

Hello,
My code uses PETSC and MPI libraries (linked via third party computational library). It crashes with the error below (I ran it with valgrind to get more information about the issue).
What could be a cause of the issue?
I use recursion in my code. could it be the reason?
how to find exact place in my code where the code crashes?
Thanks a lot!

===============================================

==135227== Stack overflow in thread 1: can't grow stack to 0x7fe601fe8
==135227== Can't extend stack to 0x7fe601098 during signal delivery for thread 1:
==135227== no stack segment
==135227==
==135227== Process terminating with default action of signal 11 (SIGSEGV)
==135227== Access not within mapped region at address 0x7FE601098
==135227== at 0x470E91: dealii::AlignedVector<double>::reserve(unsigned long) (mm_malloc.h:45)
==135227== If you believe this happened as a result of a stack
==135227== overflow in your program's main thread (unlikely but
==135227== possible), you can try to increase the size of the
==135227== main thread stack using the --main-stacksize= flag.
==135227== The main thread stack size used in this run was 10485760.
==135227==
==135227== HEAP SUMMARY:
==135227== in use at exit: 13,372,393 bytes in 31,180 blocks
==135227== total heap usage: 24,854,996 allocs, 24,823,816 frees, 17,009,498,017 bytes allocated
==135227==
==135227== LEAK SUMMARY:
==135227== definitely lost: 5,194 bytes in 272 blocks
==135227== indirectly lost: 4,800 bytes in 2 blocks
==135227== possibly lost: 2,239,032 bytes in 7,418 blocks
==135227== still reachable: 11,123,367 bytes in 23,488 blocks
==135227== suppressed: 0 bytes in 0 blocks
==135227== Rerun with --leak-check=full to see details of leaked memory
==135227==
==135227== For counts of detected and suppressed errors, rerun with: -v
==135227== Use --track-origins=yes to see where uninitialised values come from
==135227== ERROR SUMMARY: 524652 errors from 102 contexts (suppressed: 14 from 9)
--------------------------------------------------------------------------
MPI_ABORT was invoked on rank 24 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.
--------------------------------------------------------------------------
[31]PETSC ERROR: ------------------------------------------------------------------------
[31]PETSC ERROR: Caught signal number 15 Terminate: Some process (or the batch system) has told this process to end
[31]PETSC ERROR: Try option -start_in_debugger or -on_error_attach_debugger
[31]PETSC ERROR: or see http://www.mcs.anl.gov/petsc/documentation/faq.html#valgrind[31]PETSC ERROR: or try http://valgrind.org on GNU/linux and Apple Mac OS X to find memory corruption errors
[31]PETSC ERROR: configure using --with-debugging=yes, recompile, link, and run
[31]PETSC ERROR: to get more information on the crash.
[31]PETSC ERROR: --------------------- Error Message ------------------------------------
[31]PETSC ERROR: Signal received!
[31]PETSC ERROR: ------------------------------------------------------------------------
[31]PETSC ERROR: Petsc Release Version 3.4.4, Mar, 13, 2014
[31]PETSC ERROR: See docs/changes/index.html for recent updates.
[31]PETSC ERROR: See docs/faq.html for hints about trouble shooting.
[31]PETSC ERROR: See docs/index.html for manual pages.
[31]PETSC ERROR: ------------------------------------------------------------------------
[31]PETSC ERROR: ./main on a opt named node1127 Tue Oct 27 15:19:53 2015
[31]PETSC ERROR: Libraries linked from /home/lib/petsc-3.4.4/opt/lib
[31]PETSC ERROR: Configure run at Wed Jun 25 11:53:35 2014
[31]PETSC ERROR: Configure options --download-scalapack=1 --download-mumps=1 --download-f-blas-lapack=1 --with-shared-libraries=1 --with-clanguage=C++ --download-hypre=1 --with-x=0 --with-debugging=0 COPTFLAGS="-O3 -qarch=native -mtune=native" --download-parmetis --download-metis
[31]PETSC ERROR: ------------------------------------------------------------------------
[31]PETSC ERROR: User provided function() line 0 in unknown directory unknown file
I use recursion in my code. could it be the reason?
Yes, an infinite recursion would cause a stack overflow.

how to find exact place in my code where the code crashes?
Check the end condition of the recursion, whether it will ever met.
Topic archived. No new replies allowed.