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 222859 - NullPointerException at org.netbeans.modules.nativeexecution.api.execution.NativeExecutionService$1$5$1.run
Summary: NullPointerException at org.netbeans.modules.nativeexecution.api.execution.Na...
Status: RESOLVED FIXED
Alias: None
Product: cnd
Classification: Unclassified
Component: execution (show other bugs)
Version: 7.3
Hardware: All All
: P3 normal (vote)
Assignee: Andrew Krasny
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-11-27 20:30 UTC by tbrunhoff
Modified: 2012-12-07 02:38 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter: 195641


Attachments
stacktrace (1.97 KB, text/plain)
2012-11-27 20:30 UTC, tbrunhoff
Details
Proposed fix (2.70 KB, patch)
2012-11-27 22:21 UTC, Andrew Krasny
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description tbrunhoff 2012-11-27 20:30:05 UTC
Build: NetBeans IDE Dev (Build 201211090001)
VM: Java HotSpot(TM) Client VM, 23.1-b03, Java(TM) SE Runtime Environment, 1.7.0_05-b06
OS: Linux

User Comments:
tbrunhoff: Debug session...

GUEST: writing a program in c to print hello




Stacktrace: 
java.lang.NullPointerException
   at org.netbeans.modules.nativeexecution.api.execution.NativeExecutionService$1$5$1.run(NativeExecutionService.java:279)
   at org.netbeans.modules.nativeexecution.support.NativeTaskExecutorService$2.run(NativeTaskExecutorService.java:82)
   at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1454)
   at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2036)
Comment 1 tbrunhoff 2012-11-27 20:30:06 UTC
Created attachment 128481 [details]
stacktrace
Comment 2 Andrew Krasny 2012-11-27 22:21:46 UTC
Created attachment 128487 [details]
Proposed fix
Comment 3 Andrew Krasny 2012-12-04 18:57:04 UTC
After some discussion with Ivan it was decided to fix this bug in two places.
- in the terminal emulator (wrong synchronization)
- in the ProjectActionSupport (wrong API usage)

The problem is that in the ProjectActionSupport it is possible that we close IO before we get Out (to close it once again from the other thread ;-[]) right after printing-out the exit status.

As a first step I did some refactoring of IO Tabs management:
http://hg.netbeans.org/cnd-main/rev/b9c157f200b8
Comment 4 Quality Engineering 2012-12-05 02:57:03 UTC
Integrated into 'main-golden', will be available in build *201212050001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/b9c157f200b8
User: Andrew Krasny <akrasny@netbeans.org>
Log: Bug #222859 - NullPointerException at org.netbeans.modules.nativeexecution.api.execution.NativeExecutionService$1$5$1.run

Refactored ProjectActionSupport - extracted IOTabsController to manage all tabs-related logic.
Comment 5 Leonid Lenyashin 2012-12-05 09:33:07 UTC
Andrew, why it is not in FIXED state???
Comment 6 Andrew Krasny 2012-12-05 09:52:33 UTC
Because it is not fixed yet ;)
A good fix would be to have a control over many of threads involved in a simple run action - but this requires some refactoring...
Comment 7 Andrew Krasny 2012-12-06 09:29:20 UTC
Changeset that fixes NPE:
http://hg.netbeans.org/cnd-main/rev/81bd2b0ce660
Comment 8 Andrew Krasny 2012-12-06 09:35:50 UTC
http://netbeans.org/bugzilla/show_bug.cgi?id=223376 was filed against the first problem.
Comment 9 Quality Engineering 2012-12-07 02:38:09 UTC
Integrated into 'main-golden', will be available in build *201212070001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/81bd2b0ce660
User: Andrew Krasny <akrasny@netbeans.org>
Log: Bug #222859 - NullPointerException at org.netbeans.modules.nativeexecution.api.execution.NativeExecutionService$1$5$1.run