Process.waitFor() causes program to hang!

I've successfully created a Process and run it using Runtime's exec(String path), and the kinds of processes I've successfully run have included Winzip, a WS_FTP Pro script, and a regular .bat file. I've also successfully called waitFor() on these processes, but in this particular case I'm calling a program that takes a file I give it as a parameter and merges its data into a database. I've been doing this procedure for a while (either from a command line or in a .bat file), but now I need to call it from my Java code. Preferably I'd like to waitFor() the process each time because I need to make sure all the files are merged in chronological order. My current test case only uses ONE file, but in reality there will be several. With one file, I can run the program and it appears to run fine (and it runs fast--like maybe a second or two at most), but whenever I call the following line it hangs indefinitely (I've never seen it terminate, even after several minutes):
focusProcess.waitFor();
When I just execute that program by itself by calling a .bat file with a hardcoded filename, I get standard output back from the program I'm calling. I'd like to see this output when I run my Java program and it appears to run fine, because I have no way if it IS running correctly! So, I added the following:
BufferedInputStream bis = new BufferedInputStream(focusProcess.getInputStream());
StringBuffer sb = new StringBuffer();
int c;
while((c=bis.read()) != -1) {   
sb.append(c);
bis.close();
I'm not sure if this is the right way to monitor that InputStream that I get from the process, and even if that InputStream is going to give me the standard output from that the process normally writes to the terminal. All I do know is that again, the program seems to hang indefinitely, and I guess it has to do with the fact that maybe this process isn't notifying me that it's terminated, and so I'm still waiting for the rest of that InputStream. And yes, I HAVE tried both of these situations together AND separately (so I know that both pieces of code cause the program to hang).
Any ideas would be much appreciated!

Paying attention to the standard output from the running process is good for debugging (and reporting program progression, if necessary) but probably doesn't contribute to the problem you are seeing. The standard input to the process, however, is a different story. If the process you have Runtime.exec'd is waiting for something on stdin, then the OS will block on behalf of the program that is blocking for input and never terminate!
Try running the exec'd command from the command-line and see if it needs any input (i.e. you have to press a key, or enter, or send EOF) for the program to complete. If this is the case then your Java program must supply that process with the appropriate input or it will just hang.
As for printing the output from a process... here's a quick proof of concept:
import java.io.*;
public class Exec {
    public static void main(String args[]) throws Exception {
        // Make sure we've got something to exec.
        if ( args == null || args.length < 1 ) {
            System.out.println("Usage: java Exec COMMAND [ARGS...]");
            System.exit(1);
        // Run the process and print the output.
        Process p = Runtime.getRuntime().exec(args);
        BufferedReader in = new BufferedReader(new InputStreamReader(p.getInputStream()));
        String line;
        while ( (line=in.readLine()) != null ) {
            System.out.println("EXEC: "+line);
}Hope this helps!
-mike

Similar Messages

  • My efforts to remove malware from a network external hard drive connected to my Intel based iMac is now causing programs to hang when I try to open them.

    I own an iMac, recently updated with OSX 10.75. It is the core computer on a home network shared with an iPad, Apple TV, two network printers,my wife's laptop, two iPhone, a BlackBerry and a BlackBerry Playbook. I am experiencing three if not four problems that are overwhelming.
    My original problem is associated with Windows emails files or documents  stored on my external network  hard drive. One or more has malware and is sending malware laced files across the Internet to points unknown.  As someone pointed out in a forum my iMac may be hosting,sharing and propagating Windows malware.  I originally used Trend Micro software on my IMac to monitor any viral activity. Two weeks ago I noticed a number of notices from servers around the world saying my message was not undelivered. Since I had sent messages to the people I simply deleted the emails. Next I noticed the emails on my BlackBerry and my BlackBerry playbook.I configured the Trend to do a complete scan and although it did a complete scan it did not perform a full network scan. It did identify a series of .x27 document files with the same name tbut each had a sequential number. I assumed hat these were the source files that had  sent out the email documents selling Viagara and othernproducts.  I manually deleted thousands of the source documents and the files. This caused some disruption to my computer but it did not produce a hardware or software problem. By following this effort in conjunction with security scans I do believe the malware was activated by Iranian students who were able to activate the malware through my BlackBerry and BlackBerry Playbook.  I learned this from an encounter I had when trying tondelete these files on my computer and my BlackBerry.
    When using my PlayBook after deleting the files from my computer I noticed more messages being returned from servers.  I realized that email accounts connected to my BlackBerry and BB Playbookn were not protected from this problem. As I searched for remedies I learned about turning on the firewall in the previous version of Lion but that did not stop the BlackBerry problem. Each time I deleted a source file on my computer more documents were released. I eventually received McAfee from my ISP. It provided security on the entire network. My first full scan of my external drive identified two malware files. One of them was associated with the Cialis ad the other was from a firm in the Middle East called ADP.  it could not remove the latter file.
    Moreover each time I attempted to remove the source file from my hard drive a file labeled A239A076F would show up on my Blackberry.  As I removed them thousands of these files would show up.  Ultimately I eventually disconnected the external hard drive and removed the battery from the phone and not use the email accounts these messages had used to enter my iMac.  I am contacting ATT about BlackBerry data security and switching to a different phone for business purposes. I will probably change to an iPhone or Android phone for business purposes.  I am also looking at ways to resolve the malware on that drive. There are a number of business and personal files on thatbdrive that I hope to keep. I dread having to pay McAfee to configure the software to eradicate the malware.
    Moving on...last week I updated my iMac to 10.75. It simultaneously updated every Apple based program as promised. It did not update the non-Apple programs.  I am not an IT professional and assumed that it had done so.  On Saturday I attempted to download a file associated with my router extender using my untethered Playbook and BlackBerry desktop software. The program hung. I attempted a reboot and it reopened with the hung program.  It created an alias file on the desktop.  My inclination led to put the alias file in the trash can and delete it. My computer did not respond well to that action. It has been rebooted with Cmd-s-esc tens of time to see if that would activate a file check. It did not. I was able to run a disk utility check. And in spite of the hung process it eventually said the drive was okay.
    Long story in a nutshell. My iMac is responding as if it is looking for a subprogram to complete its a function. Or it is attempting to finish the BlackBerry operation it began on Saturday. I hope this makes sense to someone and the know how I can restore functionality to my iMac.
    Thank you.

    I think the McAfee suite will do the trick when I pay them a one-time fee of $69 or $179 for a year for unlimited support.
    Your call of course but IMO a waste of money. Please read this first:
    There are many forms of ‘Malware’ that can affect a computer system, of which ‘a virus’ is but one type, ‘trojans’ another. Using the strict definition of a computer virus, no viruses that can attack OS X have so far been detected 'in the wild', i.e. in anything other than laboratory conditions. The same is not true of other forms of malware, such as Trojans. Whilst it is a fairly safe bet that your Mac has NOT been infected by a virus, it may have another security-related problem, but more likely a technical problem unrelated to any malware threat.
    You may find this User Tip on Viruses, Trojan Detection and Removal, as well as general Internet Security and Privacy, useful:
    https://discussions.apple.com/docs/DOC-2435
    The User Tip (which you are welcome to print out and retain for future reference) seeks to offer guidance on the main security threats and how to avoid them.
    More useful information can also be found here:
    http://www.reedcorner.net/mmg/

  • Fan spinning up causes programs to hang...

    I've been using a new Satellite A505-S6005 (Win7, i3-330m, 4G RAM) for almost three months now and I like it a lot.  I bought it for general browsing and typing,  messing around with some light-ish imaging and music apps, and playing older games.  It does a great job, except when running certain programs (and most games).  
    When I fire up something like FL Studio (a digital audio workstation, which is fairly processor-intensive... and probably more-so because of the standard sound card), it runs great until the fan kicks on.  When that happens, the program hangs up and the sound repeats like a broken record.  After 4 or 5 seconds everything goes back to normal, and the fan slows down again.  This happens again and again roughly every 30 seconds, maybe every minute.
    I thought FL Studio might just be putting too much strain on the CPU (though its in-program CPU meter shows that it never goes above 40% and I don't run any major processes in the background) until I installed an old copy of Warcraft III.  The game does the exact same thing...runs incredibly well and then just locks up for a few seconds when the fan kicks on, then runs incredibly well again...and it came out roughly 8 years ago.  Sometimes it will hang up every 10 seconds depending on how many people are on the screen, which makes it pretty much zero fun.
    Almost all of the games I've installed so far do this to varying degrees.
    So what's up?  The computer is well above the system requirements of these programs.  Why does the fan trigger the lockups?  Does the fan need a ton of processor power because it's really really really smart?
    Thanks in advance,
    -Ian
    P.S. - It does this plugged in and on battery.  I switched the power management options around between active and passive and nothing changed...could something be wrong with my fan?  It's kicking on every 30 seconds or so right now, and I'm just typing this with one browser window open and no other programs running.

    Terrifically old post, but still. I'm on a different model of Satellite, but I'm having a similar issue: every so often, the fan will spin up suddenly, the computer will hang for about a second, then the fan will slow down again and everything resumes as usual. Any ideas? Anyone?

  • Program links cause programs to hang

    Whenever I click a link that opens a program to launch a file, the programs jumps in the dock repeatedly and hangs. But if I open the program first and then manually select the file to open, this does not happen. One recurring example is if I click a torrent link that launches Transmission, it will hang. But when I force quit and then manually re-launch Transmission it comes up fine and the torrent will already be added.

    I also wanted to a few more examples of programs hanging. When I option-click a dmg and select open with disk utility, the program hangs. When I double-click an installer file for an application, the installer hangs. Also I cannot mount dmg files unless I logout and back in.

  • Firefox regularly hangs after an unspecified period of use, and causes other programs to hang, and a forced system shutdown is necessary.

    The firefox browser hangs after an unspecified period of time. Anything from a few minutes after system startup, up to 5-6 hours of use or perhaps more. Attempting to use other programs including windows explorer while firefox is hanging causes those programs to hang also, making a forced shutdown necessary. Occaisionally I've noticed firefox will respond, perhaps after 10 or more minutes. There seems to be no hard disk activity while the program hangs. Memory usage of firefox on my system is usually upwards of 190,000.

    I have circumvented this mostly by running internet explorer, and using Firefox only for browsing when I need to make use of it's addons. In this way I've had the problem re-occur maybe once or twice in the past two weeks. It's not really a solution but it does seem to help, and I'm no longer sure the problem IS firefox but using it certainly exacerbates the problem.
    I've only just updated to firefox 6, so I am not entirely sure how that will go just yet.

  • Process.getInputStream() and process.waitfor() block in web application

    Hi folks,
    i am really stuck with a problem which drives me mad.....
    What i want:
    I want to call the microsoft tool "handle" (see http://www.microsoft.com/technet/sysinternals/ProcessesAndThreads/Handle.mspx) from within my web-application.
    Handle is used to assure that no other process accesses a file i want to read in.
    A simple test-main does the job perfectly:
    public class TestIt {
       public static void main(String[] args){
          String pathToFileHandleTool = "C:\\tmp\\Handle\\handle.exe";
          String pathToFile = "C:\\tmp\\foo.txt";
          String expectedFileHandleSuccessOutput = "(.*)No matching handles found(.*)";
          System.out.println("pathToFileHandleTool:" + pathToFileHandleTool);
          System.out.println("pathToFile: " + pathToFile);
          System.out.println("expectedFileHandleSuccessOutput: " + expectedFileHandleSuccessOutput);
          ProcessBuilder builder = null;
          // check for os
          if(System.getProperty("os.name").matches("(.*)Windows(.*)")) {
             System.out.println("we are on windows..");
          } else {
             System.out.println("we are on linux..");
          builder = new ProcessBuilder( pathToFileHandleTool, pathToFile);
          Process process = null;
          String commandOutput = "";
          String line = null;
          BufferedReader bufferedReader = null;
          try {
             process = builder.start();
             // read command output
             bufferedReader = new BufferedReader(new InputStreamReader(process.getInputStream()));
              while((line = bufferedReader.readLine()) != null) {
                 commandOutput += line;
              System.out.println("commandoutput: " + commandOutput);
             // wait till process has finished
             process.waitFor();
          } catch (IOException e) {
             System.out.println(e.getMessage());
             e.printStackTrace();
          }  catch (InterruptedException e) {
             System.out.println(e.getMessage());
             e.printStackTrace();      }
          // check output to assure that no process uses file
          if(commandOutput.matches(expectedFileHandleSuccessOutput))
             System.out.println("no other processes accesses file!");
          else
             System.out.println("one or more other processes access file!");
    } So, as you see, a simple handle call looks like
    handle foo.txtand the output - if no other process accesses the file - is:
    Handle v3.2Copyright (C) 1997-2006 Mark RussinovichSysinternals - www.sysinternals.com
    No matching handles found.
    no other processes accesses file!(Wether the file exists or not doesnt matter to the program)
    If some processes access the file the output looks like this:
    commandoutput: Handle v3.2Copyright (C) 1997-2006 Mark RussinovichSysinternals - www.sysinternals.com
    WinSCP3.exe        pid: 1108    1AC: C:\tmp\openSUSE-10.2-GM-i386-CD3.iso.filepart
    one or more other processes access file!So far, so good.........but now ->
    The problem:
    If i know use the __exact__ same code (even the paths etc. hardcoded for debugging purposes) within my Servlet-Webapplication, it hangs here:
    while((line = bufferedReader.readLine()) != null) {if i comment that part out the application hangs at:
    process.waitFor();I am absolutely clueless what to do about this....
    Has anybody an idea what causes this behaviour and how i can circumvent it?
    Is this a windows problem?
    Any help will be greatly appreciated.....
    System information:
    - OS: Windows 2000 Server
    - Java 1.5
    - Tomcat 5.5
    More information / What i tried:
    - No exception / error is thrown, the application simply hangs. Adding
    builder.redirectErrorStream(true);had no effect on my logs.
    - Tried other readers as well, no effect.
    - replaced
    while((line = bufferedReader.readLine()) != null)with
    int iChar = 0;
                  while((iChar = bufferedReader.read()) != -1) {No difference, now the application hangs at read() instead of readline()
    - tried to call handle via
    runtime = Runtime.getRuntime();               
    Process p = runtime.exec("C:\\tmp\\Handle\\handle C:\\tmp\\foo.txt");and
    Process process = runtime.exec( "cmd", "/c","C:\\tmp\\Handle\\handle.exe C:\\tmp\\foo.txt");No difference.
    - i thought that maybe for security reasons tomcat wont execute external programs, but a "nslookup www.google.de" within the application is executed
    - The file permissions on handle.exe seem to be correct. The user under which tomcat runs is NT-AUTORIT-T/SYSTEM. If i take a look at handle.exe permission i notice that user "SYSTEM" has full access to the file
    - I dont start tomcat with the "-security" option
    - Confusingly enough, the same code works under linux with "lsof", so this does not seem to be a tomcat problem at all
    Thx for any help!

    Hi,
    thx for the links, unfortanutely nothing worked........
    What i tried:
    1. Reading input and errorstream separately via a thread class called streamgobbler(from the link):
              String pathToFileHandleTool = "C:\\tmp\\Handle\\handle.exe";
              String pathToFile = "C:\\tmp\\foo.txt";
              String expectedFileHandleSuccessOutput = "(.*)No matching handles found(.*)";
              logger.debug("pathToFileHandleTool: " + pathToFileHandleTool);
              logger.debug("pathToFile: " + pathToFile);
              logger.debug("expectedFileHandleSuccessOutput: " + expectedFileHandleSuccessOutput);
              ProcessBuilder builder = new ProcessBuilder( pathToFileHandleTool, pathToFile);
              String commandOutput = "";
              try {
                   logger.debug("trying to start builder....");
                   Process process = builder.start();
                   logger.debug("builder started!");
                   logger.debug("trying to initialize error stream gobbler....");
                   StreamGobbler errorGobbler = new StreamGobbler(process.getErrorStream(), "ERROR");
                   logger.debug("error stream gobbler initialized!");
                   logger.debug("trying to initialize output stream gobbler....");
                   StreamGobbler outputGobbler = new StreamGobbler(process.getInputStream(), "OUTPUT");
                   logger.debug("output stream gobbler initialized!");
                   logger.debug("trying to start error stream gobbler....");
                   errorGobbler.start();
                   logger.debug("error stream gobbler started!");
                   logger.debug("trying to start output stream gobbler....");
                   outputGobbler.start();
                   logger.debug("output stream gobbler started!");
                   // wait till process has finished
                   logger.debug("waiting for process to exit....");
                   int exitVal = process.waitFor();
                   logger.debug("process terminated!");
                   logger.debug("exit value: " + exitVal);
              } catch (IOException e) {
                   logger.debug(e.getMessage());
                   logger.debug(e);
              }  catch (InterruptedException e) {
                   logger.debug(e.getMessage());
                   logger.debug(e);
         class StreamGobbler extends Thread {
              InputStream is;
             String type;
             StreamGobbler(InputStream is, String type) {
                 this.is = is;
                 this.type = type;
             public void run() {
                  try {
                     InputStreamReader isr = new InputStreamReader(is);
                     BufferedReader br = new BufferedReader(isr);
                     String line=null;
                     logger.debug("trying to call readline() .....");
                     while ( (line = br.readline()) != null)
                         logger.debug(type + ">" + line);   
                 } catch (IOException ioe) {
                         ioe.printStackTrace(); 
         }Again, the application hangs at the "readline()":
    pathToFileHandleTool: C:\tmp\Handle\handle.exe
    pathToFile: C:\tmp\openSUSE-10.2-GM-i386-CD3.iso
    expectedFileHandleSuccessOutput: (.*)No matching handles found(.*)
    trying to start builder....
    builder started!
    trying to initialize error stream gobbler....
    error stream gobbler initialized!
    trying to initialize output stream gobbler....
    output stream gobbler initialized!
    trying to start error stream gobbler....
    error stream gobbler started!
    trying to start output stream gobbler....
    output stream gobbler started!
    waiting for process to exit....
    trying to call readline().....
    trying to call readline().....Then i tried read(), i.e.:
         class StreamGobbler extends Thread {
              InputStream is;
             String type;
             StreamGobbler(InputStream is, String type) {
                 this.is = is;
                 this.type = type;
             public void run() {
                  try {
                     InputStreamReader isr = new InputStreamReader(is);
                     BufferedReader br = new BufferedReader(isr);
                     logger.debug("trying to read in single chars.....");
                     int iChar = 0;
                     while ( (iChar = br.read()) != -1)
                         logger.debug(type + ">" + iChar);   
                 } catch (IOException ioe) {
                         ioe.printStackTrace(); 
         }Same result, application hangs at read()......
    Then i tried a dirty workaround, but even that didnt suceed:
    I wrote a simple batch-file:
    C:\tmp\Handle\handle.exe C:\tmp\foo.txt > C:\tmp\handle_output.txtand tried to start it within my application with a simple:
    Runtime.getRuntime().exec("C:\\tmp\\call_handle.bat");No process, no reading any streams, no whatever.....
    Result:
    A file C:\tmp\handle_output.txt exists but it is empty..........
    Any more ideas?

  • Labview Program will hang between 33% and 50% of the time.

    I have a problem with a Labview program I made. I have two programs that do the same thing. One is in flat sequence form and the other is in state machine form.
    As explained in the link below, I would like to make use of a microcontroller to make wiring connections for automating a measurement process. A separate current source and volt meter will be used.
    https://forums.ni.com/t5/LabVIEW/Sequence-a-good-idea/td-p/2601333
    I have since made some simple test programs which I have attached. The problem is when executing, the labview program will hang, but not every time the program is execute.
    For example: Hall 1.2.vi will work properly twice with the third time it is executed it will hang. If you abort and try again, it will again run twice with no problems with the third hanging. This one is in flat sequence format (was in a flat sequence, but merged the windows because I thought that was the cause). From what I can tell, the program will hang when calling Keithley 6517 Single Read.vi. Both connected Keithley devices are connected to the computer via GPIB at 16 and 27. The way I verified if it was this vi causing it or contributing to it was that I removed it and the program never hung. I find it very strange that it will hang exactly on the third attempt every time.
    Hall 1.3 simple.vi will work the first time and hang the second time. So it works 50% of the time. This one is in State Machine format. This one will hang at the case titled "Measure 1" which contains the Keithley 6517 Single Read.vi.
    I've used the highlight execution button and watched the program run. Oddly, it doesn't hang when using this button. So I tried adding delays/wait in different places to no avail.
    What could be causing this? As a side note, I say the program hangs for two reason. The main one is the program doesn't finish running so the run arrow is still black. The second thing is that if you notice at the end of the labview program, I have a block there that turns the current source off which doesn't happen when it hangs. I have to manually turn it off and then hit the abort program button to stop labview.
    Solved!
    Go to Solution.
    Attachments:
    Hall 1.2.vi ‏42 KB
    Hall 1.3 simple.vi ‏81 KB

    altenbach wrote:
    SaintsFan wrote:
    Also, I've tried placing wait/delays at various places with no improvement of the problem. My next thought is to just remove all the vi calls and have everything in one program.
    How did you place the waits?
    Why would placing everything in one program fix the problem. That makes no sense! What is your reasoning?
    In the case of hall1.3, I placed a wait in the Measurement cases and CS On cases and there was no affect. In the hall 1.2 when the blocks were broken up similar to the state machine cases where each sequence window was identical to the cases, I placed a wait or delay in each window with no effect on the hanging.
    My reasoning for placing everything in one program is the same as my reasoning for figuring delays would help, since the time of execution would be altered. If the execution time is faster and if the timing is the problem then I figured that the problem would happen more frequently or even every time.
    Somehow I get the feeling this is not the case. The reason being the interval in which it succeeds or hangs is constant. I believe somewhere, a value is getting set. The 6517 Read vi runs fine if I run this vi by itself no matter how many or how fast I run it. Also, the same goes for both 1.2 and 1.3 if I remove the 6517 read vi they run fine no matter how fast or how many times I run them. 
    Somehow after the current source is set to operate and triggers labview will hang on a set interval when calling 6517 read vi.
    Separately they work, together there is a problem. I tried placing a delay between these two by connecting the error out of the trigger vi to the error in of the delay block and the error out of the delay block to the error in terminal of the 6517 config block. I've also tried delays between other blocks connected the same way. From what I understand, a called vi can't execute until all inputs are present. Is this the correct way to wire the delays?

  • Problem in "Process.waitFor()" in multithreaded application (UNIX OS)

    Hello all
    This is very urgent for me.
    I am using the follwing code to invoke the child process which calls a shell script in the unix OS,and it is going fine when runs in single thread. But if i run it as the multhreaded appln, anyone of the thread hangs in the 'Process.waitfor()' call. But sometimes all the threads are returning successfully. I am calling this code from the one or more threads. This is tested in the java1.2 and 1.3. so can u suggest me how to change the code or any way to fix up the problem.
    // the code starts
    String s[] = new String[3];
    s[0] = "/bin/sh";
    s[1] = "-c";
    s[2] = "encrypt.sh"; //some .sh filename to do the task
    Runtime runtime = Runtime.getRuntime();
    Process proc;
    proc = runtime.exec(s);
    InputStream is = proc.getInputStream();
    byte buf[] = new byte[256];
    int len;
    while( (len=is.read(buf)) != -1) {
    String s1 = new String(buf,0,len);
    System.out.println(s1);
    InputStream es = proc.getErrorStream();
    buf = new byte[256];
    while( (len=es.read(buf)) != -1) {
    String s1 = new String(buf,0,len);
    System.out.println("Error Stream : " + s1);
    // place where it hang
    retValue = proc.waitFor();
    //code ends
    i am handling the errorstream and output stream and not getting any error stream output and not printing any messages in the child process. When i synchronize the whole function, it went fine, but spoils the speed performance. I tried all the option but i could not solve the problem.
    thanks

    You're first reading all of the standard output, then reading all of the standard error. What if the process generates too much output to standard error and hangs while it waits for your program to read it? I would suggest having two threads, one which reads the standard output and the other which reads standard error.

  • Non-Apple browsers cause cascading system hang with clean install of Lion

    It started with Google Chrome.  After a few hours of use, Chrome would randomly lock up one renderer at a time until it was completely unresponsive.  Console showed nothing conclusive in the logs, and would soon lock up itself.  Logged-in Terminal windows could sometimes get as far as a "ps auxc", but would lock up during the command output, and new Terminal windows or tabs would never get past login.  The SSH daemon would be dead in the water, preventing me from logging in remotely.  Any existing SSH connections would hang on the first command.  Activity Monitor would lock up the moment I tried to sample a process or interact with anything.  Interacting with SystemUIServer (pulling down the menu for the clock or trying to do a Spotlight search) would cause SystemUIServer to hang.  Same with the Dock.  My mouse was like the Midas of software failure: everything I touched turned to hang.  Eventually I'd be staring at a spinning beachball.  After a few (five to ten) minutes, it might perform a couple queued events (opening a window, switching to another application) but would usually become wedged again immediately, forcing me to hard restart.
    I then tried installing Firefox 5, and discovered that it causes the hang fairly reliably within the first ten seconds.  Since I knew when it was about to happen, I managed to capture a few stack traces in Activity Monitor, but it was always different, and always somewhere in the kernel (usually file-system related: __getattrlist while scanning fonts one time, the open system call another).
    Safari, on the other hand, works great.
    I've tried performing a verification of my startup disk, which returns no errors, so although I'm not ruling out hardware failure at this point the problem started immediately after I upgraded to Lion, and persisted even after I wiped my hard drive completely and performed a clean install from the recovery partition.  It also doesn't seem to be completely the fault of either Chrome or Firefox, since they're different browsers with different rendering engines using different system frameworks.  They do both perform a lot of file I/O, so maybe that's a clue.  Another possible lead is the seemingly random errors Console will spew out while the hang is occuring.  Most recently I've gotten a screenful of '--ImageKit Error: updateGLTextureWithBitmapData: glPixelStorei returned an error : 506 ...', and before that it was 'Google Chrome Helper: CGSLookupServerRootPort: Failed to look up the port for "com.apple.windowserver.active" (1100)', "kernel: IOSurface: buffer allocation size is zero".  Console spew being what it is, though, I don't know if any of that is relevant.
    I figure I would be seeing quite a lot of angry forum threads if Chrome and Firefox were completely unusable on other people's machines, so I'm guessing there's something specific to my configuration happening here.  With a clean install, though, I'm not sure what it could be.  Here are detailed system specs:
    24" iMac (Early 2008 -- just out of AppleCare coverage, figures) , 2.8 GHz, 2GB RAM, running Lion build 11A511 (which should be the 10.7 release version).
    I would be massively indebted to anyone who has experienced or heard about this issue before and can give me something else to try.

    Zeroing the disk serves no purpose in this situation.  It is a common misconception that this is required to map out bad blocks on the drive, but the fact is that 1) modern hard drives map out bad blocks as part of everyday operation, and 2) zeroing the drive involves simply writing zeros with no checks to see if the zero was written successfully, so it wouldn't know if a block was bad anyway.
    It's possible the drive is starting to go bad, although then there should be some problems with SL as well.  I would recommend repartitioning the drive with Disk Utility.  Make sure it's got one partition, using the GUID partition map scheme, and format that partition as Mac OS Extended (Journaled).  Repartitioning should get rid of any gremlins lurking on the disk, unless the physical disk itself is dying.  And after repartitioning, install straight from the flash drive, as Shootist recommends, rather than installing SL first.
    Hardware could be an issue.  It's entirely possible for an older system to work fine on slightly faulty hardware while a newer system does not.  Running Apple Hardware Test wouldn't be a bad idea.
    Firmware updates wouldn't be a bad idea.  However, note that my mid-2010 MBP with the same specs is running Lion just fine, and I've never installed any firmware updates.  (Firmware updates scare me...  if my machine is running just fine, I'm reluctant to risk installing new firmware.  But that's probably just a bit of paranoia talking.  )

  • Reloading Plug-In Page causes browser to hang during stress test on IE & NS

    When an applet page is in the process of being loaded using the Java Plug-In and a second request is made to reload that applet or a new applet several times in succession, the browser hangs. Is there a work around for the Java Plug-In version 1.3.1.

    Hi,
    You can see fixed bugs in 1.3.1_01 version at
    http://java.sun.com/j2se/1.3.1/ReleaseNotes.html
    This is one of them:
    http://developer.java.sun.com/developer/bugParade/bugs/4477187.html
    Description: Loading applets, using IExplorer 5.0/5.5, sometimes caused a system hang.
    Hopefully this bug fix relates to your problem.

  • Process chains time outs and hangs with no error msg - in SP13

    Hi all,
    We are having all kind of weird problems after we patched our system with SP13. Our process chain time outs and hangs, but surprisingly we never get any error msg. And scarier part is, the problem seems to be intermittent. PC runs fine on some days and hangs on some.
    Further analysis into the dump – as below
    Termination occurred in the ABAP program "SAPLRSSM" -
    in "RSSM_SLEEP_DEBUG".
    The main program was "SAPMSSY1 ".
    In the source code the termination point is in (Include) program "LRSSMU39".
    This refers to an issue that appears to have been addressed by OSS Note
    934648(meant for SP8). This notes also indicates to populate RSADMIN table to
    exclude "RSSM_SLEEP_DEBUG". Not sure if this note is valid for SP13? However we went ahead and populated the RSADMIN table.
    So now we have no clue what’s going on and where to fix the issue.
    As per SAP suggestion we applied the following notes:
    0000653996  Analyzing lock situations
    0000893563  Correction: Deadlock on completion of a remote chain
    0000994007  Corrections: Deadlock with external status query
    0001005481  Correction: Process successful, but there is no instance
    0001047174  Correction: Incorrect scope when locking in process chains
    0001051957  Correction: TIME_OUT during dialog confirmation of processes
    0001083660  Report for error stack analysis
    Nothing seems to help us. And SAP suggested a few options, which we implemented to no rescue.
    I’m sure that many of the customers have applied SP13, and want some feedback from them, if this is happening in their systems too?
    If so, how did you fix this issue?
    Or this situation is unique to us?Please note that no settings were changed as of SP13 to that of what they were in SP12(unless it is a side effect of the patch itself). Everything worked fine with SP12 and is still working on the BIP system. All the problems are in BIQ patched to SP13.
    Any pointers or insight would be appreciated. We have a customer msg open with SAP, and going back and forth, but nothing seemed to work as of today.
    Thanks,
    Voodi

    Not sure which OSS helped us get past the issue, as SAP asked us to apply a ton of notes. But along which the notes, SAP has some suggestions for us, which we think did the magic. After the implementation of the suggestin we never faced the same issue again. The suggestion by SAP:
    move the process chain callback in a batch job by executing
    program RSSM_TRACE_SWITCH and selecting the flag "verifcation
    of asynchronous processes - execute in batch".
    Lemme know if this doesnt fix the issue, I can give all the notes that SAP asked us to apply.
    Message was edited by:
            voodi

  • Transferring photos from camera or memory card causes iPhoto to hang up with the spinning beach ball - why

    Transferring photos from camera or memory card causes iPhoto to hang up with the spinning beach ball - why?  This happens only on a 5 year old iMac running 10.6.8.  It is a recent developmemt.  All other machines have no problen with the same card.

    I click on the send feedback everytime it pops up with the force quit, so they'er getting it.
    That sends a crash report. Its doubtful that these are ever seen by a human being, but more likely datamined. Sending feedback reaches an actual person.
    My guess from yourdescription is that the portion of the OS (note, OS, not iPhoto) that manages the importing process is what's crashing.
    Regards
    TD

  • Safari causing full-system hang

    For a while now I've been getting the SBOD irregularly in Safari, since 3.x if I remember right. I've got some time off work at the minute so I'm finally looking into this properly, and here's what I've found:
    There seems to be two separate conditions. The first happens on loading some, but not all web pages, causes a lengthy hang in which the entire system (even invoking Dashboard or Spaces) becomes unresponsive. In the console this accompanied by an entry similar to the following:
    05/10/2010 08:15:47 /Applications/Safari.app/Contents/MacOS/Safari[242] ATS AutoActivation: Query timed out. (elapsed 5.0 seconds. params: queryString = {comapple_ats_namepostscript == "Helvetica-Neue" && kMDItemContentTypeTree != com.adobe.postscript-lwfn-font}, valueListAttrs = {<CFArray 0x6f5710 [0xa008dee0]>{type = immutable, count = 1, values = (
    0 : <CFString 0xa01602c8 [0xa008dee0]>{contents = "kMDItemContentType"}
    )}}, sortingAttrs = {<CFArray 0x6f5730 [0xa008dee0]>{type = immutable, count = 1, values = (
    0 : <CFString 0xa01603a8 [0xa008dee0]>{contents = "kMDItemContentModificationDate"}
    )}}, scopeList = {<CFArray 0x6f5750 [0xa008dee0]>{type = immutable, count = 1, values = (
    0 : <CFString 0xa0161a98 [0xa008dee0]>{contents = "kMDQueryScopeComputer"}
    (sometimes it names a font, sometimes the font name is "_")
    I suspect this means some vestigial adobe product has messed my system right up. I used to use CS4 but have long since removed it. I also have Air and Flash (the current gala beta) installed. I have had fontbook validate Helvetica Neue and check all fonts for duplicates - if external disks are plugged in at this time they all spin up.
    The other case is when downloading a file through clicking a link or alt-clicking a link (right-clicking a picture and saving it to the downloads folder does not cause this behaviour), and is accompanied by this much sparser line in the console:
    05/10/2010 08:25:06 kernel disk0s2: I/O error.
    The files themselves can be opened, moved and copied without incident and at regular speeds, so I doubt disk corruption. I've also performed a few full clone/restores on my boot disk with no effect. My initial thoughts were to blame a long-forgotten folder action that sorted downloads into different places (including a network share, if present), but disabling folder actions has not helped.
    So, any ideas? I'm fresh out.

    A workaround for the font-problem seems to be to turn off ATS - it's in FontBook.
    The second issue still eludes me.
    Things I have tried:
    Trashing ~/Library/Safari/
    Trashing ~/Library/Preferences/com.apple.Safari*
    Cleaning out every vestigial trace of anything suspect I had on my system (google keystone, logitech control centre, SIMBL, The Spark, iStat Menus, folder actions)
    Interestingly, the issue is not present for the guest user, so it IS something wrong with my user account. I just can't figure out what.
    Yes, making a brand new account would fix all this, providing I'm meticulous about testing the issue as I move /Users/Old/ into /Users/New/, but I'm kind of loathe to give up. It's surely something really simple!

  • Sharpener Pro 3 has problems in Aperture as the Pre sharpener continually asks one to buy or activate and the Output Sharpener causes Aperture to hang. Have removed all duplicate fonts and tried using a new user account. Any ideas?

    I am experiencing problems with Sharpener Pro 3 as an Aperture 3 plug-in. These are:  the Pre sharpener continually asks one to buy or activate and the Output Sharpener causes Aperture to hang. Following discussions with Nik Software I have removed all duplicate fonts and tried using a new user account. Neither of the courses of action worked. Have other users experienced these difficulties? Can you suggest an alternative remedy?

    I am experiencing problems with Sharpener Pro 3 as an Aperture 3 plug-in. These are:  the Pre sharpener continually asks one to buy or activate and the Output Sharpener causes Aperture to hang. Following discussions with Nik Software I have removed all duplicate fonts and tried using a new user account. Neither of the courses of action worked. Have other users experienced these difficulties? Can you suggest an alternative remedy?

  • On my PC, iTunes 11.0.3.42 causes it to hang when attempting to view a .MOV (1.6GB) requiring a cold boot. What could be causing this?

    On my PC running windows XP Service Pack 3, iTunes 11.0.3.42 causes it to hang when attempting to view a .MOV (1.6 GB) requiring a cold boot. What could be causing this? Corrupted .MOV? Too little RAM? It successfully plays a 162 MB .MOV.

    Hello David,
    Thank you for providing all that information about the iTunes issue you are experiencing.  We would first want to rule out any software issues before we can determine if it has to do with RAM.  I found an article that will help you isolate and troubleshoot software issues that could be causing iTunes to behave this way:
    iTunes for Windows XP: Troubleshooting unexpected quits, freezes, or launch issues
    http://support.apple.com/kb/TS1421
    I hope this helps you get back on track with watching movies in iTunes! 
    Best,
    Sheila M.

Maybe you are looking for

  • File & Printer Sharing with  Windows Vista

    Hi All, I work in a small office, I'm the only mac user & I supply my own Macbook 10.5.6. We have just had a new Samsung printer installed in the office which all PC's have been enabled for printer sharing, but I cant seem to get my Mac to pick up th

  • Problem with 'Fade Out'

    As part of an edit, I am trying to both 'Fade In' and 'Fade Out' of a particular video. The 'Fade In' works fine, but I'm having problems with the 'Fade Out'. For some strange reason, while the video part of it fades out properly, the audio that also

  • Can Lightroom 2 do this

    OK I understand that lr2 is non destructive editing. Here's what I want to do: Scan in a drawing with pastel like colors in tiif file format. Open the scann drawing in lr2 and crop to certain size and save into a format that is non destructive Print

  • Unexpected Results Query of Queries

    assume you have a query named q1 with more than 1 record. What would expect to q2 to look like? <cfquery name="q2" dbtype="query"> select count(*) as abc from q1 where 1 = 2 </cfquery> If you run it, were your expections met? Mine certainly were not.

  • Presenter Information Displayed Backwards

    Currently, Keynote's only option to view "Presenter Information" is to select the "Use Alternate Display to View Presenter Information" box under Keynote's preference menu. Keynote desperately needs a feature that allows you to use the PRIMARY displa