Intentionally make a program stop responding.
I am making a process monitoring program for his game server. Occasionally, the programs stop responding.
I've used the if process.responding then process.kill la de da, but its not working right.
Is there a debugging tool out there i could use to intentionally make a program stop responding?
Re: Intentionally make a program stop responding.
you could use the BlockInput api function:
vb Code:
Private Declare Function apiBlockInput Lib "user32" Alias "BlockInput" (ByVal fBlockIt As Boolean) As Boolean
the only problem is it doesn't just block input for your app.
Re: Intentionally make a program stop responding.
Just write a simple little program that hangs for a while
Something like this should do it
Code:
Private Sub btnHang_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnHang.Click
Dim Started As Date = TimeOfDay
While 1 < 2
If TimeOfDay > DateAdd(DateInterval.Minute, 5, Started) Then
Exit While
End If
End While
End Sub
After 5 minutes it will start responding again
Re: Intentionally make a program stop responding.
If you are threading, you could cause an intentional deadlock. Have two Mutex objects. Two threads start. The first thread grabs the first Mutex then Sleeps for half a second and tries to get the second Mutex. The second thread grabs the second Mutex, sleeps for half a second, then tries to get the first Mutex. That should cause a guaranteed deadlock, which will lock the program up completely.
Re: Intentionally make a program stop responding.
I considered the loop proposed by DataMiser, but it will do things other than just locking up, because it will also max out your CPU. The deadlock approach will take no CPU time, though it is more complicated (and won't end, which is a nice feature of the loop DM suggested).
Re: Intentionally make a program stop responding.
The program i am trying to make stop responding is not developed by me (it's a dedicated serve exe).
Re: Intentionally make a program stop responding.
that makes it much more difficult
Re: Intentionally make a program stop responding.
I thought you were trying to find a way to test your processing monitoring software. If you are trying to cause the gameserver to lock then you would almost have to know what is causing it to lock now and then reproduce that.
Re: Intentionally make a program stop responding.
Just because an app stops responding doesn't mean its locked up. It could mean that it is so busy that it can't respond to requests to update the ui
-tg
Re: Intentionally make a program stop responding.
Quote:
Originally Posted by
techgnome
Just because an app stops responding doesn't mean its locked up. It could mean that it is so busy that it can't respond to requests to update the ui
-tg
no it just means it's running an intensive process on the interface thread...
if you have a process hungry function you should look @ putting it in a non-interface thread.
Kris
Re: Intentionally make a program stop responding.
Ya, i guess i'll just make a dummy app that locks up for testing.
I was just curious if there was a debug tool that would literally lock up an app to make it stop responding.