<meta http-equiv="Content-Type" content="text/html; charset=utf-8"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div> Hi Min,</div><div><br></div><div>Although it may have been fixed in later version (as I am currently using test suite from mpich 3.1), the window creation (l.125) is stated as follow : </div><div>MPI_Win_create( rmabuffer, bufsize, sizeof(int), MPI_INFO_NULL, MPI_COMM_WORLD, &win );<br></div><div>with bufsize being equal to RMA_SIZE (2048) on master's side, and 0 on partner side. However, the bufsize argument is the size of the window in bytes, not in "displacement_unit" (here being sizeof(int) ). so the range is int[157: 157+512], but the window is defined with a range int[0: RMA_SIZE / sizeof(int)], creating an overflow.</div><div><br></div><div>Clément FOYER</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Message: 1<br>
Date: Tue, 12 Jul 2016 09:46:59 -0500<br>
From: Min Si <<a href="mailto:msi@anl.gov">msi@anl.gov</a>><br>
To: <<a href="mailto:discuss@mpich.org">discuss@mpich.org</a>><br>
Subject: Re: [mpich-discuss] Bug reporting for some mpi/rma tests<br>
Message-ID: <<a href="mailto:fb8a89ae-ca43-317f-74c4-6ec2c49b8c4e@anl.gov">fb8a89ae-ca43-317f-74c4-6ec2c49b8c4e@anl.gov</a>><br>
Content-Type: text/plain; charset="windows-1252"; Format="flowed"<br>
<br>
Hi C. FOYER,<br>
<br>
Thanks for reporting bugs to us.<br>
<br>
However, the places in test rma/lockcontention3.c are correct.<br>
The buffers' size is RMA_SIZE (2048) count of int. In case 9, 10, 11 the<br>
operations' size is longcount(512) count of int, and the largest target<br>
displacement is OFFSET_3(157), which means the window buffer is accessed<br>
in range int[157: 157+512]. Thus no overflows.<br>
<br>
In rma/manyrma3.c, as you reported, we missed verification and winbuf<br>
initialization. We will fix it.<br>
<br>
Min<br>
<br>
On 7/12/16 3:08 AM, Cl?ment Foyer wrote:<br>
> Hi everyone,<br>
><br>
> I think I may have found some bugs in mpich tests for RMA operations.<br>
><br>
> First, in rma/lockcontention3.c.<br>
> When calling RMA operations, the different offsets are not taken in<br>
> account on the origin_count and target_count parameters. As the<br>
> buffers are the same sizes, when the count arguments are equal to<br>
> "longcount" (such as in the tests cases 9, 10 and 11), it either<br>
> overflows when the operation is actually done, or, as it should<br>
> preferably be done, it fails with the returns of the MPI_ERR_RMA_RANGE<br>
> error code.<br>
> Also, on the check function, there are some array overflows, as the<br>
> loops go from 0 to longcount-1, and the array is accessed with the<br>
> OFFSET (buf[OFFSET_1+j]).<br>
> The easiest solution would be to set bufsize (l.111) and getbufsize<br>
> (l.118) to RMA_SIZE+OFFSET_3 (OFFSET_3 being the bigger one), and<br>
> maybe allocate change l.123 to srcbuf = malloc((RMA_SIZE +<br>
> OFFSET_3)*sizeof(*srcbuf));<br>
> Also, the window is defined with the bufsize as size, which should<br>
> mean that the window is bufsize bytes long. But as it is an array of<br>
> int's, it would rather be bufsize*sizeof(int) long. There might be a<br>
> problem there as well, given the fact that the displacement unit given<br>
> is actually "sizeof(int)".<br>
><br>
> rma/manyrma3.c<br>
> No verification is done. Just accumulate, and then we assume the<br>
> result is correct. Also, winbuf is not initialized.<br>
><br>
> Sincerely yours,<br>
><br>
> C. FOYER<br></blockquote></div></div></div>