Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugin causes regular "SWT Resource was not properly disposed" errors in the log #18

Open
difflaender opened this issue Jul 12, 2021 · 7 comments

Comments

@difflaender
Copy link

Using Eclipse 2021-06 with this plugin, I frequently get the following error in the log (which references MultiPageCSVEditor):

!ENTRY org.eclipse.ui.ide 4 4 2021-07-09 17:54:50.641
!MESSAGE Not properly disposed SWT resource
!STACK 0
java.lang.Error: SWT Resource was not properly disposed
	at org.eclipse.swt.graphics.Resource.initNonDisposeTracking(Resource.java:172)
	at org.eclipse.swt.graphics.Resource.<init>(Resource.java:120)
	at org.eclipse.swt.graphics.TextLayout.<init>(TextLayout.java:176)
	at org.eclipse.jface.viewers.StyledCellLabelProvider.getSharedTextLayout(StyledCellLabelProvider.java:207)
	at org.eclipse.jface.viewers.StyledCellLabelProvider.measure(StyledCellLabelProvider.java:276)
	at org.eclipse.jface.viewers.OwnerDrawLabelProvider$OwnerDrawListener.handleEvent(OwnerDrawLabelProvider.java:59)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89)
	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4209)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1043)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1067)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1052)
	at org.eclipse.swt.widgets.Table.sendMeasureItemEvent(Table.java:3648)
	at org.eclipse.swt.widgets.Table.CDDS_SUBITEMPREPAINT(Table.java:995)
	at org.eclipse.swt.widgets.Table.wmNotifyChild(Table.java:6735)
	at org.eclipse.swt.widgets.Control.wmNotify(Control.java:5814)
	at org.eclipse.swt.widgets.Composite.wmNotify(Composite.java:1954)
	at org.eclipse.swt.widgets.Control.WM_NOTIFY(Control.java:5382)
	at org.eclipse.swt.widgets.Control.windowProc(Control.java:4816)
	at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:340)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:4938)
	at org.eclipse.swt.internal.win32.OS.CallWindowProc(Native Method)
	at org.eclipse.swt.widgets.Table.callWindowProc(Table.java:588)
	at org.eclipse.swt.widgets.Table.callWindowProc(Table.java:454)
	at org.eclipse.swt.widgets.Control.windowProc(Control.java:4861)
	at org.eclipse.swt.widgets.Table.windowProc(Table.java:5813)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:4930)
	at org.eclipse.swt.internal.win32.OS.CallWindowProc(Native Method)
	at org.eclipse.swt.widgets.Table.callWindowProc(Table.java:588)
	at org.eclipse.swt.widgets.Table.callWindowProc(Table.java:454)
	at org.eclipse.swt.widgets.Control.windowProc(Control.java:4861)
	at org.eclipse.swt.widgets.Table.windowProc(Table.java:5813)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:4938)
	at org.eclipse.swt.internal.win32.OS.CallWindowProc(Native Method)
	at org.eclipse.swt.widgets.Table.callWindowProc(Table.java:588)
	at org.eclipse.swt.widgets.Table.callWindowProc(Table.java:454)
	at org.eclipse.swt.widgets.Table.WM_SETREDRAW(Table.java:6210)
	at org.eclipse.swt.widgets.Control.windowProc(Control.java:4835)
	at org.eclipse.swt.widgets.Table.windowProc(Table.java:5813)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:4930)
	at org.eclipse.swt.internal.win32.OS.SendMessage(Native Method)
	at org.eclipse.swt.widgets.Table.setRedraw(Table.java:4737)
	at org.eclipse.jface.viewers.AbstractTableViewer.inputChanged(AbstractTableViewer.java:574)
	at org.eclipse.jface.viewers.ContentViewer.setInput(ContentViewer.java:282)
	at org.eclipse.jface.viewers.StructuredViewer.setInput(StructuredViewer.java:1634)
	at org.fhsolution.eclipse.plugins.csvedit.editors.MultiPageCSVEditor.updateTableFromTextEditor(MultiPageCSVEditor.java:595)
	at org.fhsolution.eclipse.plugins.csvedit.editors.MultiPageCSVEditor.access$1(MultiPageCSVEditor.java:480)
	at org.fhsolution.eclipse.plugins.csvedit.editors.MultiPageCSVEditor$7.run(MultiPageCSVEditor.java:456)
	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:40)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:185)
	at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4001)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3629)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1157)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1046)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:155)
	at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:644)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:551)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:156)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:152)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:401)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:654)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:591)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1462)

I could not pinpoint it to any specific action I perform with the CSV editor, though. I also did not check if this also occurs in older Eclipse versions or whether it's a new regression that only affects current versions.

@paulvi
Copy link
Collaborator

paulvi commented Jul 14, 2021

Most likely some API change in the latest Eclipse.
HELP IS WANTED, see https://github.com/Mathieuu/CsvEdit#status

Have you tried mvn package to build?

@difflaender
Copy link
Author

I get the following error on packaging it, but I have no idea how to resolve it:

[ERROR] Cannot resolve project dependencies:
[ERROR]   Software being installed: org.fhsolution.eclipse.plugins.csvedit 1.2.0
[ERROR]   Missing requirement: org.eclipse.core.jobs 3.11.0.v20210420-1453 requires 'osgi.ee; (&(osgi.ee=JavaSE)(version=1.8))' but it could not be found

As far as I can tell, that's a dependency that is not directly referenced by this project but by the dependency org.eclipse.core.runtime, so the latter should make sure to actually satisfy it.

@paulvi
Copy link
Collaborator

paulvi commented Jul 15, 2021

It is strange that new and fresh version 3.11.0.v20210420-1453 is there

while https://github.com/Mathieuu/CsvEdit/blob/master/pom.xml#L27
defines old luna repository

I'd try to point to the latest Eclipse repo, what is current Eclipse codename?

New build should be for the newest Ecipse, and maybe Java as Java 11

@difflaender
Copy link
Author

The current code name is "2021-06", the version is 4.20.
I already changed the POM to point to that repository in my working copy, which is how that fresh dependency got there in my build.

I did leave the Java version at 8, though. Not sure how much would need to be changed to make it work with Java 11 and its new module system otherwise.

@paulvi
Copy link
Collaborator

paulvi commented Jul 16, 2021

One can use Java 11 and even Java 16/17 without knowing/caring about new module system.

For exact Eclipse build, I'd suggest try to contact @Mathieuu if he still looks here,
than ask on https://stackoverflow.com/questions/tagged/eclipse

And for some weird situation raise as bug on https://bugs.eclipse.org/bugs/

I am sorry, I have not been touching Eclipse for 1-2 year, and do it just to improve plugin (that I would not use anyways) is against common sense. I do care, that some repositories, I moved forward, would continue.
For example for this code base Henry #10 was first, @Mathieuu is actually second person, and I was the third by just making maven/tycho build and releasing binaries, making new marketplace entry.

@paulvi
Copy link
Collaborator

paulvi commented Jul 16, 2021

Exactly this bug with stack trace above is good question for https://stackoverflow.com/questions/tagged/eclipse

@gnl42
Copy link

gnl42 commented Jan 9, 2024

For what it is worth, I forked the the repo and fix this and a few other issues: https://github.com/gnl42/CsvEdit2

Update site at https://gnl42.github.io/CsvEdit2-update/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants