Blaise, thanks for the test code. pushed a fix now.
Satish On Wed, 14 Mar 2012, Blaise Bourdin wrote: > Hi, > > There seems to be a bug in ISRestoreIndicesF90 when the locally owned portion > of the index set is empty. I am attaching a small example illustrating the > issue. > > mpiexec -n 2 ./ISBugf90 -start_in_debugger > [0]PETSC ERROR: PETSC: Attaching gdb to ./ISBugf90 of pid 34744 on display > /tmp/launch-kaUROB/org.x:0 on machine galerkin.math.lsu.edu > [1]PETSC ERROR: PETSC: Attaching gdb to ./ISBugf90 of pid 34745 on display > /tmp/launch-kaUROB/org.x:0 on machine galerkin.math.lsu.edu > [0] Index set is permutation > [0] Number of indices in (stride) set 0 > [1] Index set is permutation > [1] Number of indices in (stride) set 2 > [1] 0 0 > [1] 1 1 > 1 0 1 > 0 > [0]PETSC ERROR: PetscTrFreeDefault() called from ISRestoreIndices_Stride() > line 174 in /opt/HPC/petsc-dev/src/vec/is/impls/stride/stride.c > [0]PETSC ERROR: Block at address 0x105647200 is corrupted; cannot free; > may be block not allocated with PetscMalloc() > [0]PETSC ERROR: PetscTrFreeDefault() line 287 in > /opt/HPC/petsc-dev/src/sys/memory/mtr.c Bad location or corrupted memory > > The stack trace is > (gdb) where > #0 0x00007fff8e8c282a in __kill () > #1 0x00007fff8ecf0a9c in abort () > #2 0x00000001039bd19c in PetscAbortErrorHandler (comm=1140850689, line=287, > fun=0x105491428 "PetscTrFreeDefault", file=0x105490a20 > "/opt/HPC/petsc-dev/src/sys/memory/mtr.c", dir=0x104ff6808 "", n=78, > p=PETSC_ERROR_INITIAL, mess=0x7fff6345e500 "Bad location or corrupted > memory", ctx=0x0) at /opt/HPC/petsc-dev/src/sys/error/errabort.c:62 > #3 0x00000001039b4c72 in PetscError (comm=1140850689, line=287, > func=0x105491428 "PetscTrFreeDefault", file=0x105490a20 > "/opt/HPC/petsc-dev/src/sys/memory/mtr.c", dir=0x104ff6808 "", n=78, > p=PETSC_ERROR_INITIAL, mess=0x105490d2c "Bad location or corrupted memory") > at /opt/HPC/petsc-dev/src/sys/error/err.c:356 > #4 0x000000010394c29b in PetscTrFreeDefault (aa=0x105647950, line=174, > function=0x1054ad654 "ISRestoreIndices_Stride", file=0x1054ad0a0 > "/opt/HPC/petsc-dev/src/vec/is/impls/stride/stride.c", dir=0x104ff6808 "") at > /opt/HPC/petsc-dev/src/sys/memory/mtr.c:287 > #5 0x0000000103ab8c24 in ISRestoreIndices_Stride (in=0x7ff65901df70, > idx=0x7fff6345f2a0) at /opt/HPC/petsc-dev/src/vec/is/impls/stride/stride.c:174 > #6 0x0000000103ad3d89 in ISRestoreIndices (is=0x7ff65901df70, > ptr=0x7fff6345f2a0) at /opt/HPC/petsc-dev/src/vec/is/interface/index.c:417 > #7 0x0000000103c425c6 in isrestoreindicesf90_ (x=0x103863110, > ptr=0x103863118, __ierr=0x7fff6345f360) at > /opt/HPC/petsc-dev/src/vec/is/interface/f90-custom/zindexf90.c:29 > #8 0x0000000103862d83 in isbug () at ISBugf90.F90:18 > #9 0x0000000103862a3c in main () > > > > This can be avoided by always checking the size of the array to be restored > before restoring it (uncomment l 18 and 20), but this is a bit annoying. Is > this easily fixable in petsc? The C version does not have this issue. >
