| Summary: | [Cocoa] OS X: NPE in Control.internal_new_GC | ||
|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Lakshmi P Shanmugam <lshanmug> |
| Component: | SWT | Assignee: | Platform-SWT-Inbox <platform-swt-inbox> |
| Status: | CLOSED DUPLICATE | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | abhishek.kishore, adripol1994, alexander.stahlberg, andreas.buchen, arunkumar.thondapu, boingolover, dave.nice, eclipse, error-reports-inbox, eyck, gattacus, larrylebron, lshanmug, mail, malaperle, marcel.bruch, nick, niraj.modi, picard, pujos.michael, register.eclipse, superstippi, tom.schindl |
| Version: | 4.4 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Mac OS X | ||
| See Also: | https://bugs.eclipse.org/bugs/show_bug.cgi?id=547399 | ||
| Whiteboard: | |||
| Bug Depends on: | |||
| Bug Blocks: | 482454, 494879, 516837 | ||
|
Description
Lakshmi P Shanmugam
NPE occurs when GC constructor is called in some cases. For ex: https://dev.eclipse.org/recommenders/committers/confess/#/problems/55cc3af7e4b0176300a7b2b0/ -- https://dev.eclipse.org/recommenders/committers/confess/#/problems/56434cf9e4b0c02da2cfeb42/ From https://bugs.eclipse.org/bugs/show_bug.cgi?id=434393#c35 java.lang.NullPointerException at org.eclipse.swt.widgets.Control.internal_new_GC(Control.java:2174) at org.eclipse.swt.graphics.GC.<init>(GC.java:174) at org.eclipse.swt.graphics.GC.<init>(GC.java:135) at org.eclipse.swt.custom.StyledTextRenderer.setFont(StyledTextRenderer.java:1108) at org.eclipse.swt.custom.StyledText.<init>(StyledText.java:1252) ... I consistently get this on osx. Context: I am working on an XText project, and test it by launching an Eclipse runtime instance from my main eclipse instance. The error then regularly shows up in the main instance. Please contact me if I can help get you any data. Here is the most recent stack trace: !ENTRY org.eclipse.ui 4 0 2016-03-02 11:58:01.754 !MESSAGE Unhandled event loop exception !STACK 0 java.lang.NullPointerException at org.eclipse.swt.widgets.Control.internal_new_GC(Control.java:2124) at org.eclipse.swt.graphics.GC.cocoa_new(GC.java:210) at org.eclipse.swt.widgets.Tree.sendMeasureItem(Tree.java:2596) at org.eclipse.swt.widgets.Tree.cellSize(Tree.java:288) at org.eclipse.swt.widgets.Display.windowProc(Display.java:5582) at org.eclipse.swt.internal.cocoa.OS.objc_msgSendSuper_stret(Native Method) at org.eclipse.swt.widgets.Widget.expansionFrameWithFrame_inView(Widget.java:814) at org.eclipse.swt.widgets.Tree.expansionFrameWithFrame_inView(Tree.java:1274) at org.eclipse.swt.widgets.Display.windowProc(Display.java:5961) at org.eclipse.swt.internal.cocoa.OS.objc_msgSend_bool(Native Method) at org.eclipse.swt.internal.cocoa.NSRunLoop.runMode(NSRunLoop.java:42) at org.eclipse.swt.widgets.Display.sleep(Display.java:4740) at org.eclipse.ui.application.WorkbenchAdvisor.eventLoopIdle(WorkbenchAdvisor.java:368) at org.eclipse.ui.internal.ide.application.IDEWorkbenchAdvisor.eventLoopIdle(IDEWorkbenchAdvisor.java:858) at org.eclipse.ui.internal.Workbench$3.eventLoopIdle(Workbench.java:517) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$4.run(PartRenderingEngine.java:1132) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:337) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1018) at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:156) at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:654) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:337) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:598) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:139) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) 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:380) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:669) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:608) at org.eclipse.equinox.launcher.Main.run(Main.java:1515) at org.eclipse.equinox.launcher.Main.main(Main.java:1488) Adding version and os info: Eclipse: Version: Mars.1 (4.5.1) Build id: M20150904-0015 OSX 10.11.2 (In reply to Larry LeBron from comment #2) > I consistently get this on osx. > > Here is the most recent stack trace: > > !ENTRY org.eclipse.ui 4 0 2016-03-02 11:58:01.754 > !MESSAGE Unhandled event loop exception > !STACK 0 > java.lang.NullPointerException > at org.eclipse.swt.widgets.Control.internal_new_GC(Control.java:2124) > at org.eclipse.swt.graphics.GC.cocoa_new(GC.java:210) > at org.eclipse.swt.widgets.Tree.sendMeasureItem(Tree.java:2596) > at org.eclipse.swt.widgets.Tree.cellSize(Tree.java:288) > at org.eclipse.swt.widgets.Display.windowProc(Display.java:5582) > at org.eclipse.swt.internal.cocoa.OS.objc_msgSendSuper_stret(Native Method) > at > org.eclipse.swt.widgets.Widget.expansionFrameWithFrame_inView(Widget.java: > 814) This problem has been fixed in Eclipse 4.5.2 through bug 434393. Please try with the latest 4.5.2 version. Can this bug be closed? I am no longer seeing the issue. *** This bug has been marked as a duplicate of bug 434393 *** We've got this stacktrace again with SWT version 4.756: java.lang.NullPointerException at org.eclipse.swt.widgets.Control.internal_new_GC(Control.java:2176) at org.eclipse.swt.graphics.GC.<init>(GC.java:174) at org.eclipse.swt.graphics.GC.<init>(GC.java:135) at org.eclipse.swt.custom.StyledTextRenderer.setFont(StyledTextRenderer.java:1118) at org.eclipse.swt.custom.StyledText.<init>(StyledText.java:1256) The code reads: graphicsContext = NSGraphicsContext.graphicsContextWithWindow (window); NSGraphicsContext flippedContext = NSGraphicsContext.graphicsContextWithGraphicsPort(graphicsContext.graphicsPort(), true); graphicsContext = flippedContext; where graphicsContext seems to be null which is possible in NSGraphicsContext.graphicsContextWithWindow(). Users (still) report it with SWT version 4.919: java.lang.NullPointerException at org.eclipse.swt.widgets.Control.internal_new_GC(Control.java:2180) at org.eclipse.swt.graphics.GC.<init>(GC.java:177) at org.eclipse.swt.graphics.GC.<init>(GC.java:138) at org.eclipse.swt.custom.CTabFolder.updateTabHeight(CTabFolder.java:3810) Happens in the same code fragment as reported in comment #8. (In reply to Andreas Buchen from comment #9) > Users (still) report it with SWT version 4.919: > > java.lang.NullPointerException > at org.eclipse.swt.widgets.Control.internal_new_GC(Control.java:2180) > at org.eclipse.swt.graphics.GC.<init>(GC.java:177) > at org.eclipse.swt.graphics.GC.<init>(GC.java:138) > at org.eclipse.swt.custom.CTabFolder.updateTabHeight(CTabFolder.java:3810) > This is probably bug 547399 |