Detect / Configure for Application hangs in vista
Hi forum.
THIS IS NOT RELATED TO VC++ programming directly ....
The issue I have is that our application is hanging in some vista machines in customer sites that we do not have access to those machines.
we are unable to reproduce those problems in any of our vista machines as well ..
QUESTION :
Somewhere related to some windows API's discussion people were mentioning that there are settings in vista that handles the automatic closing of threads differently ...
Its this that could be one reason why applications hang in vista machines while using legacy APIs
Is anyone aware of these settings ??? so that I can ask the customer to change these settings and see if the hangs have reduced ..... Converse ... I can enable these settings in our vista machines and reproduce those hangs that can help us sort out vista related issues better ?
I think probhably some registry settings that would restrict vista in closing threads or freeing memory etc .... i dont know.
Thanks in anticipation.
Re: Detect / Configure for Application hangs in vista
Does it hang every time in the same place or in random ones?
What type of application is it?
Re: Detect / Configure for Application hangs in vista
Hi victor .....
Thanks for the reply..
Our application shows hangs at random times and at random calls .......... at one time the crash dump would show image related operation, we fixed that ....... and now its showing the code where HTML help is being displayed ........
I am sure that once we fix this ... (although there arent any errors we would still check for safe inputs / outputs etc) I am sure that it will fail somwwhere ...
Some Brief about our application:-
Its a legacy code that has to do with databases and its a tool for creating applications as well ..... the API calls are so old that some of them are even 16 Bit calls ...... ( like GLobalFlags GlobalUnlock etc) .............. revamping those is not possible right now ......although we have kept it on pipeline.
Our management tune ........ if it ain't breaking .... do not touch it :)
Issue:
Unfortunately this is happening only for one customer and only on their Vista Platforms .. not windows 7 .... not XP ...... and very random .......... the only common factor AppHangB1.
More challenging is the fact that we are not able to reproduce any of those problems in any of our vista systems ......... nor have any other customers reported the same on vista as well ...
Hope I am clear enough.
Re: Detect / Configure for Application hangs in vista
What if you try to run your application in some compatibility mode (say, WnXP or Win2000)?
Re: Detect / Configure for Application hangs in vista
Since we do not face this issue here, we havent tried ..... we havent asked the customers as well .......
But we would be keen on reproducing and fixing the issues related to vista ...
Re: Detect / Configure for Application hangs in vista
Quote:
Originally Posted by
softmessager
Hi victor .....
Thanks for the reply..
Our application shows hangs at random times and at random calls ..........
1) It could be as simple as improper heap or pointer management. When you write code that corrupts the heap, anything can happen including seeming to work properly. You have this unlucky customer where the bug shows up.
2) If your application is multithreaded, improper or inadequate usage of synchronization objects (semaphore, mutex, critical sections) will also cause random crashes.
3) Going back to being simple -- an application that doesn't check for bad return codes for all API function calls, and instead proceeds to go on as if the API function returned "OK" is a candidate for acting wildly.
Nothing that what you've stated seems odd. An application that has any of these situations I've mentioned will run erratically.
Regards,
Paul Mckenzie
Re: Detect / Configure for Application hangs in vista
Hi paul
Thanks for the responses
Actually I am keen on knowing if there are any settings in vista that can add / relax restrictions ...
For E.g.
Enabling UAC can put restrictions on system related operations, force user confirmations or some system related APIs may fail due to lack of permissions ........
So something like those restrictions that we can enable in vista .. maybe some registry keys that would put restrictions on automatic thread closures , or memory management etc ...
We are waiting to see if we can reproduce the same problem here, by putting those restrictions ...
Thanks for your responses once again.
Re: Detect / Configure for Application hangs in vista
Quote:
Originally Posted by
softmessager
Hi paul
Thanks for the responses
Actually I am keen on knowing if there are any settings in vista that can add / relax restrictions ...
For E.g.
Enabling UAC can put restrictions on system related operations, force user confirmations or some system related APIs may fail due to lack of permissions ........
This goes back to my point 3 I made earlier.
If you're making system calls, and you are not checking return codes and assuming that things work, then in all honesty, that is not robust. This is especially the case if you're distributing your application to customers where you can't predict how their system is set up. The advice is simple -- fix your code so that you're making the proper checks for a failure.
Any application that is to be distributed to the public must assume that any API function can fail. For function calls, then it's either going to be a return code, or if it's more sophisticated (i.e. C++ based), then the documentation to the function(s) may specify that an exception is thrown and you're responsible for catching it if an error occurs.
I have had to work on applications where return codes were not checked, and customers would call saying that the app fails in some way. Fixing the code so that all return codes are checked revealed exactly what the issue was.
Quote:
So something like those restrictions that we can enable in vista .. maybe some registry keys that would put restrictions on automatic thread closures , or memory management etc ...
To be honest with you, that is too much work up front. You can easily start by checking your code to make sure it is doing as I stated above -- making sure that all function calls are checked for "failed" return codes, and if it is robust enough, log those failures. Then you send the updated app to the customer, expecting the failure to occur, but this time, you have more information.
Speaking of which, does your application do any type of logging? If not, then this is another issue -- start to produce logs of what has been done, functions being called, return codes, etc. In my experience, once this is done in an application, there is very little, if any reason to attempt to initially duplicate a customers problem yourself. If you had a log, you can tell easily what failed, and then you have more information as to what type of fix can be applied.
Regards,
Paul McKenzie
Re: Detect / Configure for Application hangs in vista
Quote:
Somewhere related to some windows API's discussion people were mentioning that there are settings in vista that handles the automatic closing of threads differently ...
Afraid I do not understand what 'automatic closing of threads' is.
Quote:
Actually I am keen on knowing if there are any settings in vista that can add / relax restrictions ...
I think you're looking in a wrong direction. It's very unlikely the OS makes your threads to hang due to some specifics. As Paul already pointed out, the hanging is most probably due to improper use of synchronization objects or blocking APIs. And the very first thing I'd do in the situation like this is taking a dump of the application in hanging state to see the threads' call stacks.