-
Notifications
You must be signed in to change notification settings - Fork 877
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Valgrind: use of uninitialized value #13047
Comments
@abkein can you please try the following patch: diff --git a/opal/class/opal_interval_tree.c b/opal/class/opal_interval_tree.c
index 110dccdacc..0df81cf089 100644
--- a/opal/class/opal_interval_tree.c
+++ b/opal/class/opal_interval_tree.c
@@ -81,6 +81,7 @@ static void opal_interval_tree_construct (opal_interval_tree_t *tree)
tree->tree_size = 0;
tree->lock = 0;
tree->reader_count = 0;
+ tree->reader_id = 0;
tree->epoch = 0;
/* set all reader epochs to UINT_MAX. this value is used to simplfy
diff --git a/opal/mca/rcache/base/rcache_base_vma.h b/opal/mca/rcache/base/rcache_base_vma.h
index 261cad6719..bf066441c3 100644
--- a/opal/mca/rcache/base/rcache_base_vma.h
+++ b/opal/mca/rcache/base/rcache_base_vma.h
@@ -43,9 +43,6 @@ struct mca_rcache_base_registration_t;
struct mca_rcache_base_vma_module_t {
opal_object_t super;
opal_interval_tree_t tree;
- opal_list_t vma_list;
- opal_lifo_t vma_gc_lifo;
- size_t reg_cur_cache_size;
opal_mutex_t vma_lock;
};
typedef struct mca_rcache_base_vma_module_t mca_rcache_base_vma_module_t;
diff --git a/opal/mca/rcache/base/rcache_base_vma_tree.c b/opal/mca/rcache/base/rcache_base_vma_tree.c
index 09362f4f2b..d261e03ce9 100644
--- a/opal/mca/rcache/base/rcache_base_vma_tree.c
+++ b/opal/mca/rcache/base/rcache_base_vma_tree.c
@@ -34,7 +34,6 @@
int mca_rcache_base_vma_tree_init (mca_rcache_base_vma_module_t *vma_module)
{
OBJ_CONSTRUCT(&vma_module->tree, opal_interval_tree_t);
- vma_module->reg_cur_cache_size = 0;
return opal_interval_tree_init (&vma_module->tree);
}
diff --git a/opal/mca/rcache/grdma/rcache_grdma_module.c b/opal/mca/rcache/grdma/rcache_grdma_module.c
index 7bf1748e47..e3058a1001 100644
--- a/opal/mca/rcache/grdma/rcache_grdma_module.c
+++ b/opal/mca/rcache/grdma/rcache_grdma_module.c
@@ -80,11 +80,10 @@ static int check_for_cuda_freed_memory(mca_rcache_base_module_t *rcache, void *a
#endif /* OPAL_CUDA_GDR_SUPPORT */
static void mca_rcache_grdma_cache_contructor (mca_rcache_grdma_cache_t *cache)
{
- memset ((void *)((uintptr_t)cache + sizeof (cache->super)), 0, sizeof (*cache) - sizeof (cache->super));
-
OBJ_CONSTRUCT(&cache->lru_list, opal_list_t);
OBJ_CONSTRUCT(&cache->gc_lifo, opal_lifo_t);
+ cache->cache_name = NULL;
cache->vma_module = mca_rcache_base_vma_module_alloc ();
}
|
I turned out all it was false positives (probably). Compiling with @bosilca, yes, it solved related errors, when compiling without |
ok, so they were not false positive. The root cause is that the rcache modules are lazily initialized (on the first use), so when they are not used they don't correctly finalize. I will create a PR with this. |
Fixes open-mpi#13047 Signed-off-by: George Bosilca <[email protected]> (cherry picked from commit ab13add)
Fixes open-mpi#13047 Signed-off-by: George Bosilca <[email protected]> (cherry picked from commit ab13add)
Background information
What version of Open MPI are you using? (e.g., v4.1.6, v5.0.1, git branch name and hash, etc.)
v4.1.6 from https://www.open-mpi.org/software/ompi/v4.1/
Describe how Open MPI was installed (e.g., from a source/distribution tarball, from a git clone, from an operating system distribution package, etc.)
tar xvf openmpi-4.1.6.tar.gz
cd openmpi-4.1.6 && mkdir build && cd build
./configure --prefix=/special/place/for/install --enable-debug --enable-debug-symbols --with-pmi
make -j 16
make install
export MPI_HOME=/special/place/for/install
If you are building/installing from a git clone, please copy-n-paste the output from
git submodule status
.No
Please describe the system on which you are running
Details of the problem
I use this code
Compile
Run
sbatch --partition=test --ntasks-per-node=1 --wrap "srun -u valgrind --track-origins=yes ./hello_world"
Output:
The text was updated successfully, but these errors were encountered: