Project

General

Profile

Bug #1983

Race condition in hwinfo

Added by Roland Schulz over 3 years ago. Updated over 3 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Affected version - extra info:
Affected version:
Difficulty:
uncategorized
Close

Description

TSAN reports with -nt 4 -ntomp 2 for dd121:

WARNING: ThreadSanitizer: data race (pid=31963)
  Write of size 4 at 0x7d1c0000ddb8 by thread T2 (mutexes: write M1034):
    #0 gmx_collect_hardware_mpi ../src/gromacs/hardware/detecthardware.cpp:858 (libgromacs.so.2+0x000001063d88)
    #1 gmx_detect_hardware(_IO_FILE*, t_commrec const*, int) ../src/gromacs/hardware/detecthardware.cpp:918 (libgromacs.so.2+0x000001063d88)
    #2 gmx::mdrunner(gmx_hw_opt_t*, _IO_FILE*, t_commrec*, int, t_filenm const*, gmx_output_env_t const*, int, int, int*, int, int, float, float, char const*, float, char const*, char const*, char const*, char const*, int, long, int, int, int, int, int, int, float, float, float, int, unsigned long) ../src/programs/mdrun/runner.cpp:732 (gmx+0x00000001fbb5)
    #3 mdrunner_start_fn ../src/programs/mdrun/runner.cpp:204 (gmx+0x000000023cf2)
    #4 tMPI_Thread_starter ../src/external/thread_mpi/src/tmpi_init.c:397 (libgromacs.so.2+0x000001075735)
    #5 tMPI_Thread_starter ../src/external/thread_mpi/src/pthreads.c:234 (libgromacs.so.2+0x00000106c060)

  Previous read of size 4 at 0x7d1c0000ddb8 by thread T3:
    #0 gmx_print_detected_hardware(_IO_FILE*, t_commrec const*, gmx_hw_info_t const*) ../src/gromacs/hardware/detecthardware.cpp:1183 (libgromacs.so.2+0x000001064227)
    #1 gmx::mdrunner(gmx_hw_opt_t*, _IO_FILE*, t_commrec*, int, t_filenm const*, gmx_output_env_t const*, int, int, int*, int, int, float, float, char const*, float, char const*, char const*, char const*, char const*, int, long, int, int, int, int, int, int, float, float, float, int, unsigned long) ../src/programs/mdrun/runner.cpp:734 (gmx+0x00000001fbd8)
    #2 mdrunner_start_fn ../src/programs/mdrun/runner.cpp:204 (gmx+0x000000023cf2)
    #3 tMPI_Thread_starter ../src/external/thread_mpi/src/tmpi_init.c:397 (libgromacs.so.2+0x000001075735)
    #4 tMPI_Thread_starter ../src/external/thread_mpi/src/pthreads.c:234 (libgromacs.so.2+0x00000106c060)

  Location is heap block of size 104 at 0x7d1c0000dd60 allocated by main thread:
    #0 calloc ../../../../gcc-4.9.3/libsanitizer/tsan/tsan_interceptors.cc:499 (libtsan.so.0+0x0000000499f1)
    #1 save_calloc ../src/gromacs/utility/smalloc.cpp:179 (libgromacs.so.2+0x00000028195c)
    #2 gmx_snew_impl<gmx_hw_info_t> ../src/gromacs/utility/smalloc.h:233 (libgromacs.so.2+0x000001063a22)
    #3 gmx_detect_hardware(_IO_FILE*, t_commrec const*, int) ../src/gromacs/hardware/detecthardware.cpp:880 (libgromacs.so.2+0x000001063a22)
    #4 gmx::mdrunner(gmx_hw_opt_t*, _IO_FILE*, t_commrec*, int, t_filenm const*, gmx_output_env_t const*, int, int, int*, int, int, float, float, char const*, float, char const*, char const*, char const*, char const*, int, long, int, int, int, int, int, int, float, float, float, int, unsigned long) ../src/programs/mdrun/runner.cpp:732 (gmx+0x00000001fbb5)
    #5 gmx_mdrun(int, char**) ../src/programs/mdrun/mdrun.cpp:534 (gmx+0x000000010690)
    #6 run ../src/programs/legacymodules.cpp:155 (gmx+0x00000002b077)
    #7 gmx::CommandLineModuleManager::run(int, char**) ../src/gromacs/commandline/cmdlinemodulemanager.cpp:563 (libgromacs.so.2+0x00000018d771)
    #8 main ../src/programs/gmx.cpp:60 (gmx+0x00000002af66)

  Mutex M1034 created at:
    #0 pthread_mutex_init ../../../../gcc-4.9.3/libsanitizer/tsan/tsan_interceptors.cc:925 (libtsan.so.0+0x000000047948)
    #1 tMPI_Thread_mutex_init_once ../src/external/thread_mpi/src/pthreads.c:436 (libgromacs.so.2+0x00000106c632)
    #2 tMPI_Thread_mutex_lock ../src/external/thread_mpi/src/pthreads.c:476 (libgromacs.so.2+0x00000106c632)
    #3 gmx_detect_hardware(_IO_FILE*, t_commrec const*, int) ../src/gromacs/hardware/detecthardware.cpp:871 (libgromacs.so.2+0x0000010639a6)
    #4 gmx::mdrunner(gmx_hw_opt_t*, _IO_FILE*, t_commrec*, int, t_filenm const*, gmx_output_env_t const*, int, int, int*, int, int, float, float, char const*, float, char const*, char const*, char const*, char const*, int, long, int, int, int, int, int, int, float, float, float, int, unsigned long) ../src/programs/mdrun/runner.cpp:732 (gmx+0x00000001fbb5)
    #5 gmx_mdrun(int, char**) ../src/programs/mdrun/mdrun.cpp:534 (gmx+0x000000010690)
    #6 run ../src/programs/legacymodules.cpp:155 (gmx+0x00000002b077)
    #7 gmx::CommandLineModuleManager::run(int, char**) ../src/gromacs/commandline/cmdlinemodulemanager.cpp:563 (libgromacs.so.2+0x00000018d771)
    #8 main ../src/programs/gmx.cpp:60 (gmx+0x00000002af66)

  Thread T2 (tid=31966, running) created by main thread at:
    #0 pthread_create ../../../../gcc-4.9.3/libsanitizer/tsan/tsan_interceptors.cc:877 (libtsan.so.0+0x000000047c33)
    #1 tMPI_Thread_create ../src/external/thread_mpi/src/pthreads.c:279 (libgromacs.so.2+0x00000106c346)
    #2 tMPI_Start_threads ../src/external/thread_mpi/src/tmpi_init.c:509 (libgromacs.so.2+0x000001075ca5)
    #3 tMPI_Init_fn ../src/external/thread_mpi/src/tmpi_init.c:593 (libgromacs.so.2+0x000001075e09)
    #4 mdrunner_start_threads ../src/programs/mdrun/runner.cpp:283 (gmx+0x000000020644)
    #5 gmx::mdrunner(gmx_hw_opt_t*, _IO_FILE*, t_commrec*, int, t_filenm const*, gmx_output_env_t const*, int, int, int*, int, int, float, float, char const*, float, char const*, char const*, char const*, char const*, int, long, int, int, int, int, int, int, float, float, float, int, unsigned long) ../src/programs/mdrun/runner.cpp:847 (gmx+0x000000020644)
    #6 gmx_mdrun(int, char**) ../src/programs/mdrun/mdrun.cpp:534 (gmx+0x000000010690)
    #7 run ../src/programs/legacymodules.cpp:155 (gmx+0x00000002b077)
    #8 gmx::CommandLineModuleManager::run(int, char**) ../src/gromacs/commandline/cmdlinemodulemanager.cpp:563 (libgromacs.so.2+0x00000018d771)
    #9 main ../src/programs/gmx.cpp:60 (gmx+0x00000002af66)

  Thread T3 (tid=31967, running) created by main thread at:
    #0 pthread_create ../../../../gcc-4.9.3/libsanitizer/tsan/tsan_interceptors.cc:877 (libtsan.so.0+0x000000047c33)
    #1 tMPI_Thread_create ../src/external/thread_mpi/src/pthreads.c:279 (libgromacs.so.2+0x00000106c346)
    #2 tMPI_Start_threads ../src/external/thread_mpi/src/tmpi_init.c:509 (libgromacs.so.2+0x000001075ca5)
    #3 tMPI_Init_fn ../src/external/thread_mpi/src/tmpi_init.c:593 (libgromacs.so.2+0x000001075e09)
    #4 mdrunner_start_threads ../src/programs/mdrun/runner.cpp:283 (gmx+0x000000020644)
    #5 gmx::mdrunner(gmx_hw_opt_t*, _IO_FILE*, t_commrec*, int, t_filenm const*, gmx_output_env_t const*, int, int, int*, int, int, float, float, char const*, float, char const*, char const*, char const*, char const*, int, long, int, int, int, int, int, int, float, float, float, int, unsigned long) ../src/programs/mdrun/runner.cpp:847 (gmx+0x000000020644)
    #6 gmx_mdrun(int, char**) ../src/programs/mdrun/mdrun.cpp:534 (gmx+0x000000010690)
    #7 run ../src/programs/legacymodules.cpp:155 (gmx+0x00000002b077)
    #8 gmx::CommandLineModuleManager::run(int, char**) ../src/gromacs/commandline/cmdlinemodulemanager.cpp:563 (libgromacs.so.2+0x00000018d771)
    #9 main ../src/programs/gmx.cpp:60 (gmx+0x00000002af66)

Associated revisions

Revision d6e28e08 (diff)
Added by Berk Hess over 3 years ago

Fix data race in hwinfo with thread-MPI

Fixes #1983.

Change-Id: Ic44d2c1e595796132127364900d4d995379b3175

History

#2 Updated by Gerrit Code Review Bot over 3 years ago

Gerrit received a related patchset '3' for Issue #1983.
Uploader: Berk Hess ()
Change-Id: Ic44d2c1e595796132127364900d4d995379b3175
Gerrit URL: https://gerrit.gromacs.org/5918

#3 Updated by Berk Hess over 3 years ago

  • Status changed from New to Resolved

#4 Updated by Erik Lindahl over 3 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF