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 253458 - Toolchain validation gets stuck (Windows)
Summary: Toolchain validation gets stuck (Windows)
Status: NEW
Alias: None
Product: cnd
Classification: Unclassified
Component: execution (show other bugs)
Version: 8.1
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: ilia
URL:
Keywords:
: 270273 (view as bug list)
Depends on:
Blocks:
 
Reported: 2015-07-14 08:45 UTC by phansson
Modified: 2017-04-03 07:46 UTC (History)
2 users (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 phansson 2015-07-14 08:45:41 UTC
When I start the IDE I get an infinite loop while the IDE is executing "Validating Tool collection on localhost".

This has been reported by other users as well:

http://stackoverflow.com/questions/27756938/netbeans-running-validating-tool-collection-on-localhost-forever

https://forums.netbeans.org/topic38952.html

I believe I've tracked down the problem, at least partly. If I enable logging I get (after waiting for a loooooong time, many minutes):


WARNING [nativeexecution.support.logger]: [334686 ms.] Default tmp dir [C:\Users\PETER~1.STO\AppData\Local\Temp\] has spaces/non-latin chars in the path. It is recommended to use a path without spaces/non-latin chars for tmp dir. Either change TEMP environment variable in System Properties or use -J-Djava.io.tmpdir=c:\tmp to change the temp dir.
WARNING [org.netbeans.TopSecurityManager]: use of system property netbeans.user has been obsoleted in favor of InstalledFileLocator/Places at org.netbeans.modules.nativeexecution.support.hostinfo.impl.HostInfoFactory.getNBKey(HostInfoFactory.java:417)
INFO [nativeexecution.support.logger]: [439886 ms.] Failed to call nbstart -- .

The first warning is not interesting. It relates to bug 253455.

The second warning is more interesting. 

If I investigate the source code I can see a couple of problems:

- It seems to me the developer does not intend the NbStartUtility to ever execute on Windows (NbStartUtility.isSupported() returns false for Windows platform). Yet in WindowsHostProviderInfo.java the NBStartUtility is used without checking the isSupported() method and hence it will execute.

- In WindowsHostProviderInfo.java nbstart is executed using JDK's ProcessBuilder but there's no draining of stdin, stdout and stderr. Besides that this is a memory leak it also means that the external process may 'hang' without anyone noticing. (doesn't the NB Platform have some wrappers for safe execution of ProcessBuilder that could be used here?)

- There should be more logging on the processbuilder.execute step. Exactly what is it trying to execute ?


Hope this helps.
Comment 1 phansson 2015-07-14 08:47:50 UTC
Arghh. When referring to "the second warning" I meant this:

INFO [nativeexecution.support.logger]: [439886 ms.] Failed to call nbstart -- .


... which is technically not a warning.  :-)
Comment 2 phansson 2015-07-14 09:05:27 UTC
At the moment I'm dealing with the problem by disabling Toolchain Validation all together. I put the following in by netbeans.conf:


netbeans_default_options="........   -J-Dcnd.toolchain.validator.disabled=true"
Comment 3 phansson 2015-07-14 10:24:10 UTC
I've tracked down the problem to be a faulty MSYS2.

The IDE is very non-verbose as to what it is doing so you'll have to resort to some other tool to figure out which external process (and its command line) the IDE is trying to execute. If you are on Windows the the Microsoft Process Explorer (from SysInternals suite) is an excellent tool for the purpose). Then try to execute that same command as the IDE is trying to execute, but from a command prompt.

Although the problem in my case is not related to the IDE I'll leave this ticket open as I believe the IDE could be a lot more verbose as to what it is doing for example by always calling progressHandle.progress("Executing : xxx") where xxx is the native command it is trying to execute. Native execution is always error prone.
Comment 4 Alexander Simon 2015-07-14 10:55:31 UTC
(In reply to phansson from comment #3)
> Although the problem in my case is not related to the IDE I'll leave this
> ticket open as I believe the IDE could be a lot more verbose as to what it
> is doing for example by always calling progressHandle.progress("Executing :
> xxx") where xxx is the native command it is trying to execute. Native
> execution is always error prone.
Two flags log execution:
-J-Dcnd.toolchain.personality.trace=true -J-Dnativeexecution.support.logger.level=FINEST
Are flags help?
Comment 5 phansson 2015-07-14 11:27:18 UTC
No, the flags does not tell me more. 

The problem is that there's no logging statement in the Java code that says *WHAT* the command line being executed is. As I said:  executing native commands from Java is always going to be error prone so you better add lots of logging. :-)

BTW: I've also added answer on the SO question in case anyone stumbles on it:
http://stackoverflow.com/questions/27756938/netbeans-running-validating-tool-collection-on-localhost-forever
Comment 6 Quality Engineering 2015-07-15 01:20:55 UTC
Integrated into 'main-silver', will be available in build *201507150001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/fe8e81b2fa64
User: Alexander Simon <alexvsimon@netbeans.org>
Log: fixing Bug #253458 Toolchain validation gets stuck (Windows)
- do not get host info if there is no tool collections
Comment 7 ilia 2016-08-25 10:13:14 UTC
User from cnd forums reported that the same issue was caused by antivirus software (McAfee) and was solved after disabling it.
Comment 8 ilia 2017-04-03 07:46:40 UTC
*** Bug 270273 has been marked as a duplicate of this bug. ***