Quantcast
Channel: VBForums
Viewing all articles
Browse latest Browse all 14989

How to diagnose a crash - apparent incorrect asynchronous behavior?

$
0
0
Hi ... this may be a bit general, I'm afraid, but I'm struggling to work out how best to describe what the problem is!

We have an app which from time to time hangs. We are tabbing into a text box and then tabbing out. As we pass through it, we are making a simple ado call to lookup/validate some data in a text box. As part of the correct program running we are logging

"Opening Dataset: SELECT ... FROM ... "
"Opened Dataset"

Between these 2 log statements are simple ado opening code with which we have had no problems previously. Most importantly is that between these 2 log statements there is no DoEvents or api call which would yield control. As far as we can see, it should be purely synchronous.

When the system crashes, which happens sporadically, we can see other logging statements appear between these 2 which can be either resource status (e.g. how much memory, gdi/user objects - which would usually be found because a timer has triggered in the main form) or focus type events - which aren't timer driven - at least in our codebase.

"Opening Dataset: SELECT ... FROM ... "
"Resource Status: ..."
"Opened Dataset"

or

"Opening Dataset: SELECT ... FROM ... "
"TextItem.OnLostFocus Item1 ..."
"TextItem.Validate ..."
"TextItem.OnGotFocus Item2 ...
"Opened Dataset"

So my initial question is, in what scenario can what should be a synchronous operation be interrupted and appear to act asynchronously.

For example, and we aren't doing this, I could imagine writing some unsafe code whereby by using a multimedia timer and supplying an AddressOf parameter to the address of a function on one of our modules, that that timer initiates execution of our code, separate to the correct control flow. Other than something like that, I just can't see how synchronous vb6 code could be interrupted in this way.

I'd be really grateful of any thoughts, suggestions or advice. I'm really sorry if this is soo vague. It perhaps reflects how I'm struggling to get my head round this problem.

TIA

Viewing all articles
Browse latest Browse all 14989

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>