A first chance exception of type 'System.InvalidProgramException'when adding breakpoints for debuggi

P

Pixel.to.life

Gurus,

Another question on one of the coveted Microsoft products: JIT
debugger with VS2005.

I have a managed app that builds great on one machine (Vista Home
basic, VS2005, JIT enabled for managed/unmanaged code). I can also
debug it on this machine with breakpoints and all.

Now I move the same code on another machine (XP Pro, VS2005, JIT
enabled for both managed/unmanaged code). On this machine, it builds
fine too. And it runs like a cake in both debug/release configuration
AS LONG AS no breakpoints are added and enabled. As soon as a single
breakpoint is added (no matter where in the managed code), it crashes
when debugging with this exception:


CLR: Invalid x86 breakpoint in IL stream
First-chance exception at 0x7c812a5b in TestProgram.exe: 0x02345678:
0x2345678.
A first chance exception of type 'System.InvalidProgramException'
occurred in TestProgram.exe

I looked around on the internet and all I found on forums was Micosoft
MVPs talking about details that I dont care about (bugs in the compile/
assembler etc.). I have a professional grade product and it should
allow me to do basic debugging.. I dont care if it can help build
airplanes or not.

I am looking for a plain answer as to why this is happening and why
this hasnt been addressed yet after so many complaints.

Any takers form Seattle? :)
 
P

Pixel.to.life

Gurus,

Another question on one of the coveted Microsoft products: JIT
debugger with VS2005.

I have a managed app that builds great on one machine (Vista Home
basic, VS2005, JIT enabled for managed/unmanaged code). I can also
debug it on this machine with breakpoints and all.

Now I move the same code on another machine (XP Pro, VS2005, JIT
enabled for both managed/unmanaged code). On this machine, it builds
fine too. And it runs like a cake in both debug/release configuration
AS LONG AS no breakpoints are added and enabled. As soon as a single
breakpoint is added (no matter where in the managed code), it crashes
when debugging with this exception:

CLR: Invalid x86 breakpoint in IL stream
First-chance exception at 0x7c812a5b in TestProgram.exe: 0x02345678:
0x2345678.
A first chance exception of type 'System.InvalidProgramException'
occurred in TestProgram.exe

I looked around on the internet and all I found on forums was Micosoft
MVPs talking about details that I dont care about (bugs in the compile/
assembler etc.).  I have a professional grade product and it should
allow me to do basic debugging.. I dont care if it can help build
airplanes or not.

I am looking for a plain answer as to why this is happening and why
this hasnt been addressed yet after so many complaints.

Any takers form Seattle? :)

No takers, eh???
 
P

Pixel.to.life

[...]
Any takers form Seattle? :)
No takers, eh???

First of all, while a handful of Microsoft-paid people do monitor this  
newsgroup, mostly they are answering questions from MSDN subscribers.  
Your expectation that "takers form [sic] Seattle" are going to answer your 
question is unrealistic (unless of course you're an MSDN subscriber, in  
which case hopefully you'll get an answer as your subscription entitles  
you to).

Secondly, you didn't even wait three hours before following up your own  
post.  Even assuming you're an MSDN subscriber, you are being too  
impatient, and of course with respect to any of the other people who read  
this newsgroup and might reply, that's just WAY too impatient.  Keep your  
shorts on.  It could take as much as a day or two for someone who has a  
specific answer to see and answer your question.

Thirdly, I have no idea what you mean about "after so many complaints".  
Do you have evidence that the issue you're running into is common?  It  
certainly doesn't seem common to me, and I would guess that the many other 
people following this newsgroup don't find it common either.  Indeed, if 
there were in fact a relatively common problem with Visual Studio in which 
you could not set a breakpoint, no one would use it.  That alone should  
indicate to you that whatever's going on is uncommon.

Finally, the fact that it's breaking only on one computer strongly  
suggests that you simply have something wrong with that computer.  The  
first thing I'd try if I were you would be to uninstall Visual Studio and  
.NET, and then reinstall both.  And if that didn't fix the problem, I'd  
look at uninstalling everything again, running the XP repair console (from 
your installation CD) to ensure that XP isn't corrupted, and then  
reinstall again.  I'd say that there's a pretty good chance those actions  
would at some point correct the problem and if they didn't, the next thing 
I'd do is reinstall the OS and everything else from scratch.

I know that's a pain, but when an unusual problem such as the one you're  
describing shows up, it's sometimes the only option that will work.

Pete

Thanks Pete. Are you an MVP with Microsoft? Because the only useful
information I found in your reply was in ~10% of the text. Rest all I
could throw away. Hah:)

Anyways, I appreciate what you suggest, but I am still willing to
understand the problem rather than trying hasty system un/re-installs.

I am running PEVerify.exe on the binary to see if it points out any
glitches in the metadata / intermediate assembly first.

Btw a thread persists with same question on MSDN forum for Csharp.. no
takers yet.
 
P

Pixel.to.life

You could, assuming you are happy getting a reputation as someone not  
worth helping.  People asking for free help and who are impatient are  
often ignored outright.


If a reinstall fixes the problem, then there's nothing to "understand".  
It's a simple matter of some component in the various layers that got  
corrupted.  You could waste a lot of time tracking down exactly what got 
corrupted, and not come to any useful conclusion except that the fix is to 
uninstall and reinstall.

On the other hand, if you uninstall and reinstall, all the way down to a  
clean OS reinstall, and the problem persists then you can confidently  
start investigating more thoroughly, knowing that the effort will be  
rewarded with an answer to a consistently reproducible problem.

I doubt you'll get that far, but at least if you do you'll know that  
you're not wasting your time.


And if there are, then what?  If there's some problem with the compiled  
assembly, all that tells you is that whatever's corrupted is leading to a  
corrupted assembly.


The fact that no one has a specific answer there should be a strong  
indication that this isn't a common problem, and that you're unlikely to  
find anyone here with any better answer than that given already.

Pete


Pete,

I have a right to know the right solution, and am willing to spend the
time it needs.

I appreciate the fact that you are trying to help, but I want to
understand the problem first.

I may try un/re-install, perhaps, when there is no solution found
ever, but I am not doing that now for sure. I will wait to see what
Microsoft team says.

Again, thank you very much.
 
P

Pixel.to.life

I can't disagree with either of those statements.  I'm certainly not  
trying to deny your right to know what you want to know.


Okay.  Good luck.


Do you have an MSDN subscription, and are you posting with your registered 
subscription email address?

Some times Microsoft will reply to questions from people without MSDN  
subscriptions, but I wouldn't hold your breath.  If your problem cannot be  
reproduced on an arbitrary computer, it's unlikely they will be able to  
help even if they wanted to (the same thing applies to anyone reading your 
question for that matter).

Still, again...I wish you luck.  Just try to be a bit more patient next  
time.

Pete


Pete/all,

I finally got an answer on the MSDN forum and it works.

Basically it is a bug that was fixed in VisualStudio2008. I am using
VS2005, so with mixed code, I have to choose 'managed only' for
debugging.

Here is a link to the solution:
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=3306870&SiteID=1&mode=1

So fortunately I did not have to uninstall/re-install the development
system.. it turned out to be just a flag!!!:)

Thanks for all your efforts!
 

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