Alon Hamzani
Alon Hamzani

Reputation: 11

Application runs under windows xp but not under server 2003 r2

i have a very strange problem. i just finished developing a standalone application using visual studio 2010 and .net 4 in c#.

i added install project to the solution, build and compiled everything with success.

i ran it in debugging mode and later on i installed my app on my xp machine and everything went smooth and it works great!

now i took the install pack and installed it in the production machine that runs server 2003 r2, but when i try to run it, it's starts, i can see the gui for a couple of seconds and than it crashes.

i added many logs to my code using log4net, but could not find the reason why under xp it works perfectly and under server 2003 r2 the very same install won't last.

then i thought that if the app crashes it may be written under the system log event viewer, and it really was. i get 2 errors every run, but i could not really understand the meaning of them.

the errors are attached below. any kind of help will be much appreciated!

all the best!

================================================================================

FIRST ERROR:

   Event Type:  Error
Event Source:   .NET Runtime 4.0 Error Reporting
Event Category: None
Event ID:   5000
Date:       8/9/2012
Time:       11:03:26 AM
User:       N/A
Computer:   W2003_ORACLE01
Description:
EventType clr20r3, P1 gpsdispatcherserver.exe, P2 1.0.0.0, P3 502220c3, P4 mscorlib, P5 4.0.0.0, P6 4ba1da6f, P7 210, P8 18, P9 system.argumentoutofrange, P10 NIL.

For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.
Data:
0000: 63 00 6c 00 72 00 32 00   c.l.r.2.
0008: 30 00 72 00 33 00 2c 00   0.r.3.,.
0010: 20 00 67 00 70 00 73 00    .g.p.s.
0018: 64 00 69 00 73 00 70 00   d.i.s.p.
0020: 61 00 74 00 63 00 68 00   a.t.c.h.
0028: 65 00 72 00 73 00 65 00   e.r.s.e.
0030: 72 00 76 00 65 00 72 00   r.v.e.r.
0038: 2e 00 65 00 78 00 65 00   ..e.x.e.
0040: 2c 00 20 00 31 00 2e 00   ,. .1...
0048: 30 00 2e 00 30 00 2e 00   0...0...
0050: 30 00 2c 00 20 00 35 00   0.,. .5.
0058: 30 00 32 00 32 00 32 00   0.2.2.2.
0060: 30 00 63 00 33 00 2c 00   0.c.3.,.
0068: 20 00 6d 00 73 00 63 00    .m.s.c.
0070: 6f 00 72 00 6c 00 69 00   o.r.l.i.
0078: 62 00 2c 00 20 00 34 00   b.,. .4.
0080: 2e 00 30 00 2e 00 30 00   ..0...0.
0088: 2e 00 30 00 2c 00 20 00   ..0.,. .
0090: 34 00 62 00 61 00 31 00   4.b.a.1.
0098: 64 00 61 00 36 00 66 00   d.a.6.f.
00a0: 2c 00 20 00 32 00 31 00   ,. .2.1.
00a8: 30 00 2c 00 20 00 31 00   0.,. .1.
00b0: 38 00 2c 00 20 00 73 00   8.,. .s.
00b8: 79 00 73 00 74 00 65 00   y.s.t.e.
00c0: 6d 00 2e 00 61 00 72 00   m...a.r.
00c8: 67 00 75 00 6d 00 65 00   g.u.m.e.
00d0: 6e 00 74 00 6f 00 75 00   n.t.o.u.
00d8: 74 00 6f 00 66 00 72 00   t.o.f.r.
00e0: 61 00 6e 00 67 00 65 00   a.n.g.e.
00e8: 20 00 4e 00 49 00 4c 00    .N.I.L.
00f0: 0d 00 0a 00               ....   

================================================================================

SECOND ERROR:

Event Type: Error
Event Source:   .NET Runtime
Event Category: None
Event ID:   1026
Date:       8/9/2012
Time:       11:03:37 AM
User:       N/A
Computer:   W2003_ORACLE01
Description:
Application: GPSDispatcherServer.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.ArgumentOutOfRangeException
Stack:
   at System.ThrowHelper.ThrowArgumentOutOfRangeException()
   at System.Collections.Generic.List`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].get_Item(Int32)
   at GPSDispatcherServer.GPSDispatcherServerManager.createGpsDispInstance()
   at System.Threading.ThreadHelper.ThreadStart_Context(System.Object)
   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
   at System.Threading.ThreadHelper.ThreadStart()


For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.

================================================================================

Upvotes: 0

Views: 979

Answers (2)

Tomek Szpakowicz
Tomek Szpakowicz

Reputation: 14512

You have a stacktrace, damn it! That's more then anyone debugging crashes in native code could dream of. Use it. What the code at crash point is doing?

Looks like in GPSDispatcherServer.GPSDispatcherServerManager.createGpsDispInstance() method your program accesses a list (System.Collections.Generic.List) of some objects [1] with index outside of range. Check all your some_list[index] in this method and methods called from it.

My guess is that creation of some object failed and error was ignored by your code. Then your code assumed the object was created and added to the list.

Failure might have multiple reasons: lack of some component on the server, lack of permissions, lack of resources, invalid path...

[1] It's impossible to tell what class is in the list having only Release build without symbols. System.__Canon is standard place-holder class for generic parameter when compiler generates generic code.

Upvotes: 1

Polyfun
Polyfun

Reputation: 9639

First, make sure you build your application with debug symbols (in the project Build settings).

Then use DebugDiag on the production server to capture a crash dump. There are other ways of capturing crash dumps, but I've found this one of the easiest, and it is a small install.

The crash dump can be analysed offline, either using DebugDiag or WinDbg. The simplest way is to copy the crash dump file from the DebugDiag Logs directory on the server, to your bin\Release folder where you built the app. If using WinDbg, you should load the sos.dll extension that matches the .Net framework installed on the server (e.g., in C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319). So copy sos.dll to your build machine too, and load it into WinDbg using

.load <full path to sos.dll>

Then open the crash dump file in WinDbg. WinDbg should be able to automatically find the application symbols (pdb) as they should be in the same directory as the crash dump (e.g., bin\Release), and from the pdb WinDbg should automatically find the source code. So when you open the crash dump, it should take you to the line of code that caused it. If it doesn't, try hitting F5.

Upvotes: 0

Related Questions