Link to home
Start Free TrialLog in
Avatar of justchat_1
justchat_1

asked on

Recovering a frozen process

In a previous question I learned how to detect a frozen process:
https://www.experts-exchange.com/questions/21910881/Detect-Hanging-Process.html

Now the question is can I do something about it... is there any way to unfreeze the process or do I have to terminate it?
Avatar of Mark_FreeSoftware
Mark_FreeSoftware
Flag of Netherlands image


depends,

if it is your process,
and you know the cause of the hanging,
maybey you can do somthing about it,

else you are out of luck
Avatar of justchat_1
justchat_1

ASKER

there are no windows messages I can send to break execution?  How would something like norton crashguard work?
if its already crashed I dont think the messages will do anything, it is also up to the programmer of that application hwo these messages are handled
Thats not the case-the program is stuck in an infinite loop and is freezing up (but still running)... Norton crash guard has a way to kick the program out of the loop-does anyone know how?

i think it requires some real low-level coding

you can't do that in one day in vb
Are there any dll's that could do this or links with more information?
ASKER CERTIFIED SOLUTION
Avatar of Mark_FreeSoftware
Mark_FreeSoftware
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thats a big help...ill look into that!!

If any other experts have opinions or code feel free to post...
the above can only work if the Process is started by your own program, just by attaching you still cannot write to the problem program' memory (can you?)
good question... I know that most program memory is read/execute only and I remember something about a way to change memory permissions but I dont remember if thats only for your own memory space or for other programs as well?

the above can only work if the Process is started by your own program, just by attaching you still cannot write to the problem program' memory (can you?)

it is possible,
i did it even without pausing the code!
but this is VERY dangerous, because the program can crash

Dangerous until figured out or always dangerous?

dangerous if the code is executing near that point

imagine this:

the program is executing some long instruction (say6 bytes)
at the same time you change one (or more) of those bytes

weird things can happen,
bluescreen,
total lockup,
nothing,
program just crashes,
etc
So it really depends on what code I break out of?
well yeah unofficially you can have ASM code injections but those are like really dodgy practices
I know there is something like this but only for Windows Vista (http://msdn.microsoft.com/library/en-us/recovery/recovery/registerapplicationrestart.asp)
I don't know of anything for 2000 or XP, The typical idea is if the application is hung you should check again a couple more times to make sure. if its hung you should first try to send WM_CLOSE, if this does not respond then you must terminate the process. This is what windows XP does when an application is hung. You might recall the dialog (send) (dont send) error. However since you know what application is hung the best you could probrably do is allow the user to restart the process since you know the path this wouldn't be a problem.
good link...its a shame thats not around yet

the restart idea isnt a bad one but what about applications that are working with unsaved data?
Also, how do I know if they were started with parameters (cause I would probably need to include them again)?

>>the restart idea isnt a bad one but what about applications that are working with unsaved data?

they lose it, except if they have some emergency save built in (like ms word)


as far as i know, there are 2 different ways,
by code injection (that is what process explorer of sysinternals does)
and there seems to be an undocumented api way

too bad i cannot find the article that described this,
(still looking)
What would sending a system hibernating message do to a process?? (just to the process, not global)
Not what I was looking for but definitely valuable info..

thanks for the points, and happy coding!



too bad you could find what you were looking for...
what im looking for is probably not possible :)