Eclipse Helios on OS X Snow Leopard crashes frequently when editing certain PHP files

Posted by William on Super User See other posts from Super User or by William
Published on 2011-01-17T01:49:27Z Indexed on 2011/01/17 1:55 UTC
Read the original article Hit count: 396

Filed under:
|
|

I use Eclipse Helios (Eclipse Platform: 3.6.0.I20100608-0911, Eclipse IDE for PHP Developers: 1.3.0.20100617-0520) all the time on OS X (Snow Leopard), and it seems I only run into trouble whenever I'm editing a PHP file that's part of the WordPress blogging framework. When I move my cursor to a variable or function name, that often triggers the beach ball of death. I suspect Eclipse is trying to look up that variable/function and for some reason that causes an endless loop.

Sometimes it's not just variables or functions. Just today I was trying to replace all occurrences of a quoted string. Every time I clicked "Replace All", the program would freeze immediately after the string was replaced and the text cursor was moved to the replaced position. I think the moving of the text cursor is important, because I got the same result when I searched for the string (thus moving the cursor), but NOT when I searched for a nonexistent string.

I tried disabling everything in my preferences related to marked occurrences, hovering, code assistance, etc. Nothing helps.

I use Eclipse for all my projects, and I find that it's only WordPress projects where this happens. Here's my eclipse.ini file:

-startup
../../../plugins/org.eclipse.equinox.launcher_1.1.0.v20100507.jar
--launcher.library
../../../plugins/org.eclipse.equinox.launcher.cocoa.macosx_1.1.0.v20100503
-product
org.eclipse.epp.package.php.product
--launcher.defaultAction
openFile
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
512m
--launcher.defaultAction
openFile
-vmargs
-Dosgi.requiredJavaVersion=1.5
-XstartOnFirstThread
-Dorg.eclipse.swt.internal.carbon.smallFonts
-XX:PermSize=128m
-XX:MaxPermSize=128m
-XX:MaxGCPauseMillis=10
-XX:MaxHeapFreeRatio=70
-XX:+UseConcMarkSweepGC
-XX:+CMSIncrementalMode
-XX:+CMSIncrementalPacing
-XX:CompileThreshold=5
-Xms128m
-Xmx512m
-Xss2m
-Xdock:icon=../Resources/Eclipse.icns
-XstartOnFirstThread
-Dorg.eclipse.swt.internal.carbon.smallFonts
-framework
../../../plugins/org.eclipse.osgi.services_3.2.100.v20100503.jar

I have 4GB of RAM, so I don't know if the problem is I'm underutilizing my resources. Here's what I see over and over in the error log:

!ENTRY org.eclipse.jface 2 0 2011-01-16 16:26:21.533
!MESSAGE Keybinding conflicts occurred. They may interfere with normal accelerator operation.
!SUBENTRY 1 org.eclipse.jface 2 0 2011-01-16 16:26:21.533
!MESSAGE A conflict occurred for ALT+COMMAND+Q P:
Binding(ALT+COMMAND+Q P,
ParameterizedCommand(Command(org.eclipse.ui.views.showView,Show View,
Shows a particular view,
Category(org.eclipse.ui.category.views,Views,Commands for opening views,true),
org.eclipse.ui.handlers.ShowViewHandler@2a46d1,
[Lorg.eclipse.ui.internal.commands.Parameter;@18f50c2,,true), [Lorg.eclipse.core.commands.Parameterization;@1ff1855),
org.eclipse.ui.defaultAcceleratorConfiguration,
org.eclipse.ui.contexts.window,,cocoa,system)
Binding(ALT+COMMAND+Q P,
ParameterizedCommand(Command(org.eclipse.ui.views.showView,Show View,
Shows a particular view,
Category(org.eclipse.ui.category.views,Views,Commands for opening views,true),
org.eclipse.ui.handlers.ShowViewHandler@2a46d1,
[Lorg.eclipse.ui.internal.commands.Parameter;@18f50c2,,true), [Lorg.eclipse.core.commands.Parameterization;@96b40c),
org.eclipse.ui.defaultAcceleratorConfiguration,
org.eclipse.ui.contexts.window,,cocoa,system)

!ENTRY org.eclipse.core.net 1 0 2011-01-16 16:26:22.217
!MESSAGE System property http.proxyHost has been set to 127.0.0.1 by an external source. This value will be overwritten using the values from the preferences

!ENTRY org.eclipse.core.net 1 0 2011-01-16 16:26:22.217
!MESSAGE System property http.proxyPort has been set to 8888 by an external source. This value will be overwritten using the values from the preferences

!ENTRY org.eclipse.core.net 1 0 2011-01-16 16:26:22.218
!MESSAGE System property https.proxyHost has been set to 127.0.0.1 by an external source. This value will be overwritten using the values from the preferences

!ENTRY org.eclipse.core.net 1 0 2011-01-16 16:26:22.219
!MESSAGE System property https.proxyPort has been set to 8888 by an external source. This value will be overwritten using the values from the preferences

I did some experimenting with the particular script that's giving me trouble. It's a hybrid of HTML and PHP, so Eclipse has to do both HTML and PHP validation. I wondered if the HTML validation had something to do with it, so I created a new file, copied the contents over, and messed with the doctype element. I found that if I replaced the well-formed XHTML 1.0 Strict doctype element with a generic doctype (as such: <!DOCTYPE html>), then I did not crash the program just by moving the cursor around.

I set all HTML validation rules to "Ignore", but it still didn't solve my problems. For now, I'm just going to echo the doctype using PHP instead of entering it literally. That seems to prevent crashes. I notice that when I move the cursor around the document, Eclipse displays the "xpath" to my current location at the bottom of the screen. Sometimes there's a delay while it figures out my current path. Perhaps when it's validating against the Strict doctype, it has problems quickly calculating the xpath as I move the cursor around? Maybe it has a stack overflow that causes it to crash.

© Super User or respective owner

Related posts about osx-snow-leopard

Related posts about php