views:

1436

answers:

8

I'm running a (mostly) single threaded program (there's a main thread that does everything, the others only read stuff). I can get the application to run fine in VS2008 after a minor change (I changed the text of a form, and tab order of another form), but I can no longer get it to work outside of the debugger. Does anyone know what would cause this?

Clarification: Release mode, launched with debugger (F5) works. Debug mode, lanuched with debugger (F5) works. Debug executable, or release executable launched outside of VS or with Ctrl+F5 fail.

It uses Microsoft's Virtual Earth 3D, and it seems to crash just when the 'ring of hope' (loading ring) is about to complete.

Event log says: ".NET Runtime version 2.0.50727.3053 - Fatal Execution Engine Error (000006427F44AA6E) (80131506)"

Culprit: this line:

        this.loader = PlugInLoader.CreateLoader(this.globeControl.Host);

Causes it to fail. However, the form that was working uses the exact same line without an issue. This line is nesseccary for the program to function. I have no idea what it's doing.

Another Lead the error seems to be inside the .NET framework. Application worked on another machine, attempting reinstall. Update: didn't make a difference, although when I repaired VS it kept telling me Visual Studio was crashing even though I wasn't running it.


Error When I launch the program after a couple minutes I get: Application has generated an exception that could not be handled.

Proccess ID=0x9CC (2508), Thread ID =0xF0C(3852).

Click OK to terminate the application.
Click CANCEL to debug the application.


The disassembly is bizarre:

0000000077EF2A90  int         3    
0000000077EF2A91  int         3    
0000000077EF2A92  int         3    
0000000077EF2A93  int         3    
0000000077EF2A94  int         3    
0000000077EF2A95  int         3    
0000000077EF2A96  xchg        ax,ax 
0000000077EF2A9A  xchg        ax,ax 
0000000077EF2A9E  xchg        ax,ax 
0000000077EF2AA0  int         3        <-- Crashes here
0000000077EF2AA1  ret

It repeats that same code block several times (minus on ax exchanging with itself)


Besides my computer, it has worked on every machine I've tested it on, except for a VM on my machine which won't install the .NET framework because setup downloads 0 bytes out of 0 bytes for the framework)...lovely windows.

A: 

Search for #if(DEBUG) directives? Search for Debug.Assert(?

Have you googled the error? I found this thread (admittedly not horribly helpful)

George Mauer
It's an app that uses Virtual Earth 3D to create animations, and it was working until I changed a few minor things.
Malfist
There are no #if(DEBUG)'s in the app
Malfist
Winforms or webapps
George Mauer
+1  A: 

Here is a support article with that error. Does that apply?

Perhaps the debugger is eating an excaption the VE3D API is throwing. In VS, do a ctrl+alt+e and change it to break whenever any exception is thrown. This can be tedius b/c it will break on all your try catch blocks, but it might give you some information.

Here is some info. about that PlugInLoader. It seems to imply it must be called from the FirstFrameRendered eventhandler. Perhaps one of your forms is doing that and one not?

JP Alioto
No, it's compiled as a .net 3.5 and ran under a user with a profile (me)
Malfist
if you call it from the FirstFrameRendered event, it's too late. It's one of the few things that has to be called before that. However, loading plugin's happens after the first frame has been rendered.
Malfist
+2  A: 

I've had similar issues where timing conflicts were causing the failure, and my debugging (breakpoints and stepping through the code) forced the code to run in the correct order.

C. Ross
That's an interesting idea but can it really be the issue if his application writes on a single thread only?
George Mauer
no breakpoints in the debugger :(
Malfist
You're right, it normally is caused by multi-threading, but sometimes object is doing multi-threading in the background.
C. Ross
+1  A: 

Try take off optimizations from the Release build (in the project settings) and see if that helps.

Mladen Mihajlovic
+1  A: 

I cannot tell you what exactly the problem is, but here's what you could do to get a clue what's really happening. I assume you're using VS2008 or 2005.

  1. Switch to release mode
  2. Go to Debug\Exceptions, and mark all "Thrown" exceptions, like illustrated here: http://vvcap.net/db/JbWS_tzy2IpBoI7R7amm.htp
  3. Run executable in debugger, ignore the warnings from VS that there's no debug info

It does seem that there's a win32 exception thrown some time during execution, but this way or another, you will get one or more messages from debugger explaining what kind of exception happened and where. In most cases those messages make it pretty clear what exactly went wrong

EDIT: One thing I forgot to mention is that unmanaged debugging must also be turned on, such like here (when you start program directly from IDE) or here (when you attach to running process)

galets
someone already asked me to do that, it makes no difference. Nothing is thrown. Nothing. It just crashes outside of a debugger.
Malfist
A: 

One thing left I think is to use WinDbg to try and debug it. Here are some links on how to use it:

  1. http://www.codeproject.com/KB/debug/windbg_part1.aspx
  2. http://blogs.msdn.com/johan/archive/2007/11/13/getting-started-with-windbg-part-i.aspx
  3. http://blogs.msdn.com/tess/ (good blog about debugging in general in windbg)

Thinking about it, it could also be some service or something that's clashing. Try stopping all unneeded services and closing unneeded programs (including startup ones) and see what happens then.

Mladen Mihajlovic
A: 

I fixed it, the .NET 2.0 Framework was corrupt and when I reinstalled it, everything magically started working again.

Malfist
Can't figure out how to reinstall. The installer says it's already installed. The Control Panel (Add or Remove Programs) has a Change button that shows a dialog and a progress meter but it doesn't say whether it reinstalled anything or even whether it succeeded or failed. Whatever I tried had no effect on my program's inability to run.
Jared Updike
You need a third party tool, microsoft won't let you remove it. You're looking for dotnetfx or .NET Fix. Google it, it shouldn't be too hard to find. According to microsoft this kind of stuff doesn't happen, therefor you cannot uninstall it.
Malfist
Why was this voted down. It is what solved the issue...
Malfist
A: 

we found and fixed this issue with MSFT, we faced this problem with VSTO development. Apply the following patch from MSFT.

http://support.microsoft.com/kb/975954 http://support.microsoft.com/kb/974372

Gomes