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 186172 - java.lang.IllegalThreadStateException while stopping program in internal terminal
Summary: java.lang.IllegalThreadStateException while stopping program in internal term...
Status: VERIFIED FIXED
Alias: None
Product: cnd
Classification: Unclassified
Component: execution (show other bugs)
Version: 6.x
Hardware: PC All
: P1 normal (vote)
Assignee: Andrew Krasny
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-14 15:44 UTC by Alexander Pepin
Modified: 2010-05-28 10:05 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Proposed fix (1.95 KB, patch)
2010-05-26 20:18 UTC, Andrew Krasny
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Pepin 2010-05-14 15:44:24 UTC
While running automatic tests which use internal terminal we get such exception in the messages log file:
....
SEVERE [org.openide.util.RequestProcessor]: Error in RequestProcessor org.netbeans.modules.nativeexecution.support.NativeTaskExecutorService$2
java.lang.IllegalThreadStateException
	at org.netbeans.modules.nativeexecution.AbstractNativeProcess.exitValue(AbstractNativeProcess.java:322)
	at org.netbeans.modules.cnd.makeproject.api.DefaultProjectActionHandler$ProcessChangeListener$1.run(DefaultProjectActionHandler.java:459)
	at org.netbeans.modules.cnd.makeproject.api.DefaultProjectActionHandler$ProcessChangeListener.run(DefaultProjectActionHandler.java:543)
	at org.netbeans.modules.nativeexecution.api.execution.NativeExecutionService$1$3$1.run(NativeExecutionService.java:188)
[catch] at org.netbeans.modules.nativeexecution.support.NativeTaskExecutorService$2.run(NativeTaskExecutorService.java:79)
	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1415)
	at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:1954)
WARNING [gdb.logger]: Unexpected gdb error: "ptrace: No such process."
.....
Comment 2 Alexander Pepin 2010-05-26 14:32:58 UTC
It's reproducible in rc1
Steps to reproduce:
- create remote Quote project
- run it using Internal terminal
- press Stop on the toolbar in Internal terminal
Result: Exception appears.
java.lang.IllegalThreadStateException
	at org.netbeans.modules.nativeexecution.AbstractNativeProcess.exitValue(AbstractNativeProcess.java:340)
	at org.netbeans.modules.cnd.makeproject.api.DefaultProjectActionHandler$ProcessChangeListener$1.run(DefaultProjectActionHandler.java:462)
	at org.netbeans.modules.cnd.makeproject.api.DefaultProjectActionHandler$ProcessChangeListener.run(DefaultProjectActionHandler.java:546)
	at org.netbeans.modules.nativeexecution.api.execution.NativeExecutionService$1$3$1.run(NativeExecutionService.java:191)
	at org.netbeans.modules.nativeexecution.support.NativeTaskExecutorService$2.run(NativeTaskExecutorService.java:82)
	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1418)
[catch] at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:1957)
Comment 3 Alexander Pepin 2010-05-26 15:22:40 UTC
The key note is that the profiler should be switched OFF. If the profiler is ON then execution stops without exception.
Comment 4 Andrew Krasny 2010-05-26 20:04:45 UTC
The reason is understood. 
This is the problem of handling cancel() of task that runs program in internal terminal (NativeExecutionService). The problem is not reproduced in case when profiler is ON only because it handles cancellation event in a different way than DefaultProjectActionHandler does. (DefaultProjectActionHandler does it more correctly).
Comment 5 Andrew Krasny 2010-05-26 20:18:56 UTC
Created attachment 99515 [details]
Proposed fix
Comment 6 Andrew Krasny 2010-05-26 20:20:07 UTC
Vladimir, 

please review the proposed fix (attached)
Comment 7 Andrew Krasny 2010-05-26 20:31:22 UTC
pushed to cnd-main [http://hg.netbeans.org/cnd-main/rev/c7a682eb85ce]
Comment 8 Alexander Pepin 2010-05-27 13:41:54 UTC
verified in rc1 build with provided jar file.
Please push the fix into release69 clone.
Comment 9 Andrew Krasny 2010-05-27 15:12:01 UTC
integrated in http://hg.netbeans.org/release69/rev/cf6b6c3bad44
Comment 10 Alexander Pepin 2010-05-28 10:05:10 UTC
verified in rc2 build.