[petsc-dev] problem with DMGetInterpolation_DA_2D_Q1() for whoever was monkeying with it

Barry Smith bsmith at mcs.anl.gov
Sun May 15 13:03:37 CDT 2011


  Some people did an overhaul of DMGetInterpolation_DA_2D_Q1() a while ago either to handle new types of boundary conditions or to handle complicated mappings properly.  The also may have worked on the very nice src/dm/examples/tests/ex36.c test code

   There is now an error: 

/Users/barrysmith/Src/petsc-dev/arch-gnu/bin/mpiexec -n 1 /opt/local/bin/valgrind -q --tool=memcheck --dsymutil=yes --num-callers=20 ./ex36 -mx 10 -my 10 -nl 4 -dim 2 -cmap 3 -da_refine_x 3 -da_refine_y 4
--22301-- run: /usr/bin/dsymutil ./ex36
warning: (x86_64) /Users/barrysmith/Src/petsc-dev/src/dm/examples/tests/ex36.o unable to open object file
==22301== Invalid read of size 4
==22301==    at 0x10074D1F2: DMGetInterpolation_DA_2D_Q1 (dainterp.c:347)
==22301==    by 0x1007571A5: DMGetInterpolation_DA (dainterp.c:1050)
==22301==    by 0x1007D8ECF: DMGetInterpolation (dm.c:438)
==22301==    by 0x100006D3D: da_test_RefineCoords2D (in ./ex36)
==22301==    by 0x10000956B: main (in ./ex36)
==22301==  Address 0x103a6acc8 is 0 bytes after a block of size 1,000 alloc'd
==22301==    at 0x1015BAD65: malloc (vg_replace_malloc.c:236)
==22301==    by 0x10009B5D5: PetscMallocAlign (mal.c:37)
==22301==    by 0x1007142FC: DMSetUp_DA_2D (da2.c:1726)
==22301==    by 0x10076A15E: DMSetUp_DA (dareg.c:20)
==22301==    by 0x1007D71F1: DMSetUp (dm.c:188)
==22301==    by 0x1007155DC: DMDACreate2d (da2.c:1830)
==22301==    by 0x1007288C9: DMDAGetCoordinateDA (dacorn.c:171)
==22301==    by 0x10074042E: DMDASetUniformCoordinates (gr1.c:43)
==22301==    by 0x100006976: da_test_RefineCoords2D (in ./ex36)
==22301==    by 0x10000956B: main (in ./ex36)
==22301== 


  Could the people who who changed this please take a look at it. It is reading slightly past the end of an array. I cannot determine if the array is not allocated large enough (and filled large enough) or if the access beyond the end is wrong.

   Thanks

    Barry




More information about the petsc-dev mailing list