We recently upgraded some C++ code from VS2005 -> VS2010.
This C++ code is called RFA_RMDS, and it is an in-house wrapper around the Reuters RFA libraries. This wrapper is used by some C# code in turn. So, to be clear:
C# -> C++ Wrapper (RFA_RMDS) -> Reuters RFA libraries.
After the upgrade, the application throws an AccessViolationException (below) when instantiating a RFA client - but only on Windows 7. That is to say, it works fine on Windows XP.
Further, an earlier build of the application that uses the VS2005 version of the C++ wrapper works fine on both Windows 7 and Windows XP.
This leads me to believe that the upgrade is the cause of this exception. However, as I'm not a C++ developer (and we don't really have one right now), I'm at a loss for how to address this.
Some further points:
- The application runs in 32-bit mode on Windows 7 as the executable has been modified by CorFlags.
- An earlier build of the application that uses the VS2005 C++ wrapper works fine on both Windows 7 and Win XP.
- The C++ wrapper targets .NET 2.0, though it used to target .NET 3.5 (which the C# code targets). The problem existed even when it targetted .NET 3.5.
- The Windows 7 box has the redistributables for Microsoft Visual C++ 2005(x86??/x64), 2008 (x86/x64) and 2010 (x86).
Please let me know if there's any more information I should provide - perhaps also how to get it.
Any tips/suggestions/solutions, even the most basic things would be very much appreciated. Thank you.
Stack Trace
AccessViolationException Attempted to read or write protected memory. This is often an indication that other memory is corrupt. at std.basic_string,std::allocator >.{dtor}(basic_string\,std::allocator >* ) at AppLoggerClient.processEvent(AppLoggerClient* , Event* event) in c:\buildagent\work\ef735b7d6bb58dc3\rfa_rmds\rfa_rmds\apploggerclient.cpp:line 70 at CWM.WindowProc(HWND__* hwnd, UInt32 uMsg, UInt32 wParam, Int32 lParam) in c:\buildagent\work\ef735b7d6bb58dc3\rfa_rmds\rfa_rmds\messageloop.cpp:line 51 at DispatchMessageW(tagMSG* ) at DispatchMessage(tagMSG* lpMsg) in c:\program files\microsoft sdks\windows\v6.0a\include\winuser.h:line 3052 at CWM.run(CWM* ) in c:\buildagent\work\ef735b7d6bb58dc3\rfa_rmds\rfa_rmds\messageloop.cpp:line 89 at RFA_RMDS.RFA_Frame.Start() in c:\buildagent\work\ef735b7d6bb58dc3\rfa_rmds\rfa_rmds\rfa_frame.cpp:line 122 at RFA_RMDS.RFA_FrameManager.WorkerThreadFunction() in c:\buildagent\work\ef735b7d6bb58dc3\rfa_rmds\rfa_rmds\rfa_framemanager.cpp:line 126 at System.Threading.ThreadHelper.ThreadStart_Context(Object state) at System.Threading.ExecutionContext.runTryCode(Object userData) at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData) at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ThreadHelper.ThreadStart()
VS2010 C++ Command Line
/I"..\..\RFA-6.3\Include" /I"..\..\RFA-6.3\Include\TIBMsg" /I"..\..\RFA- 6.3\Include\SessionLayer" /I"..\..\RFA-6.3\Include\Common" /I"..\..\RFA-6.3\Include\Logger" /I"..\..\RFA-6.3\Include\Config" /Zi /clr:oldSyntax /nologo /W3 /WX- /O2 /Oy- /GL /D "WIN32" /D "NDEBUG" /D "_WINDLL" /D "_UNICODE" /D "UNICODE" /EHa /MD /GS /fp:precise /Zc:wchar_t /Zc:forScope /Yu"StdAfx.h" /Fp"Release\RFA_RMDS.pch" /Fa"Release\" /Fo"Release\" /Fd"Release\vc90.pdb" /Gd /TP /FU"c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Data.dll" /FU"c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.dll" /FU"c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Xml.dll" /analyze- /errorReport:queue
VS2005 C++ Command Line
/Od /I "..\..\RFA-6.3\Include" /I "..\..\RFA-6.3\Include\TIBMsg" /I "..\..\RFA-6.3\Include\SessionLayer" /I "..\..\RFA-6.3\Include\Common" /I "..\..\RFA-6.3\Include\Logger" /I "..\..\RFA-6.3\Include\Config" /D "WIN32" /D "_DEBUG" /D "_WINDLL" /D "_UNICODE" /D "UNICODE" /FD /EHa /MDd /Yu"stdafx.h" /Fp"Debug\RFA_RMDS.pch" /Fo"Debug\\" /Fd"Debug\vc80.pdb" /W3 /nologo /c /Zi /clr:oldSyntax /TP /errorReport:prompt /FU "c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.dll" /FU "c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Data.dll" /FU "c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.XML.dll"
VS2010 Linker Command Line
/OUT:"F:\checkout\gl\global\trunk\client\modules\RFASource\DotNet2.0\RFA_RMDS\Release\RFA_RMDS.dll" /INCREMENTAL:NO /NOLOGO /LIBPATH:"..\..\RFA-6.3\Libs" /DLL "msvcprt.lib" "msvcrt.lib" "ws2_32.lib" "RFA6_Common80.lib" "RFA6_Config80.lib" "RFA6_Logger80.lib" "RFA6_Data80.lib" "RFA6_Connections80.lib" "RFA6_Connections_MD80.lib" "RFA6_SessionLayer80.lib" "AnsiPage80.lib" "libTibMsg.lib" "dacslock.lib" "Shell32.lib" "Shlwapi.lib" "kernel32.lib" "user32.lib" "gdi32.lib" "winspool.lib" "comdlg32.lib" "advapi32.lib" "shell32.lib" "ole32.lib" "oleaut32.lib" "uuid.lib" "odbc32.lib" "odbccp32.lib" /MANIFEST /ManifestFile:"Release\RFA_RMDS.dll.intermediate.manifest" /ALLOWISOLATION /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /DEBUG /PDB:"F:\checkout\gl\global\trunk\client\modules\RFASource\DotNet2.0\RFA_RMDS\Release\RFA_RMDS.pdb" /PGD:"F:\checkout\gl\global\trunk\client\modules\RFASource\DotNet2.0\RFA_RMDS\Release\RFA_RMDS.pgd" /LTCG /TLBID:1 /DYNAMICBASE:NO /FIXED:NO /MACHINE:X86 /ERRORREPORT:QUEUE
VS2005 Linker Command Line
/OUT:"F:\checkout\gl\global\trunk\client\modules\RFASource_VS2005\DotNet2.0\RFA_RMDS\Debug\RFA_RMDS.dll" /INCREMENTAL /NOLOGO /LIBPATH:"..\..\RFA-6.3\Libs" /DLL /MANIFEST /MANIFESTFILE:"Debug\RFA_RMDS.dll.intermediate.manifest" /DEBUG /ASSEMBLYDEBUG /PDB:"f:\checkout\gl\global\trunk\client\modules\RFASource_VS2005\DotNet2.0\RFA_RMDS\Debug\RFA_RMDS.pdb" /MACHINE:X86 /FIXED:No /ERRORREPORT:PROMPT msvcprt.lib msvcrt.lib ws2_32.lib RFA6_Common80.lib RFA6_Config80.lib RFA6_Logger80.lib RFA6_Data80.lib RFA6_Connections80.lib RFA6_Connections_MD80.lib RFA6_SessionLayer80.lib AnsiPage80.lib libTibMsg.lib dacslock.lib Shell32.lib Shlwapi.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib