This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 136325 - NPE appears when user startes IDE with -E option
Summary: NPE appears when user startes IDE with -E option
Status: CLOSED FIXED
Alias: None
Product: cnd
Classification: Unclassified
Component: Project (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: Thomas Preisler
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-06-02 22:49 UTC by Thomas Preisler
Modified: 2008-06-23 23:37 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Preisler 2008-06-02 22:49:42 UTC
Was CR 6709496:

This is a bug that appears when using CND in SunStudio. See 6709496 for more details.

Scenario:
- Create Args project
- Build project
- Close project
- Close IDE
- Launch IDE with '-E ~/SunStudioProjects/Args1/dist/Debug/args' option
- Finish debugger session
- Close IDE
- Launch IDE with '-E ~/SunStudioProjects/Args1/dist/Debug/args' option again
==> NPE

java.lang.NullPointerException
        at org.netbeans.modules.cnd.makeproject.api.configurations.ConfigurationSupport.getProjectDescriptor(ConfigurationSupport.java:192)        at 
com.sun.tools.debugger.dbxgui.debugger.DebuggerManager.debugProject(DebuggerManager.java:937)
        at com.sun.tools.debugger.dbxgui.debugger.DebuggerManager.start(DebuggerManager.java:2300)
        at com.sun.tools.debugger.dbxgui.DbxGuiModule$DebuggerStartup$1.run(DbxGuiModule.java:152)
        at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
        at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:104)
[catch] at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
Comment 1 Chihin Ko 2008-06-05 22:45:37 UTC
This could be a cnd makeproject issue :

With my own bit, which build with following NB version, the NPE does not exist.
/net/benjamin2/export/ws/jeanko/nb61/dev_install/intel-S2/SUNWspro/bin/sunstudio

Product Version: Sun Studio (Build 200804090901, Sun Studio 20080331)
Java: 1.5.0_07; Java HotSpot(TM) Client VM 1.5.0_07-b03
System: SunOS version 5.10 running on x86; ISO646-US; en (sunstudio)
Userdir: /net/benjamin2/export/ws/jeanko/nb61/userdir

But with gui-pia nightly build, which build with following NB version, NPE shows.
/net/balui/kits/compilers/pibs/sstrunk_masters/dbx/new_dbxtool/inst/intel-S2.inst//opt/SUNWspro//bin/sunstudio

Product Version: Sun Studio (Build 200805270103, Sun Studio 20080526)
Java: 1.5.0_07; Java HotSpot(TM) Client VM 1.5.0_07-b03
System: SunOS version 5.10 running on x86; ISO646-US; en (sunstudio)
Userdir: /tmp/nide
*** (#1 of 1): 2008-06-02 14:18:07 PDT chihin.ko@sun.com

Comment 2 Thomas Preisler 2008-06-06 01:28:42 UTC
The path (to /net/balui/kits/compilers/pibs/sstrunk_masters/dbx/new_dbxtool/inst/intel-S2.inst//opt/SUNWspro//bin/sunstudio) doesn't exist and Jean 
couldn't reproduce with another (similar) build. Will mark this IZ as WORKSFORME for now. Please reopen with more details how to reproduce.

Comment 3 Chihin Ko 2008-06-06 01:40:20 UTC
/net/balui/kits/compilers/pibs/sstrunk_masters/dbx/dbxtool/inst/$VARIANT1.inst//opt/SUNWspro//bin/sunstudio
Comment 4 Thomas Preisler 2008-06-06 02:15:59 UTC
Looks like a timing issue. The pattern is the following:

project = ProjectSupport.matchProject(projectFolder, processName);
...
ConfigurationSupport.getProjectDescriptor(project).getConfs().getActive(), null, false);

and ConfigurationSupport.getProjectDescriptor(project) returns null (sometimes).

Jean is going to double check this by adding a sleep...
Comment 5 Thomas Preisler 2008-06-06 02:18:05 UTC
Correction: The pattern is probably the following:

project =  ProjectGenerator.createBlankProject(projectName,
                       projectFolder, new MakeConfiguration[]
                       {(MakeConfiguration)dt.getConfig()}, true);
...
ConfigurationSupport.getProjectDescriptor(project).getConfs().getActive(), null, false);
Comment 6 Thomas Preisler 2008-06-06 18:53:47 UTC
Fixed:

ProjectGenerator.createBlankProject calls  MakeProjectGenerator.createProject which creates the project. It is not fully saved on disk though. It is done when 
the project is opened the first time. This creates two problems:
1) the project is not complete if it is never opened
2) opening the project is done in another thread creating a race condition if you try to access the project descriptor right createBlankProject is called.

Fixed by always saving the project fully on disk when createBlankProject is used.
Comment 7 Thomas Preisler 2008-06-06 18:56:43 UTC
changeset 32094c71bb59 in main
details: http://hg.netbeans.org/main?cmd=changeset;node=32094c71bb59
description:
	136325 NPE appears when user startes IDE with -E option
Comment 8 Chihin Ko 2008-06-11 03:52:11 UTC
The fixes is in dbxgui, see CR 6709496, not in cnd
Comment 9 Thomas Preisler 2008-06-23 23:37:28 UTC
removing SSIDE whiteboard keyword