Community
Participate
Working Groups
Build Identifier: 20110615-0604 Working on a C/C++ project Eclipse on snow leopard (Java 1.6) crashes, seemingly randomly (I'm unable to find specific events in which to reproduce the bug; once I reopen eclipse, the task I asked eclipse to do (such as save a file, or reformat code) completes OK). Results in force quitting and relaunching every ten minutes or so. Happens every time I run eclipse. Unsaved files are lost. Java VisualVM: "Take Thread Dump failed" No problem with the same project and same build of eclipse when running on Leopard (Java 1.5). Reproducible: Always
Created attachment 200683 [details] Spin Controls sample of eclipse hanging
Hard to identify the cause without a thread dump. Alternate suggestions might be to attach a debugger to your running Eclipse and see what's going on when it appears to have hung.
The summary says "hangs" but comment 0 says "crashes". What is it? Can you try to get a thread dump?
(In reply to comment #3) > The summary says "hangs" but comment 0 says "crashes". What is it? Can you try > to get a thread dump? It hangs. I have been unable to get a thread dump using Java VisualVM or jconsole. I understand that I could attach the eclipse java debugger to eclipse to get a thread dump. I will attempt this; but I am unfamiliar with java debugger.
(In reply to comment #4) > (In reply to comment #3) > > The summary says "hangs" but comment 0 says "crashes". What is it? Can you try > > to get a thread dump? > > It hangs. > > I have been unable to get a thread dump using Java VisualVM or jconsole. Did you check whether the VM itself writes a dump when it crashes? > understand that I could attach the eclipse java debugger to eclipse to get a > thread dump. I will attempt this; but I am unfamiliar with java debugger. This won't help much unless we have at least some clue where/how it crashes so that we can set breakpoints.
(In reply to comment #5) > (In reply to comment #4) > > understand that I could attach the eclipse java debugger to eclipse to get a > > thread dump. I will attempt this; but I am unfamiliar with java debugger. > > This won't help much unless we have at least some clue where/how it crashes so > that we can set breakpoints. I was thinking you could suspend the entire VM when the hang happened and it might be possible to expand all the threads to find the offending one(s). Is this option not be viable, Dani?
(In reply to comment #6) > (In reply to comment #5) > > (In reply to comment #4) > > > understand that I could attach the eclipse java debugger to eclipse to get a > > > thread dump. I will attempt this; but I am unfamiliar with java debugger. > > > > This won't help much unless we have at least some clue where/how it crashes so > > that we can set breakpoints. > > I was thinking you could suspend the entire VM when the hang happened and it > might be possible to expand all the threads to find the offending one(s). Is > this option not be viable, Dani? Sorry, I was down the crash path. Yes, if it's indeed a hang, the Debugger could help, but in that case it should also be easily doable via Activity Manager or by sending the kill signal to the process.
(In reply to comment #7) > (In reply to comment #6) > > (In reply to comment #5) > > > (In reply to comment #4) > > > > understand that I could attach the eclipse java debugger to eclipse to get a > > > > thread dump. I will attempt this; but I am unfamiliar with java debugger. > > > > > > This won't help much unless we have at least some clue where/how it crashes so > > > that we can set breakpoints. > > > > I was thinking you could suspend the entire VM when the hang happened and it > > might be possible to expand all the threads to find the offending one(s). Is > > this option not be viable, Dani? > > Sorry, I was down the crash path. Yes, if it's indeed a hang, the Debugger > could help, but in that case it should also be easily doable via Activity > Manager or by sending the kill signal to the process. I have installed openJDK6 from macports and run eclipse using this version. Eclipse has been up for 3 days now without hanging. So it would appear that there is some difficulty with the version of Java that apple shipped with Snow Leopard. I have also downloaded the classic package of eclipse, installed the following features: Eclipse CDT P2 Customizations for SDK installation Eclipse C/C++ Development Tools Eclipse C/C++ Development Tools SDK GDB Common And then I set up a debug configuration for an 'Eclipse Application'. I am yet to do extensive testing with this debug configuration, but I have been unable to find out how to get information regarding running threads, other then a list of the thread names. From Java visualVM I can also get the list of threads running. Once eclipse hangs, the graphs/stats in visualVM also stop updating. I could send through a list of the threads and their status (e.g. running etc) as given in visualVM, but how am I to know whether these stats are from just before eclipse hangs or at the point that it hangs? I could iteratively install additional eclipse features in my `classic' install of Eclipse until I get the hang problem. Would this help locate (a little) the source of this hang?
Did you try to use the kill signal?
(In reply to comment #9) > Did you try to use the kill signal? I have tried to use the kill signal, as shown in two terminal sessions below: civengb40:~ jnewman$ jps -l 86235 sun.tools.jps.Jps 85406 civengb40:~ jnewman$ jstack 85406 85406: Unable to open socket file: target process not responding or HotSpot VM not loaded The -F option can be used when the target process is not responding civengb40:~ jnewman$ man jstack civengb40:~ jnewman$ jstack -F 85406 Attaching to process ID 85406, please wait... attach: task_for_pid(85406) failed (5) Error attaching to process: Error attaching to process, or no such process civengb40:~ jnewman$ kill -QUIT 85406 civengb40:~ jnewman$ jps -l 85406 86263 sun.tools.jps.Jps civengb40:~ jnewman$ kill -TERM 85406 civengb40:~ jnewman$ jps -l 86290 sun.tools.jps.Jps 85406 civengb40:~ jnewman$ kill -ABRT 85406 civengb40:~ jnewman$ jps -l 86295 sun.tools.jps.Jps civengb40:~ jnewman$ civengb40:~ jnewman$ jps -l 195 224 sun.tools.jps.Jps civengb40:~ jnewman$ kill -KILL 195 civengb40:~ jnewman$ No thread stack was printed to the terminal, and I have found no thread log in the working directory or eclipse's binary directory. The only log I have found that was written seems to be output from the OS, rather then JVM, which I have attached. I have continued to use openJDK for over a week now, with no problem. Once I use Mac's JVM, the problem arises again, within a few minutes of using the IDE. I am happy to keep using openJDK, as it fixes the problem I have been happening. But if there are other suggestions you have which might enable the problem to be found, let me know and I can test them out, as I am able.
Created attachment 201537 [details] MacOsX Diagnostic report upon term eclipse when it hangs
Thread 0 Crashed: Dispatch queue: com.apple.main-thread 0 libSystem.B.dylib 0x00007fff87c36d7a mach_msg_trap + 10 1 libSystem.B.dylib 0x00007fff87c37444 mach_msg + 146 2 libclient64.dylib 0x0000000122a0d863 jio_snprintf + 37661 3 libclient64.dylib 0x0000000122a0d723 jio_snprintf + 37341 4 libclient64.dylib 0x0000000122a0d682 jio_snprintf + 37180 5 libclient64.dylib 0x0000000122a0c509 jio_snprintf + 32707 6 libclient64.dylib 0x0000000122a0c44b jio_snprintf + 32517 7 libclient64.dylib 0x0000000122bb070d JVM_GetClassInterfaces + 12219 8 libclient64.dylib 0x0000000122bb0494 JVM_GetClassInterfaces + 11586 9 libclient64.dylib 0x0000000122a75ed4 JVM_Lseek + 194 10 libclient64.dylib 0x0000000122aae218 JVM_GetStackAccessControlContext + 3589 11 libswt-cocoa-3735.jnilib 0x0000000136b38cf6 callback + 676 12 libswt-cocoa-3735.jnilib 0x0000000136b18932 fn12_3 + 47 13 com.apple.CoreFoundation 0x00007fff886f9b37 __CFRunLoopDoObservers + 519 14 com.apple.CoreFoundation 0x00007fff886d563f __CFRunLoopRun + 943 15 com.apple.CoreFoundation 0x00007fff886d4dbf CFRunLoopRunSpecific + 575 16 com.apple.Foundation 0x00007fff88241c64 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 270 17 libswt-pi-cocoa-3735.jnilib 0x0000000136f9de6a Java_org_eclipse_swt_internal_cocoa_OS_objc_1msgSend_1bool__JJJJ + 58
From comment#8, problem happens only with Apple Java which is no longer supported.