> Sorry... I realise that does look confusing. Yes, indeed it would
> crash - but it was never intended ot be executed. The whole point of
> that second line was to put a breakpoint ON it, so that the debugger
> would stop AT it if the condition was met, indicating that the
> corruption had occurred. It was just a handy variable to use to have a
> breakpoint line - it's not real code!
> {:v)
OK. Just wanted to make sure we're not missing anything in between.
> This is it, nothing removed in between.
Good. But I asked you to post the asm if possible. Otherwide we wouldn't
be able to tell if the compiler is generating bad code or the problem lies
elsewhere.
> I'm not quite sure how this would help - could you explain?
Sure. When you call a function, the compiler pushes its arguments on the
stack (usually; it can optimize them to be passed via registers and/or dump
them.) If you've got a stack corruption, the data on the stack is modified
when it's not supposed to be, so if you add a dummy char array around where
the problem occurs, it's likely that that array gets corrupted instead of
your real vars. One technique to find a stack corruption is using those
arrays, and writing some random (but known) data to it, and then check them
later on for modifications. VC7+ has an option to automate the generation
of this code.
> I can confirm that it does not stop the problem.
Well, it's highly unlikely that the compiler just optimizes the whole array
away since you're not using it. You can check it by looking at the asm.
But now that I think of it, since the function parameters are pushed before
local arguments, the corruption (if it exists) might only affect the higher
parts of the stack, thus the char array may not help much. A char array in
the caller might, but why not take a look at the compiler generated code to
make sure it's right before going through all that pain?!
> I'm not sure whether I should woohoo! at that prospect, or throw a
> tantrum
> {;v)
Woohoo? What are you talking about? Hell will undoubtedly get freezed over
before you can get M$ to fix a bug in their compiler. The usual trend is
that either they tell you it's a feature, or they tell you that the bug is
non-critical, and shall not be considered for a fix before their VC 12.3
release schedule.
;-)
Seriously, if this is actually a compiler bug, then there are ways around
it, and you don't need to wait forever to get a fix from M$ fortunately!
> Actually, I'm unusually calm about it... I've come to accept that
> things rarely work out the way I planned, so I just keep chipping away
> at the pile of Life's little issues hoping one day to make a dent in
> it {;v)
Wow, that's a highly philosophical point of view which leaves something to
learn even for those guys who tag Nietzsche quotes at the bottom of their
sigs! :-)
-------------
Ehsan Akhgari
Farda Technology (http://www.farda-tech.com/)
List Owner: [email protected]
[ Email: [EMAIL PROTECTED] ]
[ WWW: http://www.beginthread.com/Ehsan ]
Physician, heal thyself: then you will also heal your patient. Let it be his
best cure to see with his eyes the man who heals himself.
-Thus Spoke Zarathustra, F. W. Nietzsche
_______________________________________________
msvc mailing list
[email protected]
See http://beginthread.com/mailman/listinfo/msvc_beginthread.com for
subscription changes, and list archive.