Managed/Unmanaged Application Fails intermittently on startup

E

EQuAl

Hi,

We have an application developed in VC2005 with mixed code, primarily C++
but using a C# dll for database access (DBUploader), the dll exposes a C++
interface. We are experiencing intermittent failure on startup - no errors or
warnings are generated (including in the EventVwr). Once running there are no
issues. The process is started either manually or spawned via a Windows
service. The dll is compiled with the following compiler options:

/GL /I "." /I "..\EQLRVFramework" /I "..\EQLRVFrameworkContainers" /I
"..\libtibrvcppex" /I "..\EQLBasics" /I "..\EQLException" /I
"..\EQLFileAsyncIO" /I "..\EQLFileIO" /I "..\EQLNumeric" /I "..\EQLTime" /I
"..\EQLTrace" /I "..\EQLVersion" /I "..\EQLWin32" /I "..\EQLXML" /I
"..\EQLGenEnum" /I "..\EQLID" /I "..\EQLExchange" /I "..\EQLMDS" /I
"..\EQLAppConfig" /I "..\EQLApplication" /I "..\EQLGenIOEnum" /I "..\MsgDef"
/I "..\EQLPubViews" /I "..\EQLStrategyParams" /I
"..\..\Setup\Build\MsgDef\Include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D
"_USRDLL" /D "_CRT_SECURE_NO_DEPRECATE" /D "NOMINMAX" /D "_EQL_RT_" /D
"EQLDBUPLOADER_EXPORTS" /FD /EHa /MD /Fo"RealTime\\" /Fd"RealTimevc80.pdb"
/W3 /nologo /c /Wp64 /Zi /clr /TP /wd4793 /wd4561 /errorReport:prompt /FU
"c:\WINNT\Microsoft.NET\Framework\v2.0.50727\System.dll" /FU
"c:\WINNT\Microsoft.NET\Framework\v2.0.50727\System.Data.dll"

And the following linker options:

/OUT:"..\RealTime\EQLDBUploader.dll" /INCREMENTAL:NO /NOLOGO
/LIBPATH:"..\RealTime" /DLL /MANIFEST
/MANIFESTFILE:"RealTime\EQLDBUploader.dll.intermediate.manifest" /DEBUG
/PDB:"c:\ClearCase\Work\GBPood_Equities_v3_Work_1\EQuAl\Equities\Projects\realtime\\EQLDBUploader.pdb"
/SUBSYSTEM:CONSOLE /OPT:REF /OPT:ICF /LTCG /MACHINE:X86 /ERRORREPORT:pROMPT
psapi.lib Rpcrt4.lib WinMM.lib libtibrvcppex.lib EQLException.lib
EQLTrace.lib EQLFileIO.lib EQLBasics.lib EQLTime.lib EQLWin32.lib EQLID.lib
EQLAppConfig.lib EQLRVFramework.lib EQLRVFrameworkContainers.lib

The application is compiled with the following options:

/GL /I "." /I "..\EQLRVFramework" /I "..\EQLRVFrameworkContainers" /I
"..\EQLIOFileReader" /I "..\libtibrvcppex" /I "..\EQLBasics" /I
"..\EQLException" /I "..\EQLFileAsyncIO" /I "..\EQLFileIO" /I "..\EQLNumeric"
/I "..\EQLTime" /I "..\EQLTrace" /I "..\EQLVersion" /I "..\EQLWin32" /I
"..\EQLXML" /I "..\EQLGenEnum" /I "..\EQLID" /I "..\EQLExchange" /I
"..\EQLMDS" /I "..\EQLAppConfig" /I "..\EQLApplication" /I "..\EQLGenIOEnum"
/I "..\MsgDef" /I "..\EQLPubViews" /I "..\EQLStrategyParams" /I
"..\..\Setup\Build\MsgDef\Include" /I "..\EQLDBUploader" /I "..\EQLTimers" /D
"WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_CRT_SECURE_NO_DEPRECATE" /D "NOMINMAX"
/D "_EQL_RT_" /D "_EQL_CONSOLE_" /FD /EHa /MD /fp:except /Fo"RealTime\\"
/Fd"RealTime\vc80.pdb" /W3 /nologo /c /Wp64 /Zi /TP /wd4949
/errorReport:prompt

And the following linker options:

/OUT:"..\RealTime\EQuAlIOJournal.exe" /INCREMENTAL:NO /NOLOGO
/LIBPATH:"..\RealTime" /MANIFEST
/MANIFESTFILE:"RealTime\EQuAlIOJournal.exe.intermediate.manifest" /DEBUG
/PDB:"c:\ClearCase\Work\GBPood_Equities_v3_Work_1\EQuAl\Equities\Projects\realtime\EQuAlIOJournal.pdb"
/SUBSYSTEM:CONSOLE /MACHINE:X86 /ERRORREPORT:pROMPT psapi.lib Rpcrt4.lib
WinMM.lib libtibrvcppex.lib EQLException.lib EQLTrace.lib EQLFileIO.lib
EQLBasics.lib EQLTime.lib EQLWin32.lib EQLID.lib EQLTimers.lib
EQLAppConfig.lib EQLApplication.lib EQLRVFramework.lib Advapi32.lib
EQLGenEnum.lib EQLGenIOEnum.lib EQLRVFrameworkContainers.lib
EQLIOFileReader.lib EQLDBUploader.lib

We are running on Windows 2k3 SP1 servers, with .NET framework 2.0 and DEP
turned on only for essential Windows applications.

The problem appears to manifest itself most often when we install a new
version of the binaries - but this may just be coincidence. We have read
several articles on mixed code loader lock and taken as many preventative
measures as possible, still with no joy.

Please can you recommend any courses of action or potential work
arounds/known issues.

Thanks

EQuAl Team
 
C

Charles Wang[MSFT]

Hi EQuAl,

I understand that you encountered the application intermittent failures during the startup.

If I have misunderstood, please let me know.



First I recommend that you use Process Monitor to monitor your process to see if there are some components or files failed loading during your application startup.Since this issue happened intermittently, to get the proper trace, you may need to first set the filter with "[Process Name] [contains] [your process name]" in ProcMon and then try restarting your application multiple times until you reproduce the issue.

You can download Process Monitor from this link:

http://technet.microsoft.com/en-us/sysinternals/bb896645.aspx



Also you can enable sxstrace to diagnose your application. You can refer to this article:

Diagnosing SideBySide failures

http://blogs.msdn.com/junfeng/archive/2006/04/14/576314.aspx



I recommend that you mail the trace files to me (changliw_at_microsoft_dot_com) for detail view.



In addition, for further research, could you please let me know more information about your application:

1. Could you reproduce this issue if you start your application from Visual Studio in DEBUG mode?

2. Could you please share some code snippets here for the main entry point function?




If you have any other questions or concerns, please feel free to let me know.


Best regards,
Charles Wang
Microsoft Online Community Support
===========================================================
Delighting our customers is our #1 priority. We welcome your
comments and suggestions about how we can improve the
support we provide to you. Please feel free to let my manager
know what you think of the level of service provided. You can
send feedback directly to my manager at: (e-mail address removed).
===========================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for
non-urgent issues where an initial response from the community
or a Microsoft Support Engineer within 1 business day is acceptable.
Please note that each follow up response may take approximately
2 business days as the support professional working with you may
need further investigation to reach the most efficient resolution.
The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by
contacting Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
============================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
=========================================================
 
E

EQuAl

Charles,

Have emailed you Proc. Mon. dump. Please can you confirm receipt.

Thanks

Charles Wang said:
Hi EQuAl,

I understand that you encountered the application intermittent failures during the startup.

If I have misunderstood, please let me know.



First I recommend that you use Process Monitor to monitor your process to see if there are some components or files failed loading during your application startup.Since this issue happened intermittently, to get the proper trace, you may need to first set the filter with "[Process Name] [contains] [your process name]" in ProcMon and then try restarting your application multiple times until you reproduce the issue.

You can download Process Monitor from this link:

http://technet.microsoft.com/en-us/sysinternals/bb896645.aspx



Also you can enable sxstrace to diagnose your application. You can refer to this article:

Diagnosing SideBySide failures

http://blogs.msdn.com/junfeng/archive/2006/04/14/576314.aspx



I recommend that you mail the trace files to me (changliw_at_microsoft_dot_com) for detail view.



In addition, for further research, could you please let me know more information about your application:

1. Could you reproduce this issue if you start your application from Visual Studio in DEBUG mode?

2. Could you please share some code snippets here for the main entry point function?




If you have any other questions or concerns, please feel free to let me know.


Best regards,
Charles Wang
Microsoft Online Community Support
===========================================================
Delighting our customers is our #1 priority. We welcome your
comments and suggestions about how we can improve the
support we provide to you. Please feel free to let my manager
know what you think of the level of service provided. You can
send feedback directly to my manager at: (e-mail address removed).
===========================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for
non-urgent issues where an initial response from the community
or a Microsoft Support Engineer within 1 business day is acceptable.
Please note that each follow up response may take approximately
2 business days as the support professional working with you may
need further investigation to reach the most efficient resolution.
The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by
contacting Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
============================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
=========================================================




EQuAl said:
Hi,

We have an application developed in VC2005 with mixed code, primarily C++
but using a C# dll for database access (DBUploader), the dll exposes a C++
interface. We are experiencing intermittent failure on startup - no errors or
warnings are generated (including in the EventVwr). Once running there are no
issues. The process is started either manually or spawned via a Windows
service. The dll is compiled with the following compiler options:

/GL /I "." /I "..\EQLRVFramework" /I "..\EQLRVFrameworkContainers" /I
"..\libtibrvcppex" /I "..\EQLBasics" /I "..\EQLException" /I
"..\EQLFileAsyncIO" /I "..\EQLFileIO" /I "..\EQLNumeric" /I "..\EQLTime" /I
"..\EQLTrace" /I "..\EQLVersion" /I "..\EQLWin32" /I "..\EQLXML" /I
"..\EQLGenEnum" /I "..\EQLID" /I "..\EQLExchange" /I "..\EQLMDS" /I
"..\EQLAppConfig" /I "..\EQLApplication" /I "..\EQLGenIOEnum" /I "..\MsgDef"
/I "..\EQLPubViews" /I "..\EQLStrategyParams" /I
"..\..\Setup\Build\MsgDef\Include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D
"_USRDLL" /D "_CRT_SECURE_NO_DEPRECATE" /D "NOMINMAX" /D "_EQL_RT_" /D
"EQLDBUPLOADER_EXPORTS" /FD /EHa /MD /Fo"RealTime\\" /Fd"RealTimevc80.pdb"
/W3 /nologo /c /Wp64 /Zi /clr /TP /wd4793 /wd4561 /errorReport:prompt /FU
"c:\WINNT\Microsoft.NET\Framework\v2.0.50727\System.dll" /FU
"c:\WINNT\Microsoft.NET\Framework\v2.0.50727\System.Data.dll"

And the following linker options:

/OUT:"..\RealTime\EQLDBUploader.dll" /INCREMENTAL:NO /NOLOGO
/LIBPATH:"..\RealTime" /DLL /MANIFEST
/MANIFESTFILE:"RealTime\EQLDBUploader.dll.intermediate.manifest" /DEBUG
/PDB:"c:\ClearCase\Work\GBPood_Equities_v3_Work_1\EQuAl\Equities\Projects\realtime\\EQLDBUploader.pdb"
/SUBSYSTEM:CONSOLE /OPT:REF /OPT:ICF /LTCG /MACHINE:X86 /ERRORREPORT:pROMPT
psapi.lib Rpcrt4.lib WinMM.lib libtibrvcppex.lib EQLException.lib
EQLTrace.lib EQLFileIO.lib EQLBasics.lib EQLTime.lib EQLWin32.lib EQLID.lib
EQLAppConfig.lib EQLRVFramework.lib EQLRVFrameworkContainers.lib

The application is compiled with the following options:

/GL /I "." /I "..\EQLRVFramework" /I "..\EQLRVFrameworkContainers" /I
"..\EQLIOFileReader" /I "..\libtibrvcppex" /I "..\EQLBasics" /I
"..\EQLException" /I "..\EQLFileAsyncIO" /I "..\EQLFileIO" /I "..\EQLNumeric"
/I "..\EQLTime" /I "..\EQLTrace" /I "..\EQLVersion" /I "..\EQLWin32" /I
"..\EQLXML" /I "..\EQLGenEnum" /I "..\EQLID" /I "..\EQLExchange" /I
"..\EQLMDS" /I "..\EQLAppConfig" /I "..\EQLApplication" /I "..\EQLGenIOEnum"
/I "..\MsgDef" /I "..\EQLPubViews" /I "..\EQLStrategyParams" /I
"..\..\Setup\Build\MsgDef\Include" /I "..\EQLDBUploader" /I "..\EQLTimers" /D
"WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_CRT_SECURE_NO_DEPRECATE" /D "NOMINMAX"
/D "_EQL_RT_" /D "_EQL_CONSOLE_" /FD /EHa /MD /fp:except /Fo"RealTime\\"
/Fd"RealTime\vc80.pdb" /W3 /nologo /c /Wp64 /Zi /TP /wd4949
/errorReport:prompt

And the following linker options:

/OUT:"..\RealTime\EQuAlIOJournal.exe" /INCREMENTAL:NO /NOLOGO
/LIBPATH:"..\RealTime" /MANIFEST
/MANIFESTFILE:"RealTime\EQuAlIOJournal.exe.intermediate.manifest" /DEBUG
/PDB:"c:\ClearCase\Work\GBPood_Equities_v3_Work_1\EQuAl\Equities\Projects\realtime\EQuAlIOJournal.pdb"
/SUBSYSTEM:CONSOLE /MACHINE:X86 /ERRORREPORT:pROMPT psapi.lib Rpcrt4.lib
WinMM.lib libtibrvcppex.lib EQLException.lib EQLTrace.lib EQLFileIO.lib
EQLBasics.lib EQLTime.lib EQLWin32.lib EQLID.lib EQLTimers.lib
EQLAppConfig.lib EQLApplication.lib EQLRVFramework.lib Advapi32.lib
EQLGenEnum.lib EQLGenIOEnum.lib EQLRVFrameworkContainers.lib
EQLIOFileReader.lib EQLDBUploader.lib

We are running on Windows 2k3 SP1 servers, with .NET framework 2.0 and DEP
turned on only for essential Windows applications.

The problem appears to manifest itself most often when we install a new
version of the binaries - but this may just be coincidence. We have read
several articles on mixed code loader lock and taken as many preventative
measures as possible, still with no joy.

Please can you recommend any courses of action or potential work
arounds/known issues.

Thanks

EQuAl Team
 
C

Charles Wang [MSFT]

Hi EQuAl,
Thank you for your mailing me the procmon file. Due to time difference
between us, my email response may be lower than your expectation.
Appreciate your understanding on this. I have replied you via email.

From the ProcMon trace file, I read of the following information:
1. Your application seems using Windows Terminal Service API;
2. The VC++ library used in your application is not the latest version.
If possible, I recommend that you first install the latest SP and then
rebuild your project. This can help us ensure that this issue is not caused
by any known issues from the underlying library. You can download the VC++
SP1 from this link:
http://www.microsoft.com/downloads/details.aspx?familyid=200b2fd9-ae1a-4a14-
984d-389c36f85647&displaylang=en

However I could not find any helpful clues that indicate the cause of this
issue. For further research, could you please collect the dump file from
sxstrace and answer me the two questions mentioned in my initial response
at the newsgroup?

I also hope that you can introduce me some background information of your
program so that I can better understand your issue.

Thank you again. Please feel free to let me know if you have any other
questions or concerns.

Best regards,
Charles Wang
Microsoft Online Community Support
=========================================================
Delighting our customers is our #1 priority. We welcome your
comments and suggestions about how we can improve the
support we provide to you. Please feel free to let my manager
know what you think of the level of service provided. You can
send feedback directly to my manager at: (e-mail address removed).
=========================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
=========================================================
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top