|
-
Jun 8th, 2012, 06:33 PM
#1
Thread Starter
Fanatic Member
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?
-
Jun 8th, 2012, 07:27 PM
#2
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.
- Coding Examples:
- Features:
- Online Games:
- Compiled Games:
-
Jun 8th, 2012, 07:46 PM
#3
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
-
Jun 8th, 2012, 07:49 PM
#4
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.
My usual boring signature: Nothing
 
-
Jun 8th, 2012, 07:51 PM
#5
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).
My usual boring signature: Nothing
 
-
Jun 8th, 2012, 08:40 PM
#6
Thread Starter
Fanatic Member
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).
-
Jun 8th, 2012, 08:41 PM
#7
Re: Intentionally make a program stop responding.
that makes it much more difficult
- Coding Examples:
- Features:
- Online Games:
- Compiled Games:
-
Jun 8th, 2012, 09:20 PM
#8
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.
-
Jun 8th, 2012, 09:25 PM
#9
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
-
Jun 9th, 2012, 01:27 AM
#10
Re: Intentionally make a program stop responding.
 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
-
Jun 9th, 2012, 03:52 PM
#11
Thread Starter
Fanatic Member
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|