Discussion:
stepping over/into code is causing Unhandled Exceptions
(too old to reply)
mos
2009-05-07 20:13:07 UTC
Permalink
I'm using Visual Studio 2008 on a 64-bit version of Vista. After my
program stops on one of my breakpoints, I can't step over or into the
current line without getting either an Illegal Instruction exception,
or an Access Violation exception. If I right-click on the next line
and choose "Run to here" (equivalent to "Step over"), it works fine.

Has anyone run into this problem before?
Scot T Brennecke
2009-05-10 04:32:03 UTC
Permalink
There have been a few bugs (not many, though) with this type of thing. It would help to know the
specific code involved where the breakpoint is set. Is this an optimized build, or is optimization
off for debugging? Do you already have SP1 applied?
Post by mos
I'm using Visual Studio 2008 on a 64-bit version of Vista. After my
program stops on one of my breakpoints, I can't step over or into the
current line without getting either an Illegal Instruction exception,
or an Access Violation exception. If I right-click on the next line
and choose "Run to here" (equivalent to "Step over"), it works fine.
Has anyone run into this problem before?
mos
2009-05-11 15:47:18 UTC
Permalink
There have been a few bugs (not many, though) with this type of thing.  It would help to know the
specific code involved where the breakpoint is set.  Is this an optimized build, or is optimization
off for debugging?  Do you already have SP1 applied?
SP1 is installed. It is a debug (no optimization) build. There
doesn't appear to be anything special about the line of code, since it
happens on *any* breakpoint I set. I could set it on line 20, 200,
2000, or anything in-between.

I'm beginning to suspect it has something to do with one of the dlls
that gets delay-loaded, but I can't be certain. The reason I think
this is because I can set a breakpoint very early (in main()), but
after stepping over a few lines it will eventually exhibit the
crashing symptoms and only right after a flurry of

'myapp.exe': Loaded 'c:\...\whatever.dll', Symbols loaded.

messages.
Scot T Brennecke
2009-05-12 10:21:40 UTC
Permalink
Is it your program that is being debugged that is generating the exception, or is it the Visual
Studio debugger itself causing the exception?
There have been a few bugs (not many, though) with this type of thing. It would help to know the
specific code involved where the breakpoint is set. Is this an optimized build, or is optimization
off for debugging? Do you already have SP1 applied?
SP1 is installed. It is a debug (no optimization) build. There
doesn't appear to be anything special about the line of code, since it
happens on *any* breakpoint I set. I could set it on line 20, 200,
2000, or anything in-between.

I'm beginning to suspect it has something to do with one of the dlls
that gets delay-loaded, but I can't be certain. The reason I think
this is because I can set a breakpoint very early (in main()), but
after stepping over a few lines it will eventually exhibit the
crashing symptoms and only right after a flurry of

'myapp.exe': Loaded 'c:\...\whatever.dll', Symbols loaded.

messages.
mos
2009-05-14 19:12:44 UTC
Permalink
Post by Scot T Brennecke
Is it your program that is being debugged that is generating the exception, or is it the Visual
Studio debugger itself causing the exception?
The exceptions come from my app, apparently. But I'd like to stress
that if I never enter the debugger, I never see these exceptions. In
fact, as long as I don't try to *step* while in the debugger, I never
see these exceptions. Stopping on a breakpoint and then choosing
"Continue" from the Debug menu will send my app on its merry way.

And here's something screwy I forgot to mention: if I attach to the
process after startup, everything seems to work just fine.
David Lowndes
2009-05-14 19:24:06 UTC
Permalink
Post by mos
The exceptions come from my app, apparently. But I'd like to stress
that if I never enter the debugger, I never see these exceptions. In
fact, as long as I don't try to *step* while in the debugger, I never
see these exceptions. Stopping on a breakpoint and then choosing
"Continue" from the Debug menu will send my app on its merry way.
A shot in the dark here - do you have anything in the watch window? If
you do, try deleting them.

Dave
mos
2009-05-18 19:24:44 UTC
Permalink
Post by David Lowndes
The exceptions come from my app, apparently.  But I'd like to stress
that if I never enter the debugger, I never see these exceptions.  In
fact, as long as I don't try to *step* while in the debugger, I never
see these exceptions.  Stopping on a breakpoint and then choosing
"Continue" from the Debug menu will send my app on its merry way.
A shot in the dark here - do you have anything in the watch window? If
you do, try deleting them.
Dave
For some reason, that got me excited. But alas, the exceptions
continue with empty watch windows. :/

--m

Loading...