This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "MPICH primary repository". The branch, master has been updated via fe2991e0ce3fb0f789b745161e6f9a571aceabe7 (commit) from 05f42d10602b88f37993a24bdf31dc4d2a7bb08d (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://git.mpich.org/mpich.git/commitdiff/fe2991e0ce3fb0f789b745161e6f9a571a... commit fe2991e0ce3fb0f789b745161e6f9a571aceabe7 Author: Yanfei Guo <[email protected]> Date: Fri Sep 18 13:10:18 2015 -0500 Fix bug in attr double freeing tests and reenable the tests Added the additional type/win to make sure that the keyval is not deallocated before test is finished. Signed-off-by: Pavan Balaji <[email protected]> diff --git a/test/mpi/attr/keyval_double_free_type.c b/test/mpi/attr/keyval_double_free_type.c index 10ffc2a..406d7e8 100644 --- a/test/mpi/attr/keyval_double_free_type.c +++ b/test/mpi/attr/keyval_double_free_type.c @@ -21,20 +21,24 @@ int delete_fn(MPI_Comm comm, int keyval, void *attr, void *extra) int main(int argc, char **argv) { MPI_Datatype type; + MPI_Datatype type_dup; int keyval = MPI_KEYVAL_INVALID; int keyval_copy = MPI_KEYVAL_INVALID; int errs = 0; MTest_Init(&argc, &argv); MPI_Type_dup(MPI_INT, &type); + MPI_Type_dup(MPI_INT, &type_dup); MPI_Type_create_keyval(MPI_NULL_COPY_FN, delete_fn, &keyval, NULL); keyval_copy = keyval; MPI_Type_set_attr(type, keyval, NULL); + MPI_Type_set_attr(type_dup, keyval, NULL); MPI_Type_free(&type); /* first MPI_Type_free_keyval */ MPI_Type_free_keyval(&keyval); /* second MPI_Type_free_keyval */ MPI_Type_free_keyval(&keyval_copy); /* third MPI_Type_free_keyval */ + MPI_Type_free(&type_dup); /* fourth MPI_Type_free_keyval */ MTest_Finalize(errs); MPI_Finalize(); return 0; diff --git a/test/mpi/attr/keyval_double_free_win.c b/test/mpi/attr/keyval_double_free_win.c index 24d4b38..a954da6 100644 --- a/test/mpi/attr/keyval_double_free_win.c +++ b/test/mpi/attr/keyval_double_free_win.c @@ -9,6 +9,9 @@ #include <stdio.h> #include "mpitest.h" +#define NUM_WIN 2 +#define DATA_SZ sizeof(int) + /* tests multiple invocations of MPI_Win_free_keyval on the same keyval */ int delete_fn(MPI_Comm comm, int keyval, void *attr, void *extra); @@ -20,24 +23,30 @@ int delete_fn(MPI_Comm comm, int keyval, void *attr, void *extra) int main(int argc, char **argv) { - void *base_ptr = NULL; - MPI_Win window; + void *base_ptr[NUM_WIN]; + MPI_Win windows[NUM_WIN]; int keyval = MPI_KEYVAL_INVALID; int keyval_copy = MPI_KEYVAL_INVALID; int errs = 0; MTest_Init(&argc, &argv); - MPI_Alloc_mem(sizeof(int), MPI_INFO_NULL, &base_ptr); - MPI_Win_create(base_ptr, sizeof(int), 1, MPI_INFO_NULL, MPI_COMM_WORLD, &window); + MPI_Alloc_mem(DATA_SZ, MPI_INFO_NULL, &base_ptr[0]); + MPI_Win_create(base_ptr[0], DATA_SZ, 1, MPI_INFO_NULL, MPI_COMM_WORLD, &windows[0]); + MPI_Alloc_mem(DATA_SZ, MPI_INFO_NULL, &base_ptr[1]); + MPI_Win_create(base_ptr[1], DATA_SZ, 1, MPI_INFO_NULL, MPI_COMM_WORLD, &windows[1]); MPI_Win_create_keyval(MPI_NULL_COPY_FN, delete_fn, &keyval, NULL); keyval_copy = keyval; - MPI_Win_set_attr(window, keyval, NULL); - MPI_Win_free(&window); /* first MPI_Win_free_keyval */ - MPI_Free_mem(base_ptr); + MPI_Win_set_attr(windows[0], keyval, NULL); + MPI_Win_set_attr(windows[1], keyval, NULL); + + MPI_Win_free(&windows[0]); /* first MPI_Win_free_keyval */ + MPI_Free_mem(base_ptr[0]); MPI_Win_free_keyval(&keyval); /* second MPI_Win_free_keyval */ MPI_Win_free_keyval(&keyval_copy); /* third MPI_Win_free_keyval */ + MPI_Win_free(&windows[1]); /* fourth MPI_Win_free_keyval */ + MPI_Free_mem(base_ptr[1]); MTest_Finalize(errs); MPI_Finalize(); return 0; diff --git a/test/mpi/attr/testlist b/test/mpi/attr/testlist index 9f2d8a1..07868d1 100644 --- a/test/mpi/attr/testlist +++ b/test/mpi/attr/testlist @@ -18,6 +18,6 @@ fkeyval 1 fkeyvalcomm 1 fkeyvaltype 1 keyval_double_free 1 -#keyval_double_free_comm -#keyval_double_free_type -#keyval_double_free_win +keyval_double_free_comm 1 +keyval_double_free_type 1 +keyval_double_free_win 1 ----------------------------------------------------------------------- Summary of changes: test/mpi/attr/keyval_double_free_type.c | 4 ++++ test/mpi/attr/keyval_double_free_win.c | 23 ++++++++++++++++------- test/mpi/attr/testlist | 6 +++--- 3 files changed, 23 insertions(+), 10 deletions(-) hooks/post-receive -- MPICH primary repository