Shutting down rogue threads: impossible?

While designing a system that accepts 'plugins' that are sent by untrusted users, I ran across this problem:
Imagine a malicious user intentionally sends this plugin:
public void init()
int[][] a = new int[123456][10]; //allocate tons of memory.
while ( true ) ; //waste tons of CPU cycles.
I want to 'defend' against this kind of thing, whether done intentionally or not.
So far, I have found out the following things:
A) There is no java-based profiler information. In other words, there is no such thing as a thread.getCpuLoad() kind of method. There is the JVMPI, so for now I guess I'll write various JNI libraries that will make the JVMPI interface callable from java.
B) Even if the thread is identified, there is no way at all to destroy it. Thread.destroy() is unimplemented (returns NoSuchMethodError). Thread.suspend() still works, eventhough it is deprecated, and will stop a thread when doing something like while ( true ) ;. However, I have not found a way of reclaiming any allocated memory. Removing all references to the thread object and then running the garbage collector didn't help.
C) There does not appear to be any thread kill functionality in JVMPI, though I might have missed something.
D) There does not appear to be a relatively simple way to start up a new 'lite' JVM to run the untrusted code in. Starting up an entire new java executable through Runtime.getRuntime.process() might work, but the endgoal is to get tons of these little plugins running in their own threads. One JVM can actually handle this admirably, but I doubt one system can handle 70 to 80 concurrent JVMs.
leading me to the conclusion:
There is no way to really 'sandbox' untrusted code. Even if you can prevent them from opening files and such, they can perform a DoS attack bij allocating large amounts of memory and getting stuck in while ( true ) ; loops. Even if this behaviour is detected, there is no way to guard against it happening aside from suspending the thread and accepting the memory as unreclaimable until the JVM is restarted.
I really hope there is a better solution than suspending and writing off the used memory, but if there is no way to really kill a thread, perhaps this can be worked on ASAP for the next release? destroy() exists. It needs implementation.
Incidentally, there is no risk here of contaminating the state or causing deadlocks due to monitors being locked 'forever', as each such 'plugin' uses its own loader and cannot exchange data between the main system or any other plugin, except through serialized/deserialized stuff. While I understand the dangers of just cutting threads off, in this case, I have already taken precautions that one 'plugin' can't mess in any way with another.
I did a 'test run' and wrote exactly such an applet. While it didn't hang the web-browser (Opera), it did cause Opera to use up all free CPU cycles, and there was no way to stop Opera from using up all CPU (or reclaiming the memory), short of completely exiting the browser.
Didn't test with IE, or netscape.
(That's Opera using JDK1.4 as JVM).
I could of course be mistaken in all this and completely missed a way to completely kill an unresponsive thread, so I am hopefully awaiting corrections.
--Reinier Zwitserloot.

Weird.
rogueThread.stop();
rogueThread = null;
System.gc();
drops CPU use down to 0, and reduces the memory footprint back down to the original minimum. In other words, seems to do all the required functionality.
I got the impression from the documentation explaining why stop/suspend/resume are deprecated that it wouldn't work unless the Thread was stuck in some kind of IO blocking call.
Thanks a bunch!
NB: Would anybody know of a code sample which won't respond to a stop and/or suspend? this quote from the deprecation explanation has me worried:
"It should be noted that in all situations where a waiting thread doesn't respond to Thread.interrupt, it wouldn't respond to Thread.stop either."

Similar Messages

  • Weblogic Server Shutting down execute threads

    Weblogic 5.1 SP9 on Solaris.
    After upgrading to SP9 from SP8 we are observing a new message in our log during
    the START UP PROCESS. It seems that after performing a GC and during the creation
    of the connection pools we are receiving a message "Shutting down execute threads".
    Though Weblogic starts up ok after this and performs ok we are still concerned
    on what execute threads are shutting down?
    Any help in an explanation would be appreciated.
    <I> <GC> GC: After free/total=505281560/531955712 (94%)
    GC: After free/total=505281560/531955712 (94%)Wed Aug 08 18:08:33 EDT 2001:<I> <WebLogicServer> Shutting down execute threads
    Wed Aug 08 18:08:33 EDT 2001:<I> <WebLogicServer> Shutdown completed
    Wed Aug 08 18:08:33 EDT 2001:<I> <WebLogicServer> Shutdown completed

    could you post complete the log file
    right from the server startup to until WLS
    listens on http & SSL ports?
    Kumar
    Andy wrote:
    Weblogic 5.1 SP9 on Solaris.
    After upgrading to SP9 from SP8 we are observing a new message in our log during
    the START UP PROCESS. It seems that after performing a GC and during the creation
    of the connection pools we are receiving a message "Shutting down execute threads".
    Though Weblogic starts up ok after this and performs ok we are still concerned
    on what execute threads are shutting down?
    Any help in an explanation would be appreciated.
    <I> <GC> GC: After free/total=505281560/531955712 (94%)
    GC: After free/total=505281560/531955712 (94%)Wed Aug 08 18:08:33 EDT 2001:<I> <WebLogicServer> Shutting down execute threads
    Wed Aug 08 18:08:33 EDT 2001:<I> <WebLogicServer> Shutdown completed
    Wed Aug 08 18:08:33 EDT 2001:<I> <WebLogicServer> Shutdown completed

  • Shutting down a thread

    I'm just wondering... I've been working on a project for some time now, but it has become rather important now that I be able to shutdown the program rather quickly when desired. The problem, however, is that my main class is a thread that runs on a loop similar to...
    ServerSocket server = New ServerSocket(5000);
    while (shouldRun==true) {
    Socket connection=server.acceptAnd so when I enter a shutdown command (in a different thread):
    shouldRun=false;
    mainThread.interrupt();However, it seems to me that interrupting the thread doesn't occur immediately, and in fact in many cases, the program will not shut down until I initiate another connection - at which point it closes immediately. I'm just wondering if there's a way to immediately close down a thread or program, as I know Thread.stop(); is deprecated.
    Ultimately, however, if I am forced to go this road, it wouldn't be the end of the world if the thread didn't close down nicely, but rather abruptly ended (as if I killed the process in Unix manually, which is what I've been doing). I do, after all, save all my information before initiating shutdown procedures... Of course, it would be good if it shutdown nicely, if at all possible, but either way is acceptable so long as it shuts down.
    Any suggestions?
    (If, for example, there was a way to test if a connection had been requested without locking the thread UNTIL one was requested, that would solve the problem entirely, as I could run my main thread on a loop every two seconds, for example, test if there was a connection, and quit if a shutdown was requested. - I don't know if there is a way to do that, however. Or perhaps if a new connection could notify a sleeping thread without devoting a thread to solely listening for connections? then I could wake the thread up when I wanted to shutdown. That seems even less likely, however...)
    Let me know if any more explanation is needed, I've tried to be as clear as possible.
    In any case, Thanks in advance,
    -Jess

    Hmm... I could have sworn that was the first thing I tried... perhaps I'm halucinating. Oh well, thanks for your help.

  • Skype shutting down, and then impossible to restar...

    So i was just watching some youtube, when i uddenly heard my skype shutting down. When i tried to restart it, it didn't recocnice my password. I changed my password and i got an I/O error (whatever that is), i then tried to uninstall skype and reinstall and now i can't download it without getting a code 1603 error. any idead as to how i fix this?

    Try to re-install Skype using this msi-installer for the currently latest 6.21.0.104 version:
    http://download.skype.com/msi/SkypeSetup_6.21.0.104.msi
    Make note of any error message received when installing Skype.

  • Shutting down Rogue APs

    Besides simply classifying devices as rogues, is there a way to shut them down or overwhelm them with deauthentication or disaccociation floods, something of the sort?

    You can contain the rogue, but then you can get in trouble for that since it is a DoS attack. 
    Thanks,
    Scott
    Help out other by using the rating system and marking answered questions as "Answered"

  • Thread problems - shutting down.

    Okay, I've got my multi-threaded server program working just fine and all is well...until I shut down the server.
    By some quirky twist of fate, java chat servers seem to be a popular education assignment in the last two weeks, which will probably put some people off answering this simply because of all the clueless posts on the subject recently. :)
    Anyway, a little background on how I'm doing things first.
    At the top there is the Server object, which is implementing Runnable. This instances the ClientManager, creates the ServerSocket and then kicks off its own thread and loops in the run() method waiting for connections while a boolean is true. If it gets a connection it calls the ClientManager addConnection() method and passes it the received client socket.
    The ClientManager holds a List of ClientConnections and provides methods to add and remove ClientConnections. The ClientManager also runs in its own thread by implementing the Runnable interface and uses its run() method to loop through checking for incoming messages from each client.
    A ClientConnection object also runs in its own thread via the Runnable interface. This checks for incoming messages from the client and stores the String ready to be received by the ClientManager and broadcast to all ClientConnections.
    So, you've got the Server running in its own thread, the ClientManager running in its own thread and the ClientManager maintaining a List of ClientConnections, each running in its own thread.
    I'm starting my threads like this:-
    // Constructor.
    Public SomeObject() {
        start();
    // Runnable method.
    Public void start() {
        // threadObject is private class variable.
        bThreadActive = true;
        this.threadObject = new Thread(this);
        threadObject.setDaemon(true);
        threadObject.start();
    }I'm running my threadded object like this: -
    Public void run() {
        do {
            // Do work here.
        } while(bThreadActive);
        // Activates the shutdown method for this object.
        shutdownObject();
    }I'm shutting down my threads like this: -
    Public void shutdown() {
        this.bThreadActive = false;
    // The main shutdown code.
    Public void shutdownObject() {
        // Kill thread object.
        this.threadObject = null;
        // Do other stuff.
    }Which I think should work fine. Anything wrong with the above?
    I'm getting problems with NullPointerExceptions with the Server object at the point where it tries to shutdown the ClientManager. This works by shutting down all ClientConnections in the List first and then emptying the List before killing its own thread. Also, the Server object seems to shutdown before the ClientManager. And other such weirdness.
    I know you're all going to ask for specific code and a stacktrace, which I'll provide....I just want to check that my method for using threads as above is correct first, so I can rule that out - mostly because I suspect I'm missing some vital piece of knowledge on using threads....things are not working as I expect.
    Anyway, a quick answer on the above and then I'll start posting more specific info.
    Thanks all :)

    Ooops....my mistake. I was calling shutdown() twice. Once from the GUI code and automatically from after the loop in the run() method. Funny how the stacktrace doesn't drill down any further than the method that makes this call.
    Okay, its almost all working perfectly, except for this part....
        //  Start accepting client connections from the server service.
        public void run() {
             while(bThreadActive) {
                 if (sockServer != null) {
                     if (!sockServer.isClosed()) {
                         try {
                             sockClient = sockServer.accept();
                             if (sockClient != null) {
                                 this.clientManager.addClientConnection(sockClient);
                                 this.pOutput.printOutput("Connection accepted from: " + sockClient.getInetAddress().getHostAddress());
                         } catch (IOException ioe) {
                             if (bThreadActive) {
                                 this.pOutput.printOutput("ERROR: Could not accept incoming client connection");
                         } catch (NullPointerException npe) {
                             // Leave this for now.
             shutdown();
        // Shutdown the server service and disconnect all client connections.
        public void shutdown() {
            try {
                clientManager.stopThread();
                sockServer.close();
                threadServer = null;
            } catch (NullPointerException npe) {
                npe.printStackTrace();
            } catch (IOException ioe) {
                pOutput.printOutput("ERROR: Could not cleanly shutdown the server socket");
            pOutput.printOutput("Server service shut down successfully");
        // Stop the server thread (automatically shuts down).
        public synchronized void stopThread() {
            bThreadActive = false;
        }When I call the above like this from the GUI object...
        // Stop the server.
        private void stopServer() {
             try {
                  server.stopThread();
                  setGUIMode(MODE_DISCONNECTED);
             } catch (NullPointerException npe) {
                  npe.printStackTrace();
        }...the string "Server service shut down successfully" from the completion of the shutdown() method never appears, so it looks as though its not executing.
    But if I do this instead in the stopServer() method and remove the shutdown() call in the run() method, it works......but I get two (sometimes three) outputs of "Server service shut down successfully" which makes me think its being run twice somehow.....once before the ClientManager has been shutdown and once after or twice after.
    Server service shut down successfully
    Shutting down Client Manager...
    All client connections disconnected
    Client Manager successfully shutdown
    Server service shut down successfully
    Server service shut down successfully
    Any ideas?

  • JNI native threads causing JRE to fail to shut down?

    Hello,
    I am using JNI to communicate with a COM object. I am reasonably certain at this point that my JNI code is handling this properly and the third party COM library is releasing the object in question. We allocate and release hundreds of these objects and we aren't observing any memory leaks. Likewise in our handling of events we receive from the COM object. We attach the thread to Java, deliver the event, and then detach the thread from Java, with very careful error handling around the event delivery to ensure that whatever else happens the detach gets called. This code is very robust and stable in operation and has been working at load in the field for over a year now without any customer problems in the JNI area.
    However, since day one, when I go to shut down the application, the JNI isn't winding down properly. As it happens, since the JRE is running a Tomcat, driven by a wrapper service, the wrapper eventually gives up waiting and shoots the JRE in the head, but the user experience of stopping the wrapper service is ugly and we'd like to clean that up. The JNI code, of course, runs as shared code in the Tomcat.
    It is possible that the third-party library, which does network communications, is keeping a thread pool for use with any of the COM objects even after all COM objects are released. This would be experienced as a one-time hit when the first object is allocated and not as a continual leak, so we'd be unlikely to notice it otherwise.
    Will native non-Java threads running in the JRE but not allocated by the JRE itself cause the JRE to hang on until they've spontaneously decided to clean themselves up? Threads that have never been attached to the JVM? How about threads that were briefly attached to the JVM but then detached? Any worse?
    Ralph

    Hi Ralph,
    I will need some more information regarding this issue.
    1. What platform are you on?
    2. Which JRockit version are you running?
    3. If you remove the wrapper service, does JRockit freeze without exiting properly?
    As a general recommendation I would try to upgrade to the latest JRockit version. It can be downloaded from the OTN http://www.oracle.com/technology/software/products/jrockit/index.html
    You may also try some verbose printouts to debug the issue a little further. Try
    -Xverbose:thread=debug,jni=debug
    This might give us some more insight in what is going on.
    Also when JRockit freezes you can output a Java stack trace using our 'jrcmd' tool which you can find in the same folder as the java executable. Run this tool without any parameters and it will output identifiers (numbers) for every running JRockit instance on your machine. Run the same tool again, this time append the identifier you believe is the one running the Tomcat and add the command 'print_threads', ie
    jrcmd <some_id_here> print_threads
    This may show what JRockit is waiting for.
    Cheers,
    /Henrik

  • Impossible to shut down iTunes

    Its impossible to stop iTunes, not even when I force iTunes to do so. So I cannot shut down my Mac (Lion)  in a normal way and have to use the startbutton to close down. What to do?
    (once in a while iTunes does what I want but that is indeed once in a while)

    Please read the warranty paperwork that came w/your computer.
    You have 14 days to return the computer w/no questions asked.
    You have 90 days of FREE phone tech support on top of your standard 1 year warranty unless you also purchased AppleCare which gives you an additional 2 years of coverage plus FREE phone support.
    Strongly suggest that you take FULL advantage of the above before it runs out.  Let Apple deal w/the problems & your concerns. It's what you paid them to do.

  • Rogue video email shuts down Apple Mail, cannot delete

    I received a video email from a friend that shuts down Apple Mail within a few seconds of opening. The delete button is grayed out and I am unable to delete. I deleted it from web-based mail, but it still opens with Apple Mail--then shuts down the application. I have shut down the computer and logged off repeatedly, to no avail. (I am also afraid my mailboxes have been emptied--apart from the rogue email.) Have I lost Apple Mail on this computer forever? Can anyone help?

    I received a video email from a friend that shuts down Apple Mail within a few seconds of opening. The delete button is grayed out and I am unable to delete. I deleted it from web-based mail, but it still opens with Apple Mail--then shuts down the application. I have shut down the computer and logged off repeatedly, to no avail. (I am also afraid my mailboxes have been emptied--apart from the rogue email.) Have I lost Apple Mail on this computer forever? Can anyone help?

  • Child process admin thread is shutting down.

    Hi,
    Operating on a web server with the following error message, Child Process is a phenomenon that restart.
    I would like to know what the cause.
    Version - Sun Java System Web Server 6.1
    errors
    [09/Nov/2011:12:31:00] catastrophe ( 7647): Server crash detected (signal SIGBUS)
    [09/Nov/2011:12:31:00] info ( 7647): Crash occurred in NSAPI SAF flex-log
    [09/Nov/2011:12:31:00] info ( 7647): Crash occurred in function flex_init from module /netscape/servers/bin/https/lib/libns-httpd40.so
    [09/Nov/2011:12:31:00] failure (16223): Child process admin thread is shutting down
    [09/Nov/2011:13:42:06] catastrophe (16514): Server crash detected (signal SIGSEGV)
    [09/Nov/2011:13:42:06] info (16514): Crash occurred in NSAPI SAF flex-log
    [09/Nov/2011:13:42:06] info (16514): Crash occurred in function flex_init from module /netscape/servers/bin/https/lib/libns-httpd40.so
    [09/Nov/2011:13:42:06] failure (16223): Child process admin thread is shutting down
    Edited by: 896618 on 2011. 11. 10 오후 9:21

    thanks for the response chris. in answer to your questions - no there are no NSAPI plugins installed and we are getting zero helpful output from the log files.
    /server-root/logs/errors is the only log file that has relevant output at the time of the crashes. our own application logs and the sytem's syslogs have nothing relevant at those times.
    the o/p from the errors log is basically :
    [19/Dec/2002:02:05:39] config ( 5815): [GC
    [19/Dec/2002:02:05:39] config ( 5815): 154915K->129640K(249216K)
    [19/Dec/2002:02:05:39] config ( 5815): , 0.0299277 secs]
    [19/Dec/2002:02:05:39] config ( 5815):
    [19/Dec/2002:02:05:59] failure ( 5814): Child process admin thread is shutting down
    at which point it resets itself. we have a load balanced system and the resets aren't noticed at the front end but i'm beginning to tear my hair out.
    We have the exact same s/w configuration on 2 x Netra T1s and they've been running fine for over a year. We have 2 brand spanking new Fire V100s & the only significant h/w difference between the machines being L2 cache (512k v 2Mb). i would've thought that a bottleneck would throw up errors all over the place and result in a noticeably slower system which isn't the case.
    our next step is to throw in an extra 512Mb RAM and see does that increase the time between resets - currently 24-36hrs. i have a niggling suspicion it may be memory related.
    any other ideas?

  • IPlanet 6.1-SP6 auto re-starting with Child admin thread shutting down

    We are running the same application everywhere without any issues. Just migrated to new machine/environment and whenever the client (browser) tries to acess a JSP, the web-server automatically re-starts itself with message Child admin thread is shutting down.
    We are using Solaris OS 9, with Sun Cluster 3.1, JDK both 1.3.1_04 and 1.4.2_06.
    Any help will be highly appreciated.

    Issue is resolved, there was an issue with classpath settings in jvm12.conf

  • Shutting down a panel in one thread from another thread.

    For various reasons, I have a program with two threads (actually more than two, but only two are concerned here). One is the main panel that runs at startup, another is a Virtual O'Scope panel with a real-time display. Everything works more or less well, until it's time to exit the program.
    The main program starts by calling a routine to display the VO'scope; this routine calls CmtScheduleThreadPoolFunctionAdv to schedule the VOscope thread with the function VOscopePanelMain.
    VOscopePanelMain initializes things, displays the VOscope panel, and then calls RunUserInterface(); to process events in the VOscope panel.
    When it comes time to close the window, closing the panel (the X box in the upper right corner) triggers the panel callback CB_VoscopePanel, which processes the EVENT_CLOSE: event by calling QuitUserInterface(0); which, in turn, causes RunUserInterface to return to VOscopePanelMain, which then shuts things down, closes the panel properly, and exits. So far so good.
    int CVICALLBACK CB_VoscopePanel (int panel, int event, void *callbackData,
            int eventData1, int eventData2)
        int    iPanelHeight, iPanelWidth, iV2ControlLeft, iV2ControlWidth, iWidth,
            iT2ControlTop, iT2ControlHeight, iHeight, iLeft, iGap, iScreenTop, iScreenLeft,
            iTop, iBoxWidth;
        switch (event) {
            break;
        case EVENT_GOT_FOCUS: //happens when first displayed or refreshed
        case EVENT_PANEL_SIZE: //size the controls on the panel
           ... do stuff here;
            break;
        case EVENT_CLOSE:
            QuitUserInterface(0);  //stop VOscopePanelMain, which in turn closes the panel and cleans stuff up.
            break;
        return 0;
    However, I also want the panel to stop when I close the main program. The only way that I know how to do this cleanly is to have the main program (which has closed all of its panels and is in the process of shutting down) call VOSCOPE_Close_VOScope () which, in turn, calls CallPanelCallback (iHandle_VOscope, EVENT_CLOSE, 0, 0, 0); (which forces a call to CB_VoscopePanel above with the EVENT_CLOSE event), which should call QuitUserInterface, which should cause the RunUserInterface in VOscopePanelMain to return and let it continue to shut down. In addition, after calling CallPanelCallback, the shutdown routine calls CmtWaitForThreadPoolFunctionCompletion to wait for the VOscopePanelMain thread to actually quit and clean up before proceeding.
    But, of course, it doesn't since, and it took me a while to realize this. The call to QuitUserInterface isn't coming from inside of the VOscopePanelMain thread, it's coming from the main panel's thread - which is already in the process of shutting down. So, the main panel thread is telling itself to quit, VOscopePanelMain never gets the QuitUserInterface message, and things stall.
    So: how do I have one thread tell a panel in another thread to cleanly close? Or do I have to get complicated and either replace RunUserInterface in VOscopePanelMain with a loop that processes events manually and looks for a flag, or figure out something with a thread-safe queue? Any help appreciated.
    Attachments:
    Voscope.c ‏76 KB

    Sorry for delay in answering, it took me a while to find time to build up a working example.
    The attached program spawns a thread in a new thread pool and permit you to choose whether to close it from the main thread or the spawned thread itself.
    It appears that in such a minimal configuration the process works as expected. There may be some different configuration in your actual program that prevents this.
    Proud to use LW/CVI from 3.1 on.
    My contributions to the Developer Zone Community
    If I have helped you, why not giving me a kudos?
    Attachments:
    ThreadPoolWithGUI.zip ‏7 KB

  • I'm working on my iMac PowerMac8,2 PowerPC G5 (3.1) 2 GHz machine and have been having problems with the computer shutting down unpredictably. After the problem becoming impossible to work with, I shut the machine down. Now a little better, but reoccuring

    I'm working with my iMac PPC G5, PowerMac8,2, 2 GHz machine running OS X 10.4.11, and was having a problem for a while with the machine shutting down unexpectedly. There was no clear pattern to when it was shutting down as far as I could tell. For a while, it would also not restart when buttoned on.
    I set the machine aside for a while, probably a month or more, and then got it back out after its rustication. It started up and runs significantly better than it had been, but I have noticed it shutting down sometimes now again, though not as frequently as before. Sometimes it runs for a good long time between active work, sleep mode, and active work again. Once in a while it does shut down when no one is working on it (while asleep). But now it always restarts when buttoned on.
    I've done the thorough vacuuming of any dust from the unit vents. I wonder if there's anything else I should try. In most other ways the machine works pretty well and has become the family desktop for basic uses, so I'd like to keep it running if I can. A little frustrating to not be able to upgrade all programs (iTunes) to useable versions, but that's another story....
    I would appreciate any ideas about the shut down problem.
    TCC

    Option 1
    Reset your PRAM.  Press and hold down the Command Option P R keys while starting your computer.  You will hear the startup chime.  continue holding down those keys until you hear the startup chime a second time.  Release the keys.  If the computer restarts, you will need to reset your Date and Time.  It might be time to replace your PRAM battery.  The G5 iMacs require a 3 volt CR2032 lithium watch/camera battery like below:
    http://eshop.macsales.com/item/NewerTech/CR2032/
    You can find these batteries at Walmart, Kmart, Target, most local drugstore chains, for between $3-$5, or at Radio Shack for $12-$20.
    If you have any G5 iMac model EXCEPT the iSight version, you can probably do the battery install yourself.  Watch this video on upgrading your iMac's RAM to show you how to remove the back of your iMac, if you don't already know how:
    http://eshop.macsales.com/installvideos/imac_g5_mem_m/
    While you have the back off, use a can of compressed air to blow the dust out the vents at the bottom of the iMac, the fans, and anywhere else you can.  Also inspect the 28-30 capacitors on the logic board.  Look for dark spots, if they look puffy or swollen, or leaks.
    Option 2
    Reset the SMC by removing all cables (USB, Firewire, Ethernet, Modem, Power cord) from the back of your computer.  Let it sit for one minute.  Press and hold the power on button on the back of the iMac while plugging in the power cord.  Release the power on button.  Count to five, the press the power on button again.
    Option 3
    Place your original, came with the iMac when purchased install disk, into the slot on the iMac, press and hold the C key while pressing the power on button on the back of the computer.  (If you have upgraded your OS from when you purchased your iMac, example your iMac came with OS 10.3 installed, and you're now using OS 10.5, then use the OS 10.5 Retail Install disk that you had used to upgrade your OS instead of the original, came with the iMac disk.) 
    Continue holding the C key until you see the OS starting to load.  DO NOT do an OS installation.  At the top Menu bar, select Utilities or Utility, and pull down to Disk Utility.  On the left side of the window that opens,select your normal OS drive.  Click First Aid at the top middle of the window if it isn't already selected.  Click Repair Disk from the lower right area of the window.  When that is done, click Repair Permissions to the left of the Repair Disk button you clicked earlier.
    When that is done, quit Disk Utility.  From the top Menu bar (I think its under Utilities) select the Start Up Manager, and choose your normal boot volume as the startup disk.  Restart the computer.  If successful, and you've rebooted from your normal startup disk, eject the install DVD/CD, and you're good to go.
    Good luck.

  • Itunes make my mac pro impossible to shut down...

    Hello,
    So, when i launch itunes, my mac pro can't shut down. I choose "shut down", then the gray screnn and the wheel turning, but... nothing else. I have to shut it down with the button...
    Mac pro nehalem 2010 with Lion or Mountain, after re-installing lion or mountain Combo, or re-installing iTunes, with or without any peripherics pluged (usb firewire...) with another sessions... Hardware test is all correct.
    When i don't launch itunes, my session and my mac can shut down normally...
    Excuse my english and thanks at all !

    Reset SMC.
    http://support.apple.com/kb/HT3964
    Choose the method for:
    "Resetting SMC on portables with a battery you should not remove on your own".

  • My Final Cut Pro X quits unexpectantly and shuts down which makes it impossible to use..need help asap

    Went I went to grab some pictures that I had downloaded from the web, FCP X shut down and sent a message to APPLE.  I have tried deleting the pics and this morning it was working for a little while but it shut down again.  I need to get FCP working properly. 

    Same thing happened to me yesterday. It started after there was a sudden electricity shut off when I was playing with FCP X. I do not have Compressor installed. I eventually managed to get FCPX to work again when I manually deleted in Finder the project on which I was working when the electricity went off.
    I hope this information may give you some ideas on your problem.
    Mannnolo

Maybe you are looking for