diff --git a/indra/llcommon/llerror.cpp b/indra/llcommon/llerror.cpp
index 9b0141eb76717dc363d90010f46577db8146766b..5c8e6cca2905852e7f3fca79035c131db367ad48 100755
--- a/indra/llcommon/llerror.cpp
+++ b/indra/llcommon/llerror.cpp
@@ -201,10 +201,7 @@ namespace {
 		virtual void recordMessage(LLError::ELevel level,
 								   const std::string& message)
 		{
-			llutf16string utf16str =
-				wstring_to_utf16str(utf8str_to_wstring(message));
-			utf16str += '\n';
-			OutputDebugString(utf16str.c_str());
+			LL_WINDOWS_OUTPUT_DEBUG(wstring_to_utf16str(utf8str_to_wstring(message)));
 		}
 	};
 #endif
diff --git a/indra/llcommon/llerror.h b/indra/llcommon/llerror.h
index b65b4101531fb6d42be69dfe6ec4315f0f48acc9..08a5cd26df6e667d6504ca8ca262fff4c73eb19f 100755
--- a/indra/llcommon/llerror.h
+++ b/indra/llcommon/llerror.h
@@ -283,6 +283,20 @@ typedef LLError::NoClassInfo _LL_CLASS_TO_LOG;
 #define LL_ENDL llendl
 #define LL_CONT	(*_out)
 
+// Short story: We don't want to enable this in release builds.
+//
+// Long story: ...because this call generates C++ exceptions
+// which are handled and fine under the debugger, but instant death should they occur from
+// within a coroutine's stackframe due to inherent limitations of Windows 32-bit SEH
+// interacting with the fiber-based coroutine support used by boost.
+//
+// gmad BUG-2707/MAINT-2740
+#if LL_WINDOWS && defined(_DEBUG)
+	#define LL_WINDOWS_OUTPUT_DEBUG(a) OutputDebugString(utf8str_to_utf16str(a).c_str()), OutputDebugString("\n")
+#else
+	#define LL_WINDOWS_OUTPUT_DEBUG(a)
+#endif
+
 	/*
 		Use this construct if you need to do computation in the middle of a
 		message:
diff --git a/indra/llcommon/llsys.cpp b/indra/llcommon/llsys.cpp
index 57a6de9060cd0f612517d8bffe1c8bc88569ff64..418c5763f8826bf93ed2848e9ad4543fafcc7fb5 100755
--- a/indra/llcommon/llsys.cpp
+++ b/indra/llcommon/llsys.cpp
@@ -1385,7 +1385,7 @@ class FrameWatcher
             return false;
         }
         // Congratulations, we've hit a new low.  :-P
-
+#if _DEBUG
         LL_INFOS("FrameWatcher") << ' ';
         if (! prevSize)
         {
@@ -1398,6 +1398,9 @@ class FrameWatcher
         }
         LL_CONT << std::fixed << std::setprecision(1) << framerate << '\n'
                 << LLMemoryInfo() << LL_ENDL;
+#else
+	(void)prevSize;
+#endif
 
         return false;
     }
diff --git a/indra/llui/llxuiparser.cpp b/indra/llui/llxuiparser.cpp
index 3ad5ad7d425dfeda1f2ecb9d2bc9c00dfbddb0ab..4f3a2e06233779d13e77d4d3b8a40104b4b43117 100755
--- a/indra/llui/llxuiparser.cpp
+++ b/indra/llui/llxuiparser.cpp
@@ -1311,8 +1311,7 @@ void LLXUIParser::parserWarning(const std::string& message)
 #ifdef LL_WINDOWS
 	// use Visual Studo friendly formatting of output message for easy access to originating xml
 	llutf16string utf16str = utf8str_to_utf16str(llformat("%s(%d):\t%s", mCurFileName.c_str(), mCurReadNode->getLineNumber(), message.c_str()).c_str());
-	utf16str += '\n';
-	OutputDebugString(utf16str.c_str());
+	LL_WINDOWS_OUTPUT_DEBUG(utf16str);
 #else
 	Parser::parserWarning(message);
 #endif
@@ -1322,8 +1321,7 @@ void LLXUIParser::parserError(const std::string& message)
 {
 #ifdef LL_WINDOWS
 	llutf16string utf16str = utf8str_to_utf16str(llformat("%s(%d):\t%s", mCurFileName.c_str(), mCurReadNode->getLineNumber(), message.c_str()).c_str());
-	utf16str += '\n';
-	OutputDebugString(utf16str.c_str());
+	LL_WINDOWS_OUTPUT_DEBUG(utf16str);
 #else
 	Parser::parserError(message);
 #endif
@@ -1642,8 +1640,7 @@ void LLSimpleXUIParser::parserWarning(const std::string& message)
 #ifdef LL_WINDOWS
 	// use Visual Studo friendly formatting of output message for easy access to originating xml
 	llutf16string utf16str = utf8str_to_utf16str(llformat("%s(%d):\t%s", mCurFileName.c_str(), LINE_NUMBER_HERE, message.c_str()).c_str());
-	utf16str += '\n';
-	OutputDebugString(utf16str.c_str());
+	LL_WINDOWS_OUTPUT_DEBUG(utf16str);
 #else
 	Parser::parserWarning(message);
 #endif
@@ -1653,8 +1650,7 @@ void LLSimpleXUIParser::parserError(const std::string& message)
 {
 #ifdef LL_WINDOWS
 	llutf16string utf16str = utf8str_to_utf16str(llformat("%s(%d):\t%s", mCurFileName.c_str(), LINE_NUMBER_HERE, message.c_str()).c_str());
-	utf16str += '\n';
-	OutputDebugString(utf16str.c_str());
+	LL_WINDOWS_OUTPUT_DEBUG(utf16str);
 #else
 	Parser::parserError(message);
 #endif
diff --git a/indra/media_plugins/winmmshim/winmm_shim.cpp b/indra/media_plugins/winmmshim/winmm_shim.cpp
index 47a1e5c0187acf98e37cad50e763433170f8c27a..9e2e7ad3aa5f98965563773eb89d7be03549062a 100755
--- a/indra/media_plugins/winmmshim/winmm_shim.cpp
+++ b/indra/media_plugins/winmmshim/winmm_shim.cpp
@@ -61,13 +61,18 @@ void ll_winmm_shim_initialize(){
 		{	// we have a dll, let's get out pointers!
 			initialized = true;
 			init_function_pointers(winmm_handle);
+#if defined(_DEBUG)
 			::OutputDebugStringA("WINMM_SHIM.DLL: real winmm.dll initialized successfully\n");
+#endif
 		}
+#if defined(_DEBUG)
 		else
 		{
 			// failed to initialize real winmm.dll
 			::OutputDebugStringA("WINMM_SHIM.DLL: Failed to initialize real winmm.dll\n");
 		}
+#endif
+
 	}
 	LeaveCriticalSection(&sCriticalSection);
 }