How to freeze or make an application hang to test a script?



I like to test this script
tell application "System Events" to set theApps to name of processes whose background only is false
repeat with oneApp in theApps
set pState to do shell script "/bin/ps -arxo state,comm | /usr/bin/grep " & oneApp & " | /usr/bin/cut -c 1"
if pState contains "Z" then -- if the application hangs, kill it
tell application "System Events" to set pid to the unix id of process appname as Unicode text
do shell script "/bin/kill " & pid
end if
-- delay 5 -- security delay
try
do shell script "open -a /Applications/Restart.app"
end try
end repeat
It is supposed to run from time to time on my server checking if a programme is hanging and if so quitting it and restarting it.
So does anybody know how one can get a programme to hang or crash? Did several experiments with Text Edit, but could not get it to crash. Interesting question though, as we are mostly concerned about crashes not happening.
Any ideas or suggestions are welcome. 

 Thanks

orangekay thanks
I tried that but did not work (might be my lack of skill), or might have done it wrong though, any suggestions as to how?

Similar Messages

  • Application hangs for few seconds

    I have problem since i have installed window 10 . It makes the application hangs for few seconds and then come back to normal .. what should i do

    Hard to believe, the problem is back!
    Everything worked just fine last night. This morning I turn the iMac on and the problems are back: Extremely long time to startup, application hangs, everything super slow.
    Any ideas?
    I restarted in verbose mode and took some pictures, in case that helps...
    http://gallery.me.com/cjanz#100008

  • Application hanging after commit issued, how to tell why?

    Hi All,
    We're using adf bc, jsp's and jdev 10.1.2.
    The scenario is this.. I have 2 views based on the same entity(called Milk). One view is the control view Milk i.e. straightforward select, no where clause. The other one is based on a join with another entity (Area), which uses where clause parameters to output a row of Milk for every entry on the Area entity. So basically for every area there is, a milk row will be output even if that row does not exist on the milk table.
    So my problem was when the user edited and saved a row which didn't actually exist on the database, the program would hang. Editing of rows that do exist pose no problem at all. So then I thought maybe I should create these rows first so that they would physically exist on the database before the edit. Still to no avail..
    If it's just one row created or many rows, once the commit is issued, the application hangs. I've debugged it and nothing happens once it executes the commit line, there are no error messages, it just never progresses past this line.
    I've tested with the App Module tester and I can create rows here fine. Obvisouly something is wrong or it wouldn't be happening. How can I tell why it's hanging? Or can anyone suggest what I can do. It is extremely crucial that I fix this soon so I would really appreciate any help that anyone can give me.
    Thanks in advance,
    Liz.

    Maybe you should look into
    /var/log/messages.log
    /var/log/daemon.log
    /var/log/kernel.log
    /var/log/Xorg.0.log will be overridden, afaik.
    Last edited by MadTux (2009-11-19 18:50:04)

  • How to find out the position in which an application hangs

    Hi,
    is there any possibility to find out the position in a source, in which a deployed application hangs?
    For example, there is an endless loop in an application, which is already deployed. In runtime the application hangs in this loop. How can I findout in which line the application hangs?
    In other words, how can I see the stack of a certain process,for example, http_workerx?
    Regards,
    Ali
    Message was edited by:
            Ali Maraschi-Schouschtari

    Hi Ali,
    With <b>SAP NetWeaver Composition Environment (CE) 7.1 SP3</b> it is very easy.
    <i>1.) Open the SAP Management Console
    2.) Go to AS Java Threads tree node - you will see all the threads that are currently started on the system
    3.) Check for threads that are colored in red - it takes about 30 sec the system to detect that an HTTP thread (http_workerx), as it is in your case, is hanging/executing endless loop.
    4.) Right click on the hanging thread (colored in red) and pick 'Callstack' from the pop-up menu
    5.) In the new window you will see the stack-trace showing what exactly this hanging thread is doing at the moment.</i>
    With the <b>previous versions (or SPs)</b> you need to apply a little bit more technical skills for the same result. <i>(1) you need to do produce thread dump of the server that is suspected to have hanging thread</i> and (<i>2) to analyze this thread dump (check what the threads in Running state are doing).</i> As it is in your case with the HTTP worker threads, their names are also printed in the thread dump, so you can focus only on them.

  • How can I make my application as webservice

    Hi All,
    I'd like to know ,how can I make my application as webservice which has built on strut framework.
    with regards
    Babu H

    I'm not quite sure what you mean by application, but you can not turn whole applications to webservices. What you can do easily is to turn your services, e.g. the public methods in your stateless session bean layer as web services. There is different ways to do this, but you might want to check out Axis (http://ws.apache.org/axis ), which is a OS tool for creating WS call stacks over existing objects.

  • How do you make an application open on a specific monitor?

    How do you make an application open on a specific monitor? I have two monitors, and I was able to get Firefox to open on the secondary display always by resizing it with the option or command key [I forget which one] and then quitting it. Now everytime I start it, it opens on the second monitor.
    However, when I try to do the same with QuickTime [when playing videos], it always opens on the primary display no matter what I do with it. How do I make it always open on the secondary display?
    Thanks in advance for any help!

    Thanks for the suggestion, but no, Spaces is not what I want. I have two physical monitors, and simply want an application to always open on one monitor, not be able to switch back and forth between different desktops.

  • How to make Forms6i Application Install Program?????

    How to make Forms6i Application Install Program?????
    We have finished a Forms6i Application , and need a installer to install software.
    Can I use Oracle installer or must use MS visual C++ to make a installer? I need wirte a register.
    Anything inclued in Form6i Production (IDS) to introduce installer???
    Thank you.

    How to make Forms6i Application Install Program?????
    We have finished a Forms6i Application , and need a installer to install software.
    Can I use Oracle installer or must use MS visual C++ to make a installer? I need wirte a register.
    Anything inclued in Form6i Production (IDS) to introduce installer???
    Thank you.

  • Photoshop Premire Elements crashing - application hang How do I fix this?

    Greetings, I have been having problems with my PSE 11 crashing when I try to open an image. I have tried several images even ones that I've worked on in the past. I've looked in the MS Event Viewer and it says: "Application hang". So, any thoughts on how I can fix this?
    I thank you in advance for any help that you can provide me. ~Susan

    "Well Susan, 25 people have looked at your question but no one has bothered to take the time to answer you. What do you think of that?" - Thanks for the help.......................................

  • How do I make an application the default?

      I installed Microsoft Office 2011.  I do not want to use Outlook for mail.  I want to use Apple Mac Mail.  Sometimes Outlook opens instead of Mail.  For instance if I click on an email link in Safari.  How do I stop this? 
      How do I make an application the default?  This would be the same as make a file type open with a default application in Windows.
      I hope someone can help.  I have looked in all the help files and not found the answer.
    Joe from Ohio

    Re setting a default app for email -
    Start up Mail. Open Mail's Preferences (Preferences in the Mail menu). Go to the General tab if it does not open with that chosen. First item in that screen, "Default email reader" - use the pulldown menu to select the app you wish to use. Then close the Preferences window and quit Mail.
    Re setting a default app for a given file type -
    Select a file of that type by clicking it once, then press Command-I (Get Info in File menu). Look down in the Get Info window to the section "Open with:" - use the pulldown menu there to select the app you wish to use for that file type, then click the "Change All..." button. From then on, double-clicking any file of that type should open it using the app you set.

  • Launchpad has disappeared from the Dock. Launchpad is present in Applications but refuses to activate. How to activate and make available in Dock? iMac 21.5 mid 2010. os X v10.7.2.

    Launchpad had disappeared from Dock. Launchpad is present in Applications but refuses to activate. How to activate and make available in Dock?
    iMac 21.5 mid 2010. os x v10.7.2.

    You should be able to put Launchpad back in the Dock by dragging it from the Applications folder to the left section of the Dock.  As to why it won't launch, run the Console utility, try to run Launchpad, and see if any messages appear in the Console window.

  • How i can make web application by using oracle form6i

    how i can make web application by using oracle form 6i , indetail .
    A.R

    indetail .As Andy Millman might observe, you're having a laugh. This is a big topic, far exceeding what it is reasonable to expect people to help out with in a Forum. Do you not have the 6i documentation?
    OTN has a site for upgarding to web forms. Although it is mainly focussed on moving to 9i/10g a lot of the issues and solutions apply to moving a 6i client/server app to web deployment. For further help there is a Forms.
    Cheers, APC

  • How i can make multilanguage application .. take his vlues from database

    How i can make multilanguage application .. take his values from database
    and can change labels of massages , buttons ,text fields and name of columns in run time
    in jdevelpoer11g
    great thank

    Hi,
       I think that there is not a standard support for retrieving multilanguage texts from database in ADF. What we did is to implement our own ResourceBundle that retrieves the translated text from custom database tables. We also introduced a cache for optimizing the access to the translations.
    I hope this can help,
    Juanjo

  • How to make the application offline

    I have X7 phone and each day the amount of my pulse is decreasing. the internet is working but I didnt use it. How can I make the application become offline and not receiving updates. I already set my widgets to offline mode but it still like that. need your help

    go to settings menu...then connectivity...then settings...set "Data use in home country " to always ask....so next time whenever any app would try to connect to internet then it would ask you to either cancel it or other options like  "connect automatically" or "connect this time only" 
    If you want that your phone should only use your home wifi only then set "Data use in home country" to WLAN only

  • How to make Trusted Application

    Hello 2 all
    I want to know how to make trusted application on mobile..?
    Waiting for reply..
    Jignesh

    Hi,
    http://developers.sun.com/techtopics/mobility/midp/articles/permissions/

  • How to make client application

    hi....
    help me...^ ^ how to make client application(not standalone..)
    I seached bea document.. but I can't it.
    if someone have sample(.ear or .jar), I hope you it share...

    Hi
    Client Application can be any Java class, JSP etc which is a part of multi
    tier architecture which accepts input from Client and directs request to the
    middle tier for processing. You can refer to
    http://e-docs.bea.com/wls/docs61/jsp/index.html
    for building jsp's as Client application.
    Regards
    johny
    "kyungmoon" <[email protected]> wrote in message
    news:3c4f571d$[email protected]..
    >
    hi....
    help me...^ ^ how to make client application(not standalone..)
    I seached bea document.. but I can't it.
    if someone have sample(.ear or .jar), I hope you it share...

Maybe you are looking for

  • Cannot Open Attachments in Foxfire but OK in Internet Explorer

    I cannot open any attachments in Foxifre but do not have problem at all in Internet Explorer. I have reset cookies and cache already, to no avail. == URL of affected sites == http://

  • IPhone 4 Update on iTunes Throws Error Code....

    Now my phone shows a USB pointing to iTunes.  Phone doesn't get past this and it is not being recognized in iTunes.  Any ideas???

  • Changing the keyboard increment when...

    I would like to change the keyboard increment when attmpting to increase/decrease the size of an image using command-option-< and > Currently it jumps in the oddest incrememnt, not even a whole number. Increasing the size from 100% makes the result 1

  • Shockwave Flash ActiveX reference?

    Hello. I am trying to embed the Shockwave Flash ActiveX object into my C++ application. I am having a hard time finding the official reference documentation for the interfaces. Does anyone have a link on hand? Thank you for your help!

  • Mutilple calls in one transaction - what's the best way?

    I need a session bean to perform following functionality (rought each one corresponds to a method) - update customer profile (name, address, etc., they are in one table) - update customer's services - update customer's phone book (they are in separat