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.
-------- Product Version: NetBeans IDE 8.1 RC2 (Build 201510122201) Java: 1.8.0_51; Java HotSpot(TM) 64-Bit Server VM 25.51-b03 Runtime: Java(TM) SE Runtime Environment 1.8.0_51-b16 System: Windows 8 version 6.2 running on amd64; Cp1250; pl_PL (nb) -------- When a conenction between Netbeans and the remote server is being lost, it seems like Netbeans is falling into some kind of infinite loop - causing Netbeans to hang and use 80~% of the CPU. The only possible way to get rid of it is to kill Netbeans process as it's not going to unfreeze itself.
When the NetBeans IDE freezes or becomes sluggish for no apparent reason, it's recommended to generate a thread dump(or profile IDE) and attach as a file to the reported bug. http://wiki.netbeans.org/GenerateThreadDump
Created attachment 156954 [details] jstack Scenario: - Launch some OS in VirtualBox - Add host to NetBeans - Create Full Remote project (Quote) - Open cpu.cc and quote.cc files - Shutdown virtual machine ==> big problems with IDE
In log I see infinite: FINEST [remote.support.logger]: Adding notification for sova@127.0.0.1:/home/sova/NetBeansProjects/Quote_2/cpu.cc FINEST [null]: Last record repeated 2 more times. FINEST [remote.support.logger]: Adding notification for sova@127.0.0.1:/home/sova/NetBeansProjects/Quote_2/quote.cc FINEST [remote.support.logger]: Adding notification for sova@127.0.0.1:/home/sova/NetBeansProjects/Quote_2/cpu.cc FINEST [remote.support.logger]: Adding notification for sova@127.0.0.1:/home/sova/NetBeansProjects/Quote_2/quote.cc FINEST [remote.support.logger]: Adding notification for sova@127.0.0.1:/home/sova/NetBeansProjects/Quote_2/cpu.cc FINEST [remote.support.logger]: Adding notification for sova@127.0.0.1:/home/sova/NetBeansProjects/Quote_2/quote.cc FINEST [null]: Last record repeated again. FINEST [remote.support.logger]: Adding notification for sova@127.0.0.1:/home/sova/NetBeansProjects/Quote_2/cpu.cc FINEST [remote.support.logger]: Adding notification for sova@127.0.0.1:/home/sova/NetBeansProjects/Quote_2/quote.cc FINEST [null]: Last record repeated again. FINEST [remote.support.logger]: Adding notification for sova@127.0.0.1:/home/sova/NetBeansProjects/Quote_2/cpu.cc FINEST [null]: Last record repeated 3 more times. FINEST [remote.support.logger]: Adding notification for sova@127.0.0.1:/home/sova/NetBeansProjects/Quote_2/quote.cc FINEST [remote.support.logger]: Adding notification for sova@127.0.0.1:/home/sova/NetBeansProjects/Quote_2/cpu.cc FINEST [null]: Last record repeated again. FINEST [remote.support.logger]: Adding notification for sova@127.0.0.1:/home/sova/NetBeansProjects/Quote_2/quote.cc FINEST [remote.support.logger]: Adding notification for sova@127.0.0.1:/home/sova/NetBeansProjects/Quote_2/cpu.cc FINEST [remote.support.logger]: Adding notification for sova@127.0.0.1:/home/sova/NetBeansProjects/Quote_2/quote.cc
This is 100% reproducible. The consequences are terrific: freezes and freezes many seconds each. The root cause is most likely the stack "Connection Watcher" at org.netbeans.modules.nativeexecution.api.util.ConnectionManager.access$900(ConnectionManager.java:88) at org.netbeans.modules.nativeexecution.api.util.ConnectionManager$ConnectionWatcher.run(ConnectionManager.java:845) at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1443) at org.netbeans.modules.openide.util.GlobalLookup.execute(GlobalLookup.java:68) at org.openide.util.lookup.Lookups.executeWith(Lookups.java:303) at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2058) That is called zillions of time.
Until it is fixed, here is a workaround: add a command line parameter -J-Dnativeexecution.connection.watch.interval=0
Created attachment 157378 [details] Proposed fix
enum/hg/release81/rev/6df2137dd67f
Integrated into 'main-silver', will be available in build *201511240002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/df9eefbce14d User: Vladimir Kvashin <vkvashin@netbeans.org> Log: fixed #256151 - Freeze after remote disconnection (transplanted from 6df2137dd67fb3a2a76fb4bb360c1bf0af4bd089)
Created attachment 157889 [details] java thread dump
The problem still exists, see attached thread dump.
I failed to reproduce this. What I did was: - I set up a Linux on a Virtual Box as remote host. - I opened a couple of projects, opened some files - Then I closed VBox session (closed window, selected "Saved machine state") Everything went smoothly in the IDE. Host became disconnected. Alexander, could you please explain how to reproduce this?
I'm still failing to reproduce this. I'm going to close the issue unless Alexander (or somebody else) adds a description of how to reproduce.
Please try the following scenario: - create a full remote Quote sample in Virtual machine - open quote.cc and system.cc - press Pause in VBox toolbar - try to switch between quote.cc and system.cc, no problem so far - open e.g. cpu.cc, it's opened empty and it's OK and it does not bring any issues - close cpu.cc Result: IDE freezes. Resume Vbox. IDE reported about detected slowness for 463s. See report: http://statistics.netbeans.org/analytics/detail.do?id=213844
Alexander, thanks for the detailed description. I was finally able to reproduce this; although in my case it hangs not at once but after some period after disconnection. I'd like to note however that the situation differs from one described in the original bug, which reported 80% cpu consumption and had quite different reason.
"Sleep" is a strange VM state; the connection does not break when VM goes into sleep mode, but sure you never get a response. Below is just an implementation-wise investigation. While loading current editor content refresh was called on file object. This makes remoteFS send a request to fs_server and wait for an answer. Connection is not broken, so it thinks it is connected; request is written OK and then it is waits for response... waits forever. "org.openide.text Document Processing" #121 daemon prio=1 os_prio=-2 tid=0x000000005a0d4000 nid=0xfcc4 in Object.wait() [0x0000000066eae000] java.lang.Thread.State: WAITING (on object monitor) at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:502) at org.netbeans.modules.remote.impl.fs.server.FSSResponse.getNextPackage(FSSResponse.java:148) - locked <0x00000000fc10db08> (a java.lang.Object) at org.netbeans.modules.remote.impl.fs.server.FSSResponse.getNextPackage(FSSResponse.java:136) at org.netbeans.modules.remote.impl.fs.server.FSSTransport.stat_or_lstat(FSSTransport.java:154) at org.netbeans.modules.remote.impl.fs.server.FSSTransport.lstat(FSSTransport.java:134) at org.netbeans.modules.remote.impl.fs.RemoteFileSystemTransport.lstat(RemoteFileSystemTransport.java:185) at org.netbeans.modules.remote.impl.fs.RemotePlainFile.refreshImpl(RemotePlainFile.java:479) at org.netbeans.modules.remote.impl.fs.RemoteDirectory.ensureChildSync(RemoteDirectory.java:1558) at org.netbeans.modules.remote.impl.fs.RemotePlainFile.getInputStream(RemotePlainFile.java:362) at org.netbeans.modules.remote.impl.fs.RemoteFileObject.getInputStream(RemoteFileObject.java:393) at org.openide.text.DataEditorSupport$Env.inputStream(DataEditorSupport.java:893) at org.openide.text.DocumentOpenClose$DocumentLoad.atomicLockedRun(DocumentOpenClose.java:761) at org.openide.text.DocumentOpenClose$DocumentLoad.run(DocumentOpenClose.java:615) at org.netbeans.editor.GuardedDocument.runAtomic(GuardedDocument.java:323) at org.openide.text.NbDocument.runAtomic(NbDocument.java:436) at org.openide.text.DocumentOpenClose$DocumentLoad.run(DocumentOpenClose.java:655) at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1443) at org.netbeans.modules.openide.util.GlobalLookup.execute(GlobalLookup.java:68) at org.openide.util.lookup.Lookups.executeWith(Lookups.java:303) at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2058)
Fixed on enum 4b43e2fa54d3 d5940d7755ef
Integrated into 'main-silver', will be available in build *201601290002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/0bacf28ba780 User: Vladimir Kvashin <vkvashin@netbeans.org> Log: fixing #256151 - Freeze after remote disconnection (transplanted from 4ee203dc7cab40f692465be8553c141f790653c6)
Fixes of this bug: http://hg.netbeans.org/releases/rev/4ee203dc7cab http://hg.netbeans.org/releases/rev/7e52687a19b6 http://hg.netbeans.org/releases/rev/d5940d7755ef http://hg.netbeans.org/releases/rev/4b43e2fa54d3
Verified in build 20160130.