Procházet zdrojové kódy

Fix simgrid crash: _starpu_simgrid_running_smpi is called before starpu_getenv can check from simgrid calls that it's safe to call getenv

Samuel Thibault před 9 roky
rodič
revize
bb18b8d81e
2 změnil soubory, kde provedl 2 přidání a 2 odebrání
  1. 1 1
      Makefile.am
  2. 1 1
      src/core/simgrid.h

+ 1 - 1
Makefile.am

@@ -115,7 +115,7 @@ if STARPU_DEVEL
 		echo "Please do not use ssize_t, it is not available on Windows, use starpu_ssize_t instead"; \
 		false ; \
 	fi
-	@if grep -re '\<getenv\>' $$( find $(srcdir)/src $(srcdir)/mpi/src $(srcdir)/include -name \*.[ch] -a \! -name starpu_util.h -a \! -name utils.c) ; \
+	@if grep -re '\<getenv\>' $$( find $(srcdir)/src $(srcdir)/mpi/src $(srcdir)/include -name \*.[ch] -a \! -name starpu_util.h -a \! -name utils.c -a \! -name simgrid.h) ; \
 	then \
 		echo "Please do not use getenv, use starpu_getenv instead, which catches unsafe uses"; \
 		false ; \

+ 1 - 1
src/core/simgrid.h

@@ -35,7 +35,7 @@ struct _starpu_pthread_args
 #define MAX_TSD 16
 
 #define STARPU_MPI_AS_PREFIX "StarPU-MPI"
-#define _starpu_simgrid_running_smpi() (starpu_getenv("SMPI_GLOBAL_SIZE") != NULL)
+#define _starpu_simgrid_running_smpi() (getenv("SMPI_GLOBAL_SIZE") != NULL)
 
 void _starpu_simgrid_init(void);
 void _starpu_simgrid_wait_tasks(int workerid);