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 262104 - Always read process error and output
Summary: Always read process error and output
Status: RESOLVED FIXED
Alias: None
Product: cnd
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 8.1
Hardware: All All
: P3 normal (vote)
Assignee: Vladimir Kvashin
URL:
Keywords:
: 267786 (view as bug list)
Depends on:
Blocks:
 
Reported: 2016-05-17 16:04 UTC by Vladimir Kvashin
Modified: 2016-10-14 15:08 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
truss log of starting command in a pseudo-termina (4.26 KB, text/plain)
2016-06-30 10:00 UTC, Alexander Simon
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Vladimir Kvashin 2016-05-17 16:04:11 UTC
This issue is inspired by the issue #258972 (Getting HostInfo hangs forever on Mac), which is already closed.

The problem is that if we do not read process error or output while it is not empty, this leads to execution hangup. This concerns both local and remote processes. There is a (manual, i.e. not included in any test suite) test that demonstrates this:

dlight.nativeexecution/test/unit/src/org/netbeans/modules/nativeexecution/api/util/StreamsHangupTestCase.java


So all usages of process within cnd should be checked and fixed.

I'm setting subcomponent to "other" as this concerns a number of quite different subcomponents, including execution itself.
Comment 1 Alexander Simon 2016-06-30 08:44:24 UTC
Main changeset is:
http://hg.netbeans.org/cnd-main/rev/da22225fba66
1. Additional fix for Bug #262599:
http://hg.netbeans.org/cnd-main/rev/437c80e3aec9
2. Additional fix for Bug #262587:
http://hg.netbeans.org/releases/rev/a3b2d25f6175
Second fix results in failure of RedirectErrorTest.
Comment 2 Alexander Simon 2016-06-30 09:56:25 UTC
Test is failed in condition:
==================
RedirectErrorTest @ localhost
	configure builder using setCommandLine()
	configure builder not to do redirectError()
	configure builder to be started in a pseudo-terminal
Extected that error goes to output
Result is: 
ExitStatus exitCode=1
error=
output=
==================
I.e. pseudo-terminal in command line mode does not print anything in out/err if input stream is closed.
It looks like loop function in dlight.nativeexecution/tools/pty/src/loop.c returns 1 and process was killed.
Comment 3 Alexander Simon 2016-06-30 10:00:00 UTC
Created attachment 160201 [details]
truss log of starting command in a pseudo-termina

see that process 15352 was killed by process 15350
Comment 4 Alexander Simon 2016-09-13 10:44:40 UTC
*** Bug 267786 has been marked as a duplicate of this bug. ***