<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, Jul 23, 2015 at 10:07 AM, Florian Lindner <span dir="ltr"><<a href="mailto:mailinglists@xgm.de" target="_blank">mailinglists@xgm.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
Am Mittwoch, 22. Juli 2015, 13:05:57 schrieben Sie:<br>
><br>
> > On Jul 22, 2015, at 11:33 AM, Florian Lindner <<a href="mailto:mailinglists@xgm.de">mailinglists@xgm.de</a>> wrote:<br>
> ><br>
> > Am Dienstag, 21. Juli 2015, 18:32:02 schrieben Sie:<br>
> >><br>
> >>  Try putting a breakpoint in KSPSetUp_GMRES and check the values of all the pointers immediately after the<br>
> >> ierr = PetscCalloc5(hh,&gmres->hh_origin,hes,&gmres->hes_origin,rs,&gmres->rs_origin,cc,&gmres->cc_origin,cc,&gmres->ss_origin);CHKERRQ(ierr);<br>
> >><br>
> >> then put your second break point in KSPReset_GMRES and check all the pointers agin just before the<br>
> >>> ierr = PetscFree5(gmres->hh_origin,gmres->hes_origin,gmres->rs_origin,gmres->cc_origin,gmres->ss_origin);CHKERRQ(ierr);<br>
> >><br>
> >> Of course the pointers should be the same, are they?<br>
> ><br>
> > Num     Type           Disp Enb Address            What<br>
> > 3       breakpoint     keep y   0x00007ffff6ff6cb5 in KSPReset_GMRES at /home/florian/software/petsc/src/ksp/ksp/impls/gmres/gmres.c:258<br>
> > 4       breakpoint     keep y   0x00007ffff6ff49a1 in KSPSetUp_GMRES at /home/florian/software/petsc/src/ksp/ksp/impls/gmres/gmres.c:54<br>
> ><br>
> > The pointer gmres is the same. Just one function call later, at mal.c:72 it crashes. The pointer that is freed is gmres->hh_origin which also hasn't changed.<br>
> ><br>
> > What confuses me is that:<br>
> ><br>
> > Breakpoint 3, KSPReset_GMRES (ksp=0xe904b0) at /home/florian/software/petsc/src/ksp/ksp/impls/gmres/gmres.c:258<br>
> > 258   ierr = PetscFree5(gmres->hh_origin,gmres->hes_origin,gmres->rs_origin,gmres->cc_origin,gmres->ss_origin);CHKERRQ(ierr);<br>
> > (gdb) print gmres->hh_origin<br>
> > $24 = (PetscScalar *) 0xf10250<br>
> ><br>
> > hh_origin is the first argument, I step into PetscFree5:<br>
> ><br>
> > (gdb) s<br>
> > PetscFreeAlign (ptr=0xf15aa0, line=258, func=0x7ffff753c4c8 <__func__.20306> "KSPReset_GMRES", file=0x7ffff753b8b0 "/home/florian/software/petsc/src/ksp/ksp/impls/gmres/gmres.c") at /home/florian/software/petsc/src/sys/memory/mal.c:54<br>
> > 54    if (!ptr) return 0;<br>
> > (gdb) print ptr<br>
> > $25 = (void *) 0xf15aa0<br>
> ><br>
> > Why have the value changed? I expect gmres->hh_origin == ptr.<br>
><br>
>    Definitely a problem here.<br>
><br>
> > Could this be a sign of stack corruption at same ealier stage?<br>
><br>
>    Could be, but valgrind usually finds such things.<br>
><br>
>    You can do the following: edit $PETSC_DIR/$PETSC_ARCH/include/petscconf.h and add the lines<br>
><br>
> #if !defined(PETSC_USE_MALLOC_COALESCED)<br>
> #define PETSC_USE_MALLOC_COALESCED<br>
> #endif<br>
><br>
> then run<br>
><br>
> make gnumake in the $PETSC_DIR directory.  Then relink your program and try running it.<br>
<br>
Sorry, no success. Same story. :-(<br>
<br>
I have removed my small petsc wrapper lib from the code and it's pure petsc now. Everything petsc related (beside Init and Finalize) is done in that piece of code. Everything petsc is private, so no outside should mess with it.<br>
<br>
<a href="https://github.com/floli/precice/blob/petsc_debugging/src/mapping/PetRadialBasisFctMapping.hpp" rel="noreferrer" target="_blank">https://github.com/floli/precice/blob/petsc_debugging/src/mapping/PetRadialBasisFctMapping.hpp</a><br>
<br>
if you wanna have a look... Maybe you see something evil I'm doing.<br></blockquote><div><br></div><div>I can't see anything by eye. Can you tell me how to run a small problem which shows the error? I will go</div><div>through it until we find out what is going on.</div><div><br></div><div>  Thanks,</div><div><br></div><div>    Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Best Thanks,<br>
Florian<br>
<br>
<br>
><br>
>   Barry<br>
><br>
><br>
><br>
><br>
> ><br>
> > I was also trying to build petsc with clang for using its memory-sanitizer, but without success. Same for precice.<br>
> ><br>
> ><br>
> >> If so you can run in the debugger and check the values at some points between the creation and destruction to see where they get changed to bad values. Normally, of course, valgrind would be very helpful in finding exactly when things go bad.<br>
> ><br>
> > What do you mean with changing to bad? They are the same after Calloc and before PetscFree5.<br>
> ><br>
> > Best Regards,<br>
> > Florian<br>
> ><br>
> >>  I'm afraid I'm going to have to give up on building this stuff myself; too painful.<br>
> ><br>
> > Sorry about that.<br>
> ><br>
> >><br>
> >>  Barry<br>
> >><br>
> >><br>
> >>> On Jul 21, 2015, at 8:54 AM, Florian Lindner <<a href="mailto:mailinglists@xgm.de">mailinglists@xgm.de</a>> wrote:<br>
> >>><br>
> >>> Hey Barry,<br>
> >>><br>
> >>> were you able to reproduce the error?<br>
> >>><br>
> >>> I tried to set a breakpoint at<br>
> >>><br>
> >>> PetscErrorCode KSPReset_GMRES(KSP ksp)<br>
> >>> {<br>
> >>> KSP_GMRES      *gmres = (KSP_GMRES*)ksp->data;<br>
> >>> PetscErrorCode ierr;<br>
> >>> PetscInt       i;<br>
> >>><br>
> >>> PetscFunctionBegin;<br>
> >>> /* Free the Hessenberg matrices */<br>
> >>> ierr = PetscFree5(gmres->hh_origin,gmres->hes_origin,gmres->rs_origin,gmres->cc_origin,gmres->ss_origin);CHKERRQ(ierr);<br>
> >>><br>
> >>> in gmres.c, the last line produces the error...<br>
> >>><br>
> >>> Interestingly this piece of code is traversed only once, so at least no double calling of the same code that frees the pointer...<br>
> >>><br>
> >>> Best Regards,<br>
> >>> Florian<br>
> >>><br>
> >>><br>
> >>> Am Donnerstag, 16. Juli 2015, 17:59:15 schrieben Sie:<br>
> >>>><br>
> >>>> I am on a mac, no idea what the 'lo' local host loop back should be<br>
> >>>><br>
> >>>> $  ./pmpi B<br>
> >>>> MPI rank 0 of 1<br>
> >>>> [PRECICE] Run in coupling mode<br>
> >>>> Mesh = [[1.19999999999999995559e-01, 0.00000000000000000000e+00], [3.20000000000000006661e-01, 0.00000000000000000000e+00], [5.20000000000000017764e-01, 0.00000000000000000000e+00], [7.20000000000000084377e-01, 0.00000000000000000000e+00], [9.20000000000000039968e-01, 0.00000000000000000000e+00]]<br>
> >>>> Setting up master communication to coupling partner/s<br>
> >>>> (0)  [PRECICE] ERROR: Network "lo" not found for socket connection!<br>
> >>>> Run finished at Thu Jul 16 17:50:39 2015<br>
> >>>> Global runtime = 41ms / 0s<br>
> >>>><br>
> >>>> Event                Count    Total[ms]     Max[ms]     Min[ms]     Avg[ms]   T%<br>
> >>>> --------------------------------------------------------------------------------<br>
> >>>> Properties from all Events, accumulated<br>
> >>>> ---------------------------------------<br>
> >>>><br>
> >>>> Abort trap: 6<br>
> >>>> ~/Src/prempi (master *=) arch-debug<br>
> >>>> $  ./pmpi B<br>
> >>>> MPI rank 0 of 1<br>
> >>>> [PRECICE] Run in coupling mode<br>
> >>>> Mesh = [[1.19999999999999995559e-01, 0.00000000000000000000e+00], [3.20000000000000006661e-01, 0.00000000000000000000e+00], [5.20000000000000017764e-01, 0.00000000000000000000e+00], [7.20000000000000084377e-01, 0.00000000000000000000e+00], [9.20000000000000039968e-01, 0.00000000000000000000e+00]]<br>
> >>>> Setting up master communication to coupling partner/s<br>
> >>>> (0)  [PRECICE] ERROR: Network "localhost" not found for socket connection!<br>
> >>>> Run finished at Thu Jul 16 17:50:52 2015<br>
> >>>> Global runtime = 40ms / 0s<br>
> >>>><br>
> >>>> Event                Count    Total[ms]     Max[ms]     Min[ms]     Avg[ms]   T%<br>
> >>>> --------------------------------------------------------------------------------<br>
> >>>> Properties from all Events, accumulated<br>
> >>>> ---------------------------------------<br>
> >>>><br>
> >>>> Abort trap: 6<br>
> >>>> ~/Src/prempi (master *=) arch-debug<br>
> >>>> $ hostname<br>
> >>>> Barrys-MacBook-Pro.local<br>
> >>>> ~/Src/prempi (master *=) arch-debug<br>
> >>>> $  ./pmpi B<br>
> >>>> MPI rank 0 of 1<br>
> >>>> [PRECICE] Run in coupling mode<br>
> >>>> Mesh = [[1.19999999999999995559e-01, 0.00000000000000000000e+00], [3.20000000000000006661e-01, 0.00000000000000000000e+00], [5.20000000000000017764e-01, 0.00000000000000000000e+00], [7.20000000000000084377e-01, 0.00000000000000000000e+00], [9.20000000000000039968e-01, 0.00000000000000000000e+00]]<br>
> >>>> Setting up master communication to coupling partner/s<br>
> >>>> (0)  [PRECICE] ERROR: Network "Barrys-MacBook-Pro.local" not found for socket connection!<br>
> >>>> Run finished at Thu Jul 16 17:51:12 2015<br>
> >>>> Global runtime = 39ms / 0s<br>
> >>>><br>
> >>>> Event                Count    Total[ms]     Max[ms]     Min[ms]     Avg[ms]   T%<br>
> >>>> --------------------------------------------------------------------------------<br>
> >>>> Properties from all Events, accumulated<br>
> >>>> ---------------------------------------<br>
> >>>><br>
> >>>> Abort trap: 6<br>
> >>>> ~/Src/prempi (master *=) arch-debug<br>
> >>>> $  ./pmpi B<br>
> >>>> MPI rank 0 of 1<br>
> >>>> [PRECICE] Run in coupling mode<br>
> >>>> Mesh = [[1.19999999999999995559e-01, 0.00000000000000000000e+00], [3.20000000000000006661e-01, 0.00000000000000000000e+00], [5.20000000000000017764e-01, 0.00000000000000000000e+00], [7.20000000000000084377e-01, 0.00000000000000000000e+00], [9.20000000000000039968e-01, 0.00000000000000000000e+00]]<br>
> >>>> Setting up master communication to coupling partner/s<br>
> >>>> (0)  [PRECICE] ERROR: Network "10.0.1.2" not found for socket connection!<br>
> >>>> Run finished at Thu Jul 16 17:53:02 2015<br>
> >>>> Global runtime = 42ms / 0s<br>
> >>>><br>
> >>>> Event                Count    Total[ms]     Max[ms]     Min[ms]     Avg[ms]   T%<br>
> >>>> --------------------------------------------------------------------------------<br>
> >>>> Properties from all Events, accumulated<br>
> >>>> ---------------------------------------<br>
> >>>><br>
> >>>> Abort trap: 6<br>
> >>>> ~/Src/prempi (master *=) arch-debug<br>
> >>>><br>
> >>>>> On Jul 15, 2015, at 1:53 AM, Florian Lindner <<a href="mailto:mailinglists@xgm.de">mailinglists@xgm.de</a>> wrote:<br>
> >>>>><br>
> >>>>> Hey<br>
> >>>>><br>
> >>>>> Am Dienstag, 14. Juli 2015, 13:20:33 schrieben Sie:<br>
> >>>>>><br>
> >>>>>> How to install Eigen? I tried brew install eigen but it didn't help.<br>
> >>>>><br>
> >>>>> You may need to set the CPLUS_INCLUDE_PATH to something like "/usr/include/eigen3"<br>
> >>>>> Easiest way however is probably to download eigen from <a href="http://bitbucket.org/eigen/eigen/get/3.2.5.tar.bz2" rel="noreferrer" target="_blank">http://bitbucket.org/eigen/eigen/get/3.2.5.tar.bz2</a> and move the Eigen folder from that archive to precice/src.<br>
> >>>>><br>
> >>>>>> Also what about the PRECICE_MPI_ stuff. It sure doesn't point to anything valid.<br>
> >>>>><br>
> >>>>> You probably don't need to set it if you use a mpic++ or mpicxx compiler wrapper that take care of that.<br>
> >>>>><br>
> >>>>> Thx,<br>
> >>>>> Florian<br>
> >>>>><br>
> >>>>>><br>
> >>>>>><br>
> >>>>>> Barry<br>
> >>>>>><br>
> >>>>>> $ MPI_CXX="clang++" scons -j 4 boost_inst=on python=off petsc=on mpi=on compiler=/Users/barrysmith/Src/petsc/arch-debug/bin/mpic++ build=debug<br>
> >>>>>> scons: Reading SConscript files ...<br>
> >>>>>><br>
> >>>>>> Build options ...<br>
> >>>>>> (default)  builddir                  = build      Directory holding build files. ( /path/to/builddir )<br>
> >>>>>> (default)  build                     = debug      Build type, either release or debug (release|debug)<br>
> >>>>>> (modified) compiler                  = /Users/barrysmith/Src/petsc/arch-debug/bin/mpic++   Compiler to use.<br>
> >>>>>> (modified) mpi                       = True       Enables MPI-based communication and running coupling tests. (yes|no)<br>
> >>>>>> (default)  sockets                   = True       Enables Socket-based communication. (yes|no)<br>
> >>>>>> (modified) boost_inst                = True       Enable if Boost is available compiled and installed. (yes|no)<br>
> >>>>>> (default)  spirit2                   = True       Used for parsing VRML file geometries and checkpointing. (yes|no)<br>
> >>>>>> (modified) petsc                     = True       Enable use of the Petsc linear algebra library. (yes|no)<br>
> >>>>>> (modified) python                    = False      Used for Python scripted solver actions. (yes|no)<br>
> >>>>>> (default)  gprof                     = False      Used in detailed performance analysis. (yes|no)<br>
> >>>>>> ... done<br>
> >>>>>><br>
> >>>>>> Environment variables used for this build ...<br>
> >>>>>> (have to be defined by the user to configure build)<br>
> >>>>>> (modified) PETSC_DIR                 = /Users/barrysmith/Src/PETSc<br>
> >>>>>> (modified) PETSC_ARCH                = arch-debug<br>
> >>>>>> (default)  PRECICE_BOOST_SYSTEM_LIB  = boost_system<br>
> >>>>>> (default)  PRECICE_BOOST_FILESYSTEM_LIB = boost_filesystem<br>
> >>>>>> (default)  PRECICE_MPI_LIB_PATH      = /usr/lib/<br>
> >>>>>> (default)  PRECICE_MPI_LIB           = mpich<br>
> >>>>>> (default)  PRECICE_MPI_INC_PATH      = /usr/include/mpich2<br>
> >>>>>> (default)  PRECICE_PTHREAD_LIB_PATH  = /usr/lib<br>
> >>>>>> (default)  PRECICE_PTHREAD_LIB       = pthread<br>
> >>>>>> (default)  PRECICE_PTHREAD_INC_PATH  = /usr/include<br>
> >>>>>> ... done<br>
> >>>>>><br>
> >>>>>> Configuring build variables ...<br>
> >>>>>> Checking whether the C++ compiler works... yes<br>
> >>>>>> Checking for C library petsc... yes<br>
> >>>>>> Checking for C++ header file Eigen/Dense... no<br>
> >>>>>> ERROR: Header 'Eigen/Dense' (needed for Eigen) not found or does not compile!<br>
> >>>>>> $ brew install eigen<br>
> >>>>>> ==> Downloading <a href="https://downloads.sf.net/project/machomebrew/Bottles/eigen-3.2.3.yosemite.bottle.tar.gz" rel="noreferrer" target="_blank">https://downloads.sf.net/project/machomebrew/Bottles/eigen-3.2.3.yosemite.bottle.tar.gz</a><br>
> >>>>>> ######################################################################## 100.0%<br>
> >>>>>> ==> Pouring eigen-3.2.3.yosemite.bottle.tar.gz<br>
> >>>>>> 🍺  /usr/local/Cellar/eigen/3.2.3: 361 files, 4.1M<br>
> >>>>>> ~/Src/precice (develop=) arch-debug<br>
> >>>>>> $ MPI_CXX="clang++" scons -j 4 boost_inst=on python=off petsc=on mpi=on compiler=/Users/barrysmith/Src/petsc/arch-debug/bin/mpic++ build=debug<br>
> >>>>>> scons: Reading SConscript files ...<br>
> >>>>>><br>
> >>>>>> Build options ...<br>
> >>>>>> (default)  builddir                  = build      Directory holding build files. ( /path/to/builddir )<br>
> >>>>>> (default)  build                     = debug      Build type, either release or debug (release|debug)<br>
> >>>>>> (modified) compiler                  = /Users/barrysmith/Src/petsc/arch-debug/bin/mpic++   Compiler to use.<br>
> >>>>>> (modified) mpi                       = True       Enables MPI-based communication and running coupling tests. (yes|no)<br>
> >>>>>> (default)  sockets                   = True       Enables Socket-based communication. (yes|no)<br>
> >>>>>> (modified) boost_inst                = True       Enable if Boost is available compiled and installed. (yes|no)<br>
> >>>>>> (default)  spirit2                   = True       Used for parsing VRML file geometries and checkpointing. (yes|no)<br>
> >>>>>> (modified) petsc                     = True       Enable use of the Petsc linear algebra library. (yes|no)<br>
> >>>>>> (modified) python                    = False      Used for Python scripted solver actions. (yes|no)<br>
> >>>>>> (default)  gprof                     = False      Used in detailed performance analysis. (yes|no)<br>
> >>>>>> ... done<br>
> >>>>>><br>
> >>>>>> Environment variables used for this build ...<br>
> >>>>>> (have to be defined by the user to configure build)<br>
> >>>>>> (modified) PETSC_DIR                 = /Users/barrysmith/Src/PETSc<br>
> >>>>>> (modified) PETSC_ARCH                = arch-debug<br>
> >>>>>> (default)  PRECICE_BOOST_SYSTEM_LIB  = boost_system<br>
> >>>>>> (default)  PRECICE_BOOST_FILESYSTEM_LIB = boost_filesystem<br>
> >>>>>> (default)  PRECICE_MPI_LIB_PATH      = /usr/lib/<br>
> >>>>>> (default)  PRECICE_MPI_LIB           = mpich<br>
> >>>>>> (default)  PRECICE_MPI_INC_PATH      = /usr/include/mpich2<br>
> >>>>>> (default)  PRECICE_PTHREAD_LIB_PATH  = /usr/lib<br>
> >>>>>> (default)  PRECICE_PTHREAD_LIB       = pthread<br>
> >>>>>> (default)  PRECICE_PTHREAD_INC_PATH  = /usr/include<br>
> >>>>>> ... done<br>
> >>>>>><br>
> >>>>>> Configuring build variables ...<br>
> >>>>>> Checking whether the C++ compiler works... yes<br>
> >>>>>> Checking for C library petsc... yes<br>
> >>>>>> Checking for C++ header file Eigen/Dense... no<br>
> >>>>>> ERROR: Header 'Eigen/Dense' (needed for Eigen) not found or does not compile!<br>
> >>>>>> ~/Src/precice (develop=) arch-debug<br>
> >>>>>><br>
> >>>>>><br>
> >>>>>>> On Jul 14, 2015, at 2:14 AM, Florian Lindner <<a href="mailto:mailinglists@xgm.de">mailinglists@xgm.de</a>> wrote:<br>
> >>>>>>><br>
> >>>>>>> Hello,<br>
> >>>>>>><br>
> >>>>>>> Am Montag, 13. Juli 2015, 12:26:21 schrieb Barry Smith:<br>
> >>>>>>>><br>
> >>>>>>>> Run under valgrind first, see if it gives any more details about the memory issue <a href="http://www.mcs.anl.gov/petsc/documentation/faq.html#valgrind" rel="noreferrer" target="_blank">http://www.mcs.anl.gov/petsc/documentation/faq.html#valgrind</a><br>
> >>>>>>><br>
> >>>>>>> I tried running it like that:<br>
> >>>>>>><br>
> >>>>>>> valgrind --tool=memcheck ./pmpi A -malloc off<br>
> >>>>>>><br>
> >>>>>>> (pmpi is my application, no mpirun)<br>
> >>>>>>><br>
> >>>>>>> but it reported no errors at all.<br>
> >>>>>>><br>
> >>>>>>>> Can you send the code that produces this problem?<br>
> >>>>>>><br>
> >>>>>>> I was not able to isolate that problem, you can of course have a look at our application:<br>
> >>>>>>><br>
> >>>>>>> git clone git@github.com:precice/precice.git<br>
> >>>>>>> MPI_CXX="clang++" scons -j 4 boost_inst=on python=off petsc=on mpi=on compiler=mpic++ build=debug<br>
> >>>>>>><br>
> >>>>>>> The test client:<br>
> >>>>>>> git clone git@github.com:floli/prempi.git<br>
> >>>>>>> you need to adapt line 5 in SConstruct: preciceRoot<br>
> >>>>>>> scons<br>
> >>>>>>><br>
> >>>>>>> Take one terminal run ./pmpi A, another to run ./pmpi B<br>
> >>>>>>><br>
> >>>>>>> Thanks for taking a look! Mail me if any problem with the build occurs.<br>
> >>>>>>><br>
> >>>>>>> Florian<br>
> >>>>>>><br>
> >>>>>>>><br>
> >>>>>>>>> On Jul 13, 2015, at 10:56 AM, Florian Lindner <<a href="mailto:mailinglists@xgm.de">mailinglists@xgm.de</a>> wrote:<br>
> >>>>>>>>><br>
> >>>>>>>>> Hello,<br>
> >>>>>>>>><br>
> >>>>>>>>> our petsc application suffers from a memory error (double free or corruption).<br>
> >>>>>>>>><br>
> >>>>>>>>> Situation is a like that:<br>
> >>>>>>>>><br>
> >>>>>>>>> A KSP is private member of a C++ class. In its constructor I call KSPCreate. Inbetween it may haben that I call KSPREset. In the class' destructor I call KSPDestroy. That's where the memory error appears:<br>
> >>>>>>>>><br>
> >>>>>>>>> gdb backtrace:<br>
> >>>>>>>>><br>
> >>>>>>>>><br>
> >>>>>>>>> #4  0x00007ffff490b8db in _int_free () from /usr/lib/libc.so.6<br>
> >>>>>>>>> #5  0x00007ffff6188c9c in PetscFreeAlign (ptr=0xfcd990, line=258, func=0x7ffff753c4c8 <__func__.20304> "KSPReset_GMRES", file=0x7ffff753b8b0 "/home/florian/software/petsc/src/ksp/ksp/impls/gmres/gmres.c")<br>
> >>>>>>>>> at /home/florian/software/petsc/src/sys/memory/mal.c:72<br>
> >>>>>>>>> #6  0x00007ffff6ff6cdc in KSPReset_GMRES (ksp=0xf48470) at /home/florian/software/petsc/src/ksp/ksp/impls/gmres/gmres.c:258<br>
> >>>>>>>>> #7  0x00007ffff70ad804 in KSPReset (ksp=0xf48470) at /home/florian/software/petsc/src/ksp/ksp/interface/itfunc.c:885<br>
> >>>>>>>>> #8  0x00007ffff70ae2e8 in KSPDestroy (ksp=0xeb89d8) at /home/florian/software/petsc/src/ksp/ksp/interface/itfunc.c:933<br>
> >>>>>>>>><br>
> >>>>>>>>> #9  0x0000000000599b24 in precice::mapping::PetRadialBasisFctMapping<precice::mapping::Gaussian>::~PetRadialBasisFctMapping (this=0xeb8960) at src/mapping/PetRadialBasisFctMapping.hpp:148<br>
> >>>>>>>>> #10 0x0000000000599bc9 in precice::mapping::PetRadialBasisFctMapping<precice::mapping::Gaussian>::~PetRadialBasisFctMapping (this=0xeb8960) at src/mapping/PetRadialBasisFctMapping.hpp:146<br>
> >>>>>>>>><br>
> >>>>>>>>> Complete backtrace at <a href="http://pastebin.com/ASjibeNF" rel="noreferrer" target="_blank">http://pastebin.com/ASjibeNF</a><br>
> >>>>>>>>><br>
> >>>>>>>>><br>
> >>>>>>>>> Could it be a problem it objects set by KSPSetOperators are destroyed afterwards? I don't think so, since KSPReset is called before.<br>
> >>>>>>>>><br>
> >>>>>>>>> I've wrapped a class (just a bunch of helper function, no encapsulating wrapper) round Mat and Vec objects. Nothing fancy, the ctor calls MatCreate, the dtor MatDestroy, you can have a look at <a href="https://github.com/precice/precice/blob/develop/src/mapping/petnum.cpp" rel="noreferrer" target="_blank">https://github.com/precice/precice/blob/develop/src/mapping/petnum.cpp</a> / .hpp.<br>
> >>>>>>>>><br>
> >>>>>>>>> These objects are also members of the same class like KSP, so their dtor is called after KSPDestroy.<br>
> >>>>>>>>><br>
> >>>>>>>>> What could cause the memory corruption here?<br>
> >>>>>>>>><br>
> >>>>>>>>> Thanks a lot,<br>
> >>>>>>>>> Florian<br>
><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>-- Norbert Wiener</div>
</div></div>