Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 212970 - eclipse crashes while editing PHP file
Summary: eclipse crashes while editing PHP file
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: PDT (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P1 critical with 5 votes (vote)
Target Milestone: ---   Edit
Assignee: Roy Ganor CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-12-13 22:46 EST by Michael Tibben CLA
Modified: 2020-05-14 10:16 EDT (History)
9 users (show)

See Also:


Attachments
Log file of crashes while editing php files (222.14 KB, text/plain)
2008-05-06 06:26 EDT, Marco CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Tibben CLA 2007-12-13 22:46:10 EST
Build ID: M20071023-1652

Steps To Reproduce:
1. Open PHP file
2. start editing php file
3. crash


More information:
!ENTRY org.eclipse.wst.sse.ui 4 2 2007-12-14 14:35:50.136
!MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.wst.sse.ui".
!STACK 0
java.lang.NullPointerException
	at org.eclipse.php.internal.core.documentModel.parser.regions.PhpTokenContainer.isInside(Unknown Source)
	at org.eclipse.php.internal.core.documentModel.parser.regions.PhpTokenContainer.getToken(Unknown Source)
	at org.eclipse.php.internal.core.documentModel.parser.regions.PhpScriptRegion.getPhpToken(Unknown Source)
	at org.eclipse.php.internal.ui.actions.PHPEditorResolvingAction.isValid(Unknown Source)
	at org.eclipse.php.internal.ui.actions.OpenFunctionsManualAction.isValid(Unknown Source)
	at org.eclipse.php.internal.ui.actions.OpenFunctionsManualAction.update(Unknown Source)
	at org.eclipse.php.internal.ui.editor.PHPStructuredEditor.updateAction(Unknown Source)
	at org.eclipse.php.internal.ui.editor.PHPStructuredEditor.updateCursorDependentActions(Unknown Source)
	at org.eclipse.php.internal.ui.editor.PHPStructuredEditor.handleCursorPositionChanged(Unknown Source)
	at org.eclipse.ui.texteditor.AbstractTextEditor$16.selectionChanged(AbstractTextEditor.java:2928)
	at org.eclipse.wst.sse.ui.StructuredTextEditor$6.run(StructuredTextEditor.java:907)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
	at org.eclipse.wst.sse.ui.StructuredTextEditor$StructuredSelectionProvider.fireSelectionChanged(StructuredTextEditor.java:905)
	at org.eclipse.wst.sse.ui.StructuredTextEditor$StructuredSelectionProvider.handleSelectionChanged(StructuredTextEditor.java:974)
	at org.eclipse.wst.sse.ui.StructuredTextEditor$4.selectionChanged(StructuredTextEditor.java:880)
	at org.eclipse.jface.viewers.Viewer$2.run(Viewer.java:162)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
	at org.eclipse.core.runtime.Platform.run(Platform.java:857)
	at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:46)
	at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:199)
	at org.eclipse.jface.viewers.Viewer.fireSelectionChanged(Viewer.java:160)
	at org.eclipse.jface.text.TextViewer.fireSelectionChanged(TextViewer.java:2529)
	at org.eclipse.jface.text.TextViewer.selectionChanged(TextViewer.java:2512)
	at org.eclipse.jface.text.TextViewer$4.widgetSelected(TextViewer.java:1739)
	at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:227)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:938)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:962)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:947)
	at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:706)
	at org.eclipse.swt.custom.StyledText.sendSelectionEvent(StyledText.java:6554)
	at org.eclipse.swt.custom.StyledText.doSelection(StyledText.java:2831)
	at org.eclipse.swt.custom.StyledText.doMouseSelection(StyledText.java:2450)
	at org.eclipse.swt.custom.StyledText.doMouseLocationChange(StyledText.java:2434)
	at org.eclipse.swt.custom.StyledText.handleMouseMove(StyledText.java:5149)
	at org.eclipse.swt.custom.StyledText$7.handleEvent(StyledText.java:4804)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:938)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3682)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3293)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2389)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2353)
	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2219)
	at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:466)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:289)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:461)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:106)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:169)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:106)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:76)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:363)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:176)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:508)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:447)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1173)

!ENTRY org.eclipse.php.ui 4 4 2007-12-14 14:35:50.152
!MESSAGE null
!STACK 0
java.lang.NullPointerException
	at org.eclipse.php.internal.core.documentModel.parser.regions.PhpTokenContainer.isInside(Unknown Source)
	at org.eclipse.php.internal.core.documentModel.parser.regions.PhpTokenContainer.getToken(Unknown Source)
	at org.eclipse.php.internal.core.documentModel.parser.regions.PhpTokenContainer.getPartitionType(Unknown Source)
	at org.eclipse.php.internal.core.documentModel.parser.regions.PhpScriptRegion.getPartition(Unknown Source)
	at org.eclipse.php.internal.ui.folding.projection.ProjectionViewerInformation.inScript(Unknown Source)
	at org.eclipse.php.internal.ui.folding.projection.ProjectionViewerInformation.applyAnnotationModelChanges(Unknown Source)
	at org.eclipse.php.internal.ui.folding.projection.ProjectionViewerInformation.queueAnnotationModelChanges(Unknown Source)
	at org.eclipse.php.internal.ui.folding.projection.ProjectionModelNodeAdapterFactoryHTML.queueAnnotationModelChanges(Unknown Source)
	at org.eclipse.php.internal.ui.folding.projection.ProjectionModelNodeAdapterFactoryHTML.queueAnnotationModelChanges(Unknown Source)
	at org.eclipse.php.internal.ui.folding.projection.ProjectionModelNodeAdapterPHP.updateAdapter(Unknown Source)
	at org.eclipse.php.internal.ui.folding.projection.ProjectionModelNodeAdapterHTML.updateAdapter(Unknown Source)
	at org.eclipse.php.internal.ui.folding.StructuredTextFoldingProviderPHP.fileDataChanged(Unknown Source)
	at org.eclipse.php.internal.core.phpModel.parser.PHPWorkspaceModelManager.fileDataChanged(Unknown Source)
	at org.eclipse.php.internal.core.phpModel.parser.PHPUserModel.fireFileDataChanged(Unknown Source)
	at org.eclipse.php.internal.core.phpModel.parser.PHPUserModel.insert(Unknown Source)
	at org.eclipse.php.internal.core.phpModel.parser.DefaultParserClient.finishParsing(Unknown Source)
	at org.eclipse.php.internal.core.phpModel.parser.ParserClientComposite.finishParsing(Unknown Source)
	at org.eclipse.php.internal.core.phpModel.parser.ParserExecuter.run(Unknown Source)
	at org.eclipse.php.internal.core.phpModel.parser.PHPParserManager.parseNow(Unknown Source)
	at org.eclipse.php.internal.core.phpModel.parser.management.ProjectParsingManager.fileChanged(Unknown Source)
	at org.eclipse.php.internal.core.phpModel.parser.PHPProjectModel.fireFileChanged(Unknown Source)
	at org.eclipse.php.internal.core.phpModel.parser.PHPProjectModel.fileWasChanged(Unknown Source)
	at org.eclipse.php.internal.ui.editor.validation.PHPValidator.validate(Unknown Source)
	at org.eclipse.wst.sse.ui.internal.reconcile.validator.ReconcileStepForValidator.validate(ReconcileStepForValidator.java:339)
	at org.eclipse.wst.sse.ui.internal.reconcile.validator.ReconcileStepForValidator.reconcileModel(ReconcileStepForValidator.java:246)
	at org.eclipse.jface.text.reconciler.AbstractReconcileStep.reconcile(AbstractReconcileStep.java:96)
	at org.eclipse.wst.sse.ui.internal.reconcile.validator.ValidatorStrategy.reconcile(ValidatorStrategy.java:206)
	at org.eclipse.wst.sse.ui.internal.reconcile.DocumentRegionProcessor.process(DocumentRegionProcessor.java:183)
	at org.eclipse.wst.sse.ui.internal.reconcile.StructuredRegionProcessor.process(StructuredRegionProcessor.java:252)
	at org.eclipse.wst.sse.ui.internal.reconcile.DirtyRegionProcessor.run(DirtyRegionProcessor.java:633)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Comment 1 Gadi Goldbarg CLA 2007-12-16 06:56:01 EST
Hi Michael,
Can you send the file you tried to edit ? Works fine with files we tested.
Comment 2 Piotr Szczepanik CLA 2007-12-19 03:00:56 EST
Hi Roy,
the biggest problem with this bug is that it is not easily reproducible.

1. It happens on different files
2. The first symptom is the loosing of syntax coloring after saving of file.

Most of the times it is enough to just "add a space char, delete it and save again" to regain the coloring. Sometimes however the coloring is lost and Eclipse gets totally unresponsive with a 100% load on processor.

I have to kill Eclipse then and in the log I see similar messages: NPE at org.eclipse.php.internal.core.documentModel.parser.regions.PhpTokenContainer.isInside(Unknown
Source).

This has started being annoying after I20071209 or I20071210 build.
Comment 3 Tomas Prochazka CLA 2008-01-16 11:14:51 EST
I can confirm it. But I think that problem exist also in 1.0.2 M1 version. Because I have this peoblem with Zend Studio Neon Beta 2 and also with http://downloads.zend.com/pdt/all-in-one/pdt-1.0.2.S20071213-M1_debugger-5.2.12.v20071210-all-in-one-win32.zip

The same behavior:
lost coloring and totaly freeze
Comment 4 Piotr Szczepanik CLA 2008-01-16 11:41:31 EST
Yes, it also exists in 1.0.2 M1 because it's actually a I20071210 build.
Comment 5 David CLA 2008-02-15 05:02:47 EST
I can also confirm this bug. Hope there will be a solution soon.
Comment 6 Joshua Ross CLA 2008-02-16 12:00:28 EST
I can confirm this bug as well.  To add to what others have said, it appears to have something to do with files with classes that are greater than 1000 lines long, although that may depend on the machine eclipse is running on.  I have also noticed this happening on classes with a large number of properties and methods.  My thought is that it might be related to the outline update?  
Comment 7 Joshua Ross CLA 2008-02-16 12:25:12 EST
And I have a file that this happens on very frequently, if needed.
Comment 8 Michael Holzmann CLA 2008-03-03 01:12:57 EST
I have had this problem too, for me it was related to code folding in large files
(2000+ lines) and especially problematic with classes.  As a short term solution, I disable code folding and pdt hasn't crashed or lost code coloring since.

To disable code folding:
Window->Preferences...
PHP->Editor->Code Folding
uncheck "Enable folding"
Comment 9 Assaf Almaz CLA 2008-03-21 06:09:55 EDT
Joshua, I would appriciate if you could send us the file that requently causes this problem.
Comment 10 Marco CLA 2008-05-06 06:26:29 EDT
Created attachment 98785 [details]
Log file of crashes while editing php files

Greetings all.

I have been struggling with this same problem, here I am editing a 760 line class file, and eclipse just kept crashing, to the point that it was almost impractical to continue.
I attach this log so that it may help to shed light on this problem, I hope it is of some use.

Thank you for your continued support of this awesome platform which is Eclipse!
Regards,
 Marco
Comment 11 Roy Ganor CLA 2008-05-13 10:56:47 EDT
fixed for PDT 1.0.3 and head
Comment 12 Gadi Goldbarg CLA 2008-09-29 04:45:23 EDT
Verified Fixed.
Tested under Eclipse SDK
Version: 3.4.1
Build id: M20080911-1700

PDT 2.0.0 v20080923-1839

[Kalin Yanev kalin.a@zend.com]