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 161239

Summary: Project run hangs with msys
Product: cnd Reporter: Egor Ushakov <gorrus>
Component: -- Other --Assignee: Andrew Krasny <akrasny>
Status: RESOLVED WORKSFORME    
Severity: blocker    
Priority: P3    
Version: 6.x   
Hardware: All   
OS: Windows XP   
Issue Type: DEFECT Exception Reporter:
Attachments: stacktrace

Description Egor Ushakov 2009-03-26 11:55:26 UTC
On Windows if I have only mingw/msys and no cygwin
project run for welcom application (for example) display external terminal with
"press enter to close"
and then ide consumes 100% of cpu and I'm unable to stop run process.
Comment 1 Egor Ushakov 2009-03-26 11:57:18 UTC
Created attachment 78896 [details]
stacktrace
Comment 2 Vladimir Voskresensky 2009-03-26 17:43:36 UTC
I do not see any cnd runnable threads at all. All runnable threads are org.apache.tools.ant.* based
Comment 3 Alexey Vladykin 2009-04-03 09:43:43 UTC
Will try to reproduce and investigate.
Comment 4 Alexey Vladykin 2009-04-03 10:07:59 UTC
Works for me with todays build.
Comment 5 Egor Ushakov 2009-04-03 14:00:51 UTC
To reproduce you need msys installed without a registry record.
Now we search for msys only in registry, not in Path or toolcahins as we did before.

Now it throws the exception:

java.lang.NullPointerException
	at java.lang.ProcessBuilder.start(ProcessBuilder.java:441)
	at org.netbeans.modules.nativeexecution.TerminalLocalNativeProcess.<init>(TerminalLocalNativeProcess.java:214)
	at org.netbeans.modules.nativeexecution.api.NativeProcessBuilder.call(NativeProcessBuilder.java:134)
	at org.netbeans.modules.nativeexecution.api.NativeProcessBuilder.call(NativeProcessBuilder.java:70)
	at org.netbeans.api.extexecution.ExecutionService$3.call(ExecutionService.java:254)
	at org.netbeans.api.extexecution.ExecutionService$3.call(ExecutionService.java:230)
	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)
	at java.util.concurrent.FutureTask.run(FutureTask.java:123)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
[catch] at java.lang.Thread.run(Thread.java:595)

and after that process runs forever, I'm unable to kill it in the IDE
Comment 6 Alexey Vladykin 2009-04-03 17:40:13 UTC
In changeset http://hg.netbeans.org/cnd-main/rev/306142455b3b I fixed process termination. Now progress bar disappears
as it should.
Two things to be fixed yet:
- look for MSYS in PATH
- be more user-friendly if shell is not found, not just show exception
Comment 7 Quality Engineering 2009-04-04 19:20:32 UTC
Integrated into 'main-golden', will be available in build *200904041400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/306142455b3b
User: Alexey Vladykin <alexey_vladykin@netbeans.org>
Log: Fixing #161239 Project run hangs with msys
Comment 8 Alexey Vladykin 2009-04-06 10:25:07 UTC
Another changeset: http://hg.netbeans.org/cnd-main/rev/c64d21149d87
Execution searches for shell in PATH in addition to registry.
Proper user notification is still needed in case shell is not found. But this is no longer P2.
Comment 9 Quality Engineering 2009-04-07 07:20:10 UTC
Integrated into 'main-golden', will be available in build *200904070200* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/c64d21149d87
User: Alexey Vladykin <alexey_vladykin@netbeans.org>
Log: Fixing #161239 Project run hangs with msys
Comment 10 Alexey Vladykin 2009-04-10 18:38:43 UTC
Andrew, today you reverted part of my changes. Specifically, in LocalNativeProcess constructor. Could you please restore
the catch-block at the end of constructor or explain what was wrong about it?
Comment 11 Andrew Krasny 2009-04-12 22:56:36 UTC
Alexey, 

thanks for your notification. Indeed I accidentally have reverted changes specified by you (I think it was done while I
tried to restore my workspace ;) )

In http://hg.netbeans.org/cnd-main/rev/5fa80e86e506 I have restored this try/catch (but made slight re-design)...
Comment 12 Andrew Krasny 2009-04-27 09:12:11 UTC
Issue is not reproducible.