Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 353026

Summary: Crashes randomly while editing C/C++ files.
Product: [Tools] CDT Reporter: lucnoc
Component: cdt-editorAssignee: Project Inbox <cdt-editor-inbox>
Status: CLOSED DUPLICATE QA Contact: Anton Leherbauer <aleherb+eclipse>
Severity: critical    
Priority: P3 CC: cdtdoug, ob1.eclipse
Version: 7.0   
Target Milestone: ---   
Hardware: Macintosh   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:

Description lucnoc CLA 2011-07-25 14:11:28 EDT
Build Identifier: 20110615-0604

I am using the 64 bits version of Eclipse C/C++ edition. I have random hangs happen when editing; mostly when saving (using key-binging) but also happens while typing. Tried to run with MALLOC_CHECK=0 ./eclipse and double clicking the Eclipse icon with the same results.  eclipse.ini is the stock file except for the last line (which does not seem to make any difference):

---
cat Eclipse.app/Contents/MacOS/eclipse.ini 
-startup
../../../plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar
--launcher.library
../../../plugins/org.eclipse.equinox.launcher.cocoa.macosx.x86_64_1.1.100.v20110502
-product
org.eclipse.epp.package.cpp.product
--launcher.defaultAction
openFile
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
-vmargs
-Dosgi.requiredJavaVersion=1.5
-XstartOnFirstThread
-Dorg.eclipse.swt.internal.carbon.smallFonts
-XX:MaxPermSize=256m
-Xms40m
-Xmx384m
-Xdock:icon=../Resources/Eclipse.icns
-XstartOnFirstThread
-Dorg.eclipse.swt.internal.carbon.smallFonts
-XX:-UseCompressedOops
---

I get the following problem report (top portion):

---

Date/Time:       2011-07-25 10:43:46 -0700
OS Version:      10.6.8 (Build 10K540)
Architecture:    x86_64
Report Version:  7

Command:         Eclipse
Path:            /Applications/Eclipse/Eclipse.app/Contents/MacOS/eclipse
Version:         3.7 (3.7)
Parent:          launchd [95]

PID:             36986
Event:           hang
Duration:        8.71s (sampling started after 2 seconds)
Steps:           47 (100ms sampling interval)

Pageins:         0
Pageouts:        0


Process:         eclipse [36986]
Path:            /Applications/Eclipse/Eclipse.app/Contents/MacOS/eclipse
UID:             501

  Thread 7113f      DispatchQueue 1
  User stack:
    47 ??? [0x118006a82]
      47 ??? [0x118006a82]
        47 ??? [0x118011d4e]
          47 Java_org_eclipse_swt_internal_cocoa_OS_objc_1msgSend_1bool__JJJJ + 58 (in libswt-pi-cocoa-3735.jnilib) [0x14badee6a]
            47 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 270 (in Foundation) [0x7fff89119c64]
              47 CFRunLoopRunSpecific + 575 (in CoreFoundation) [0x7fff84db3dbf]
                47 __CFRunLoopRun + 943 (in CoreFoundation) [0x7fff84db463f]
                  47 __CFRunLoopDoObservers + 519 (in CoreFoundation) [0x7fff84dd8b37]
                    47 fn12_3 + 47 (in libswt-cocoa-3735.jnilib) [0x14ba05932]
                      47 callback + 676 (in libswt-cocoa-3735.jnilib) [0x14ba25cf6]
                        47 JVM_GetStackAccessControlContext + 3589 (in libclient64.dylib) [0x1158ae218]
                          47 JVM_Lseek + 194 (in libclient64.dylib) [0x115875ed4]
                            47 JVM_GetClassInterfaces + 11586 (in libclient64.dylib) [0x1159b0494]
                              47 JVM_GetClassInterfaces + 12219 (in libclient64.dylib) [0x1159b070d]
                                47 jio_snprintf + 32517 (in libclient64.dylib) [0x11580c44b]
                                  47 jio_snprintf + 32707 (in libclient64.dylib) [0x11580c509]
                                    47 jio_snprintf + 37180 (in libclient64.dylib) [0x11580d682]
                                      47 jio_snprintf + 37341 (in libclient64.dylib) [0x11580d723]
                                        47 jio_snprintf + 37661 (in libclient64.dylib) [0x11580d863]
                                          47 mach_msg_trap + 10 (in libSystem.B.dylib) [0x7fff882cbd7a]
---

Here is another problem report:

---
Date/Time:       2011-07-25 11:08:08 -0700
OS Version:      10.6.8 (Build 10K540)
Architecture:    x86_64
Report Version:  7

Command:         Eclipse
Path:            /Applications/Eclipse/Eclipse.app/Contents/MacOS/eclipse
Version:         3.7 (3.7)
Parent:          launchd [95]

PID:             37232
Event:           hang
Duration:        8.57s (sampling started after 2 seconds)
Steps:           45 (100ms sampling interval)

Pageins:         0
Pageouts:        0


Process:         eclipse [37232]
Path:            /Applications/Eclipse/Eclipse.app/Contents/MacOS/eclipse
UID:             501

  Thread 71e3d      DispatchQueue 1
  User stack:
    45 start + 33 (in eclipse) [0x100000ff1]
      45 _start + 227 (in eclipse) [0x1000010d5]
        45 main + 1230 (in eclipse) [0x100001ef9]
          45 original_main + 1809 (in eclipse) [0x100001927]
            45 run + 4645 (in eclipse_1406.so) [0x10070b745]
              45 startJavaVM + 134 (in eclipse_1406.so) [0x10070cf76]
                45 startJavaJNI + 2138 (in eclipse_1406.so) [0x10070e418]
                  45 JVM_GetClassInterfaces + 6866 (in libclient64.dylib) [0x1152af224]
                    45 JVM_MonitorWait + 10881 (in libclient64.dylib) [0x1151b3fe1]
                      45 JVM_Lseek + 192620 (in libclient64.dylib) [0x1151a4e7e]
                        45 JVM_Lseek + 193192 (in libclient64.dylib) [0x1151a50ba]
                          45 ??? [0x117801431]
                            45 ??? [0x11780685a]
                              45 ??? [0x11780685a]
                                45 ??? [0x1178069b3]
                                  45 ??? [0x117806e8d]
                                    45 ??? [0x1178069b3]
                                      45 ??? [0x1178069b3]
                                        45 ??? [0x117811d4e]
                                          45 JVM_InvokeMethod + 78 (in libjvmlinkage.dylib) [0x10271de0e]
                                            45 JVM_InvokeMethod + 352 (in libclient64.dylib) [0x1151be460]
                                              45 JVM_InvokeMethod + 922 (in libclient64.dylib) [0x1151be69a]
                                                45 JVM_NewInstanceFromConstructor + 3239 (in libclient64.dylib) [0x1151bd508]
                                                  45 JVM_Lseek + 192620 (in libclient64.dylib) [0x1151a4e7e]
                                                    45 JVM_Lseek + 193192 (in libclient64.dylib) [0x1151a50ba]
                                                      45 ??? [0x117801431]
                                                        45 ??? [0x1178069b3]
                                                          45 ??? [0x1178069b3]
                                                            45 ??? [0x1178069b3]
                                                              45 ??? [0x117806e8d]
                                                                45 ??? [0x117806e8d]
                                                                  45 ??? [0x11780696e]
                                                                    45 ??? [0x11780696e]
                                                                      45 ??? [0x11780685a]
                                                                        45 ??? [0x117806d34]
                                                                          45 ??? [0x11780696e]
                                                                            45 ??? [0x11780696e]
                                                                              45 ??? [0x11780685a]
                                                                                45 ??? [0x11780685a]
                                                                                  45 ??? [0x11780685a]
                                                                                    45 ??? [0x117806a82]
                                                                                      45 ??? [0x117806a82]
                                                                                        45 ??? [0x117806a82]
                                                                                          45 ??? [0x117811d4e]
                                                                                            45 Java_org_eclipse_swt_internal_cocoa_OS_objc_1msgSend_1bool__JJJJ + 58 (in libswt-pi-cocoa-3735.jnilib) [0x14c3e4e6a]
                                                                                              45 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 270 (in Foundation) [0x7fff89119c64]
                                                                                                45 CFRunLoopRunSpecific + 575 (in CoreFoundation) [0x7fff84db3dbf]
                                                                                                  45 __CFRunLoopRun + 943 (in CoreFoundation) [0x7fff84db463f]
                                                                                                    45 __CFRunLoopDoObservers + 519 (in CoreFoundation) [0x7fff84dd8b37]
                                                                                                      45 fn12_3 + 47 (in libswt-cocoa-3735.jnilib) [0x14c30b932]
                                                                                                        45 callback + 676 (in libswt-cocoa-3735.jnilib) [0x14c32bcf6]
                                                                                                          45 JVM_GetStackAccessControlContext + 3589 (in libclient64.dylib) [0x1151ae218]
                                                                                                            45 JVM_Lseek + 194 (in libclient64.dylib) [0x115175ed4]
                                                                                                              45 JVM_GetClassInterfaces + 11586 (in libclient64.dylib) [0x1152b0494]
                                                                                                                45 JVM_GetClassInterfaces + 12219 (in libclient64.dylib) [0x1152b070d]
                                                                                                                  45 jio_snprintf + 32517 (in libclient64.dylib) [0x11510c44b]
                                                                                                                    45 jio_snprintf + 32707 (in libclient64.dylib) [0x11510c509]
                                                                                                                      45 jio_snprintf + 37180 (in libclient64.dylib) [0x11510d682]
                                                                                                                        45 jio_snprintf + 37341 (in libclient64.dylib) [0x11510d723]
                                                                                                                          45 jio_snprintf + 37661 (in libclient64.dylib) [0x11510d863]
                                                                                                                            45 mach_msg_trap + 10 (in libSystem.B.dylib) [0x7fff882cbd7a]

---
Note that I have this problem also with previous versions of Eclipse. This does seem to happen when editing C++ files - I could trigger-it with text files and Makefiles.


Reproducible: Sometimes

Steps to Reproduce:
1. Open C++ file from project
2. Edit.
3. Crashes after a while while typing (few minutes to days).
Comment 1 lucnoc CLA 2011-07-25 14:20:03 EDT
Above, I meant to write : I could NOT trigger-it with text files and Makefiles.

Also this is the bottom part of the problem report with the hardware configuration if that is of any use:

---
Model: MacBookPro8,2, BootROM MBP81.0047.B0E, 4 processors, Intel Core i7, 2.2 GHz, 8 GB, SMC 1.69f1
Graphics: AMD Radeon HD 6750M, AMD Radeon HD 6750M, PCIe, 1024 MB
Graphics: Intel HD Graphics 3000, Intel HD Graphics 3000, Built-In, 512 MB
Memory Module: global_name
AirPort: spairport_wireless_card_type_airport_extreme (0x14E4, 0xD6), Broadcom BCM43xx 1.0 5.100.198.104.5)
Bluetooth: Version 2.4.5f3, 2 service, 12 devices, 1 incoming serial ports
Network Service: AirPort, AirPort, en1
Serial ATA Device: APPLE SSD TS256C, 233.76 GB
Serial ATA Device: MATSHITADVD-R   UJ-8A8
USB Device: FaceTime HD Camera (Built-in), 0x05ac  (Apple Inc.), 0x8509, 0xfa200000 / 3
USB Device: Hub, 0x0424  (SMSC), 0x2513, 0xfa100000 / 2
USB Device: BRCM2070 Hub, 0x0a5c  (Broadcom Corp.), 0x4500, 0xfa110000 / 5
USB Device: Bluetooth USB Host Controller, 0x05ac  (Apple Inc.), 0x821a, 0xfa113000 / 6
USB Device: Apple Internal Keyboard / Trackpad, 0x05ac  (Apple Inc.), 0x0245, 0xfa120000 / 4
USB Device: Hub, 0x0424  (SMSC), 0x2513, 0xfd100000 / 2
USB Device: Lenovo Laser Mouse, 0x17ef  (Lenovo), 0x6000, 0xfd120000 / 4
USB Device: IR Receiver, 0x05ac  (Apple Inc.), 0x8242, 0xfd110000 / 3
---
Comment 2 Oleg Besedin CLA 2011-07-25 15:35:21 EDT
(In reply to comment #0)
> I am using the 64 bits version of Eclipse C/C++ edition. I have random hangs
> happen when editing...

Did you check to see if you are running out of memory - either Heap or PermGen? 

If that is not the case, re-installing parts of the stack (Eclipse, workspace, JVM) to make sure that they aren't corrupted would be a next step.
Comment 3 lucnoc CLA 2011-07-27 18:55:16 EDT
(In reply to comment #2)
> (In reply to comment #0)
> > I am using the 64 bits version of Eclipse C/C++ edition. I have random hangs
> > happen when editing...
> 
> Did you check to see if you are running out of memory - either Heap or PermGen? 

Looking at the Activity Monitor memory does not seem to run out. If there is a better way to check this let me know.

> If that is not the case, re-installing parts of the stack (Eclipse, workspace,
> JVM) to make sure that they aren't corrupted would be a next step.

Removing the workspace folder alone does not help.
One time I got it working for several hours removing the workspace and the .project, .cproject and .settings folders in the source tree. However, this behavior is not seem to be consistent, so that does not help much. Once eclipse hangs once, restarting will cause it to hang again, usually after a few keystrokes.

I am running the stock version of the JVM coming with OSX snow leopard (version 1.6.0_26). Not sure how to force a reinstall - please tell me if you know how to reinstall java or have other suggestions on what I should try.
Comment 4 Anton Leherbauer CLA 2011-08-05 03:09:26 EDT
This sounds similar to bug 345970.  Could you try the same workaround and add -Xint to the JVM options?
You can also try to get a JVM thread dump at the time of the hang. See http://wiki.eclipse.org/How_to_report_a_deadlock for details on how to get one.
Comment 5 lucnoc CLA 2011-08-11 19:03:13 EDT
(In reply to comment #4)
> This sounds similar to bug 345970.  Could you try the same workaround and add
> -Xint to the JVM options?
> You can also try to get a JVM thread dump at the time of the hang. See
> http://wiki.eclipse.org/How_to_report_a_deadlock for details on how to get one.

Yes using -Xint eclipse does not hang any more (I've tested this over a week). I also tried to get a JVM thread dump when running without -Xint, but when eclipse hangs both jvisualvm and jps/jstack seem also to wait indefinitely - I could try the "kill method from http://wiki.eclipse.org/How_to_report_a_deadlock if you think it's useful. Thanks again Anton.
Comment 6 Anton Leherbauer CLA 2011-08-12 02:22:46 EDT
(In reply to comment #5)
> (In reply to comment #4)
> > This sounds similar to bug 345970.  Could you try the same workaround and add
> > -Xint to the JVM options?
> > You can also try to get a JVM thread dump at the time of the hang. See
> > http://wiki.eclipse.org/How_to_report_a_deadlock for details on how to get one.
> 
> Yes using -Xint eclipse does not hang any more (I've tested this over a week).

Thanks, that confirms that this is a JVM issue with the JIT compiler.

> I also tried to get a JVM thread dump when running without -Xint, but when
> eclipse hangs both jvisualvm and jps/jstack seem also to wait indefinitely - I
> could try the "kill method from
> http://wiki.eclipse.org/How_to_report_a_deadlock if you think it's useful.

I doubt that kill -QUIT would work in this case, but it's worth a try.

*** This bug has been marked as a duplicate of bug 345970 ***
Comment 7 lucnoc CLA 2011-08-29 13:37:41 EDT
> > I also tried to get a JVM thread dump when running without -Xint, but when
> > eclipse hangs both jvisualvm and jps/jstack seem also to wait indefinitely - I
> > could try the "kill method from
> > http://wiki.eclipse.org/How_to_report_a_deadlock if you think it's useful.
> 
> I doubt that kill -QUIT would work in this case, but it's worth a try.

Tried kill -3 but you guessed right it nothing.