[mpich-devel] lockcontention3.c bug

Balaji, Pavan balaji at anl.gov
Sun Oct 5 23:01:25 CDT 2014


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



More information about the devel mailing list