[mpich-devel] lockcontention3.c bug

Archer, Charles J charles.j.archer at intel.com
Tue Oct 7 10:50:10 CDT 2014


Thanks, I’ll check it out.


On Oct 6, 2014, at 12:48 PM, Balaji, Pavan <balaji at anl.gov> wrote:

> Hi Charles,
> 
> The patch is now in mpich/master and should show up in mpich-3.1.3.
> 
> http://git.mpich.org/mpich.git/commitdiff/97ef2eeb57ef3dbad0d33da9b5e33d1735805505
> 
> Thanks,
> 
>  — Pavan
> 
> On Oct 5, 2014, at 11:01 PM, Balaji, Pavan <balaji at anl.gov> wrote:
> 
>> 
>> Thanks for the bug report and the patch, Charles.  Sorry no one from the team picked this thread up until now.
>> 
>> The patch seems correct.  I’ve pushed it to our review branch for testing.  I’ll push it to mpich/master once the review completes.
>> 
>> Thanks,
>> 
>> — Pavan
>> 
>> On Sep 24, 2014, at 4:36 PM, Archer, Charles J <charles.j.archer at intel.com> wrote:
>> 
>>> I think I found a bug in lockcontention3.c:
>>> 
>>> Line 126, MPI_Win_create creates a window of size RMA_SIZE (2048 bytes).
>>> 
>>> Then, in case 9 of RMATest (line 249):
>>> MPI_Put( source, longcount, MPI_INT, master,
>>>               OFFSET_1, longcount, MPI_INT, win );
>>> 
>>> longcount is 512
>>> OFFSET_1 is 7
>>> 
>>> longcount * sizeof(int) + OFFSET_1 is > 2048, and we have a buffer overrun.
>>> 
>>> I think on some platforms this test case will still work since the memory we are talking about is less than a page.
>>> I didn’t check the other tests for the same problem yet.
>>> 
>>> Here’s a fix:
>>> 
>>> diff --git a/test/mpi/rma/lockcontention3.c b/test/mpi/rma/lockcontention3.c
>>> index d70e26c..f42ff62 100644
>>> --- a/test/mpi/rma/lockcontention3.c
>>> +++ b/test/mpi/rma/lockcontention3.c
>>> @@ -123,7 +123,7 @@ int main( int argc, char *argv[] )
>>>   srcbuf = malloc(RMA_SIZE*sizeof(*srcbuf));
>>>   assert(srcbuf);
>>> 
>>> -    MPI_Win_create( rmabuffer, bufsize, sizeof(int), MPI_INFO_NULL,
>>> +    MPI_Win_create( rmabuffer, bufsize*sizeof(int), sizeof(int), MPI_INFO_NULL,
>>>                  MPI_COMM_WORLD, &win );
>>> 
>>>   /* Run a sequence of tests */
>>> 
>>> 
>>> _______________________________________________
>>> To manage subscription options or unsubscribe:
>>> https://lists.mpich.org/mailman/listinfo/devel
>> 
>> --
>> Pavan Balaji  ✉️
>> http://www.mcs.anl.gov/~balaji
>> 
>> _______________________________________________
>> To manage subscription options or unsubscribe:
>> https://lists.mpich.org/mailman/listinfo/devel
> 
> --
> Pavan Balaji  ✉️
> http://www.mcs.anl.gov/~balaji
> 
> _______________________________________________
> To manage subscription options or unsubscribe:
> https://lists.mpich.org/mailman/listinfo/devel



More information about the devel mailing list