Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 327329 - NullPointerException in org.eclipse.cdt.managedbuilder.internal.core.CommonBuilder.build
Summary: NullPointerException in org.eclipse.cdt.managedbuilder.internal.core.CommonBu...
Status: NEW
Alias: None
Product: CDT
Classification: Tools
Component: cdt-build-managed (show other bugs)
Version: 7.0.1   Edit
Hardware: PC Linux
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Jonah Graham CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-08 08:03 EDT by Paul Lammertsma CLA
Modified: 2020-09-04 15:19 EDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Paul Lammertsma CLA 2010-10-08 08:03:35 EDT
Build Identifier: M20100909-0800

I'm working on an Android project that contains some JNI. In order to have the C code compiled before running the Java application, I've tried setting up a Make Target for my project, such that "sh build.sh" runs before the Android packager.

When I try to build, I receive an "error running builder 'CDT Builder' on project", with stack trace:

java.lang.NullPointerException
	at org.eclipse.cdt.managedbuilder.internal.core.CommonBuilder.build(CommonBuilder.java:517)
	at org.eclipse.cdt.managedbuilder.internal.core.CommonBuilder.build(CommonBuilder.java:498)
	at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:629)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:172)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:282)
	at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:363)
	at org.eclipse.core.internal.resources.Project$1.run(Project.java:545)
	at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1975)
	at org.eclipse.core.internal.resources.Project.internalBuild(Project.java:524)
	at org.eclipse.core.internal.resources.Project.build(Project.java:123)
	at org.eclipse.cdt.make.internal.core.MakeTarget$1.run(MakeTarget.java:323)
	at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1975)
	at org.eclipse.cdt.make.internal.core.MakeTarget.build(MakeTarget.java:336)
	at org.eclipse.cdt.make.ui.TargetBuild$1$1.run(TargetBuild.java:102)
	at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1975)
	at org.eclipse.cdt.make.ui.TargetBuild$1.run(TargetBuild.java:105)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)

Incidentally, I receive an error displaying the project's "C++ Builder" property page:

java.lang.NullPointerException
	at org.eclipse.cdt.managedbuilder.ui.properties.BuildBehaviourTab.applyToCfg(BuildBehaviourTab.java:432)
	at org.eclipse.cdt.managedbuilder.ui.properties.BuildBehaviourTab.apply(BuildBehaviourTab.java:426)
	at org.eclipse.cdt.managedbuilder.ui.properties.BuilderSettingsTab.performApply(BuilderSettingsTab.java:314)
	at org.eclipse.cdt.ui.newui.AbstractCPropertyTab.handleTabEvent(AbstractCPropertyTab.java:521)
	at org.eclipse.cdt.ui.newui.AbstractPage.forEach(AbstractPage.java:1018)
	at org.eclipse.cdt.ui.newui.AbstractPage$5.run(AbstractPage.java:646)
	at org.eclipse.ui.actions.WorkspaceModifyDelegatingOperation.execute(WorkspaceModifyDelegatingOperation.java:69)
	at org.eclipse.ui.actions.WorkspaceModifyOperation$1.run(WorkspaceModifyOperation.java:106)
	at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1975)
	at org.eclipse.ui.actions.WorkspaceModifyOperation.run(WorkspaceModifyOperation.java:118)
	at org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:464)
	at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:372)
	at org.eclipse.jface.dialogs.ProgressMonitorDialog.run(ProgressMonitorDialog.java:507)
	at org.eclipse.ui.internal.progress.ProgressManager$RunnableWithStatus.run(ProgressManager.java:1346)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
	at org.eclipse.ui.internal.progress.ProgressManager$7.run(ProgressManager.java:1184)
	at org.eclipse.swt.widgets.Synchronizer.syncExec(Synchronizer.java:179)
	at org.eclipse.ui.internal.UISynchronizer.syncExec(UISynchronizer.java:150)
	at org.eclipse.swt.widgets.Display.syncExec(Display.java:4282)
	at org.eclipse.ui.internal.progress.ProgressManager.runInUI(ProgressManager.java:1182)
	at org.eclipse.cdt.ui.newui.AbstractPage.performSave(AbstractPage.java:665)
	at org.eclipse.cdt.ui.newui.AbstractPage.performApply(AbstractPage.java:519)
	at org.eclipse.jface.preference.PreferencePage$2.widgetSelected(PreferencePage.java:281)
	at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:234)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1258)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3540)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3161)
	at org.eclipse.jface.window.Window.runEventLoop(Window.java:825)
	at org.eclipse.jface.window.Window.open(Window.java:801)
	at org.eclipse.ui.dialogs.PropertyDialogAction.run(PropertyDialogAction.java:157)
	at org.eclipse.jface.action.Action.runWithEvent(Action.java:498)
	at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:584)
	at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:501)
	at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:411)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1258)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3540)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3161)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2640)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2604)
	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2438)
	at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:671)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:664)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:616)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:619)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1407)

This more or less inhibits me from using CDT. I'm using the latest Helios version:
   C/C++ Development Tools    7.0.1.201009141542    org.eclipse.cdt.feature.group

Reproducible: Always

Steps to Reproduce:
1. Create a new Android project
2. Add a Make Target
3. Build
(4. Additionally, view project's "C++ Builder" property page)
Comment 1 Paul Lammertsma CLA 2010-10-08 08:05:04 EDT
I feel compelled to mention that I have Sequoyah Android Native Code Support installed, but I don't believe this is causing any of the CDT-related problems.
Comment 2 Andrew Gvozdev CLA 2010-10-08 09:02:24 EDT
Can you attach your .project and .cproject (or .cdtbuild?)?
Comment 3 Marc-André Laperle CLA 2010-10-09 00:13:37 EDT
I tried to reproduce this.

Here's my installation:

Fedora 13

Android DDMS	0.9.9.v201009221407-60953
Android Development Tools	0.9.9.v201009221407-60953
Eclipse IDE for C/C++ Linux Developers	1.3.1.20100916-1202 (Eclipse 3.6.1, CDT 7.0.1)
Sequoyah Android Native Code Support	1.1.1.N20100920-0518

I created an Android project, a test project (using the checkbox). I added native support, added the Make target in the Make Target view with the command "sh build.sh". I also tried changing the build command in the build settings to "sh" and the build target to "build.sh". I also tried adding a external tool in the builders. I did not get an exception. Do you have the same problem with a test project? Can you add some details to the steps? Thanks.
Comment 4 Paul Lammertsma CLA 2010-10-11 06:24:50 EDT
The only difference I can find in my configuration, Marc-Andre, is that I've taken Eclipse Classic and installed C++ development tools from the Helios download site.

My project setup is also slightly different, as I have a Android library reference. (This causes an interesting side-issue in which the source of that library appears twice in my project, and hence I get countless "the type ... is already defined" errors.)

Under Windows, the CDT-related problem doesn't exist. I can specify the build command via the project properties' C/C++ Build settings.
Comment 5 Paul Lammertsma CLA 2010-10-11 06:26:00 EDT
I will attach the .project and .cproject files as soon as possible. (There is no .cdtbuild.)
Comment 6 Marc-André Laperle CLA 2012-02-18 15:03:47 EST
(In reply to comment #5)
> I will attach the .project and .cproject files as soon as possible. (There is
> no .cdtbuild.)

Paul, do you still have the project files? Can you still reproduce this?
Comment 7 Marc-André Laperle CLA 2012-02-20 13:59:45 EST
I received this email from Paul:

"Sorry to respond directly via e-mail, but Bugzilla is rejecting logins and new accounts. I'm afraid I don't have the project anymore and therefore can't reproduce the problem.

Best,
Paul"

I also tried again today with:

ADT 16.0.1
Eclipse 3.7.1
CDT 8.0.1
Sequoyah 1.1.3

and I didn't get the NPE. But I was able to get the exception after deleting the .cproject file. I can reproduce this with a Java project, without Android stuff:
1. Create a Java project
2. Add C/C++ Nature, I choose Makefile project
3. Delete .cproject file, restart Eclipse
4. Right-click on project, Make targets, Build..., Add, Enter some name.
5. This should trigger a build and the NPE.
6. After, go to the project properties, a lot of pages will trigger exceptions