[Scummvm-git-logs] scummvm master -> a84801d0bf910e8262e351b49640958102f47e69

sev- sev at scummvm.org
Wed Aug 19 10:21:43 UTC 2020


This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
75a4e622c2 BACKENDS: Added debug output for race condition. Guarded by an #ifdef
a84801d0bf CONFIGURE: Added --enable-tsan option


Commit: 75a4e622c2c29178743be89392842d4e7248d7e7
    https://github.com/scummvm/scummvm/commit/75a4e622c2c29178743be89392842d4e7248d7e7
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2020-08-19T12:16:29+02:00

Commit Message:
BACKENDS: Added debug output for race condition. Guarded by an #ifdef

Changed paths:
    backends/timer/default/default-timer.cpp
    backends/timer/sdl/sdl-timer.cpp


diff --git a/backends/timer/default/default-timer.cpp b/backends/timer/default/default-timer.cpp
index 02f1f0ed8e..22cb418ba0 100644
--- a/backends/timer/default/default-timer.cpp
+++ b/backends/timer/default/default-timer.cpp
@@ -69,8 +69,15 @@ DefaultTimerManager::DefaultTimerManager() :
 }
 
 DefaultTimerManager::~DefaultTimerManager() {
+#ifdef DIRECTORBUILDBOT
+	warning("~DefaultTimerManager");
+#endif
 	Common::StackLock lock(_mutex);
 
+#ifdef DIRECTORBUILDBOT
+	warning("~DefaultTimerManager: locked");
+#endif
+
 	TimerSlot *slot = _head;
 	while (slot) {
 		TimerSlot *next = slot->next;
@@ -78,10 +85,20 @@ DefaultTimerManager::~DefaultTimerManager() {
 		slot = next;
 	}
 	_head = 0;
+
+#ifdef DIRECTORBUILDBOT
+	warning("~DefaultTimerManager: completed");
+#endif
 }
 
 void DefaultTimerManager::handler() {
+#ifdef DIRECTORBUILDBOT
+	warning("DefaultTimerManager::handler(): locking");
+#endif
 	Common::StackLock lock(_mutex);
+#ifdef DIRECTORBUILDBOT
+	warning("DefaultTimerManager::handler(): locked");
+#endif
 
 	uint32 curTime = g_system->getMillis(true);
 
diff --git a/backends/timer/sdl/sdl-timer.cpp b/backends/timer/sdl/sdl-timer.cpp
index 66031cd4ba..235fb904e3 100644
--- a/backends/timer/sdl/sdl-timer.cpp
+++ b/backends/timer/sdl/sdl-timer.cpp
@@ -32,8 +32,16 @@
 static volatile bool timerInstalled = false;
 
 static Uint32 timer_handler(Uint32 interval, void *param) {
-	if (!timerInstalled)
+	if (!timerInstalled) {
+#ifdef DIRECTORBUILDBOT
+		warning("timer_handler: timer is not installed");
+#endif
 		return interval;
+	}
+
+#ifdef DIRECTORBUILDBOT
+	warning("timer_handler: called");
+#endif
 
 	((DefaultTimerManager *)param)->handler();
 	return interval;
@@ -52,9 +60,16 @@ SdlTimerManager::SdlTimerManager() {
 }
 
 SdlTimerManager::~SdlTimerManager() {
+#ifdef DIRECTORBUILDBOT
+	warning("~SdlTimerManager");
+#endif
 	timerInstalled = false;
 	// Removes the timer callback
 	SDL_RemoveTimer(_timerID);
+
+#ifdef DIRECTORBUILDBOT
+	warning("~SdlTimerManager: SDL timer removed");
+#endif
 }
 
 #endif


Commit: a84801d0bf910e8262e351b49640958102f47e69
    https://github.com/scummvm/scummvm/commit/a84801d0bf910e8262e351b49640958102f47e69
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2020-08-19T12:16:29+02:00

Commit Message:
CONFIGURE: Added --enable-tsan option

Changed paths:
    configure


diff --git a/configure b/configure
index 7642abd583..79fa717843 100755
--- a/configure
+++ b/configure
@@ -183,6 +183,7 @@ _build_scalers=yes
 _build_hq_scalers=yes
 _enable_prof=no
 _enable_asan=no
+_enable_tsan=no
 _global_constructors=no
 _no_undefined_var_template=no
 _no_pragma_pack=no
@@ -1026,6 +1027,7 @@ Optional Features:
   --enable-release-mode    enable building in release mode (without optimizations)
   --enable-optimizations   enable optimizations
   --enable-asan            enable Address Sanitizer for memory-related debugging
+  --enable-tsan            enable Thread Sanitizer for thread-related debugging
   --enable-profiling       enable profiling
   --enable-plugins         enable the support for dynamic plugins
   --default-dynamic        make plugins dynamic by default
@@ -1467,6 +1469,9 @@ for ac_option in $@; do
 	--enable-asan)
 		_enable_asan=yes
 		;;
+	--enable-tsan)
+		_enable_tsan=yes
+		;;
 	--with-sdl-prefix=*)
 		arg=`echo $ac_option | cut -d '=' -f 2`
 		_sdlpath="$arg:$arg/bin"
@@ -5594,11 +5599,24 @@ fi
 echo_n "Enabling Address Sanitizer... "
 
 if test "$_enable_asan" = yes ; then
-	append_var CXXFLAGS "-fsanitize=address -fno-omit-frame-pointer"
-	append_var LDFLAGS "-fsanitize=address -fno-omit-frame-pointer"
+	if test "$_enable_tsan" = yes ; then
+		echo_n "conflicting with tsan, disabling... "
+		_enable_asan=no
+	else
+		append_var CXXFLAGS "-fsanitize=address -fno-omit-frame-pointer"
+		append_var LDFLAGS "-fsanitize=address -fno-omit-frame-pointer"
+	fi
 fi
 echo "$_enable_asan"
 
+echo_n "Enabling Thread Sanitizer... "
+
+if test "$_enable_tsan" = yes ; then
+	append_var CXXFLAGS "-fsanitize=thread -O2"
+	append_var LDFLAGS "-fsanitize=thread -O2"
+fi
+echo "$_enable_tsan"
+
 echo_n "Backend... "
 echo_n "$_backend"
 




More information about the Scummvm-git-logs mailing list