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 165825 - Move getting compiler information out of the UI thread (aka EDT thread)
Summary: Move getting compiler information out of the UI thread (aka EDT thread)
Status: RESOLVED FIXED
Alias: None
Product: cnd
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: Alexander Simon
URL:
Keywords: PERFORMANCE
Depends on:
Blocks:
 
Reported: 2009-05-22 14:44 UTC by Vladimir Kvashin
Modified: 2009-10-23 12:35 UTC (History)
0 users

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 Vladimir Kvashin 2009-05-22 14:44:15 UTC
Now project systems gets information about compiler predefined include paths and defines lazily, on demand.
Generally, that's good. But this should never be done in the UI thread; this is especially important when dealing with
remote compiler sets.

Here is a stack fragment; it shows that calling remote compilers was caused by selecting another host in Tools->Options
dioalog.


"AWT-EventQueue-1" prio=3 tid=0x089f9800 nid=0x1f in Object.wait() [0xc99fe000..0xc99ff8f0]
   java.lang.Thread.State: TIMED_WAITING (on object monitor)
        at java.lang.Object.wait(Native Method)
        - waiting on <0xf7b478e0> (a com.jcraft.jsch.Channel$MyPipedInputStream)
        at java.io.PipedInputStream.read(PipedInputStream.java:310)
        - locked <0xf7b478e0> (a com.jcraft.jsch.Channel$MyPipedInputStream)
        at java.io.PipedInputStream.read(PipedInputStream.java:361)
        - locked <0xf7b478e0> (a com.jcraft.jsch.Channel$MyPipedInputStream)
        at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:264)
        at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:306)
        at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:158)
        - locked <0xf7b788c8> (a java.io.InputStreamReader)
        at java.io.InputStreamReader.read(InputStreamReader.java:167)
        at java.io.BufferedReader.fill(BufferedReader.java:136)
        at java.io.BufferedReader.readLine(BufferedReader.java:299)
        - locked <0xf7b788c8> (a java.io.InputStreamReader)
        at java.io.BufferedReader.readLine(BufferedReader.java:362)
        at org.netbeans.modules.cnd.remote.support.RemoteCommandSupport.run(RemoteCommandSupport.java:135)
        at org.netbeans.modules.cnd.remote.support.RemoteCommandProvider.run(RemoteCommandProvider.java:65)
        at org.netbeans.modules.cnd.makeproject.api.compilers.CCCCompiler.getSystemIncludesAndDefines(CCCCompiler.java:133)
        at
org.netbeans.modules.cnd.makeproject.api.compilers.SunCCCCompiler.getFreshSystemIncludesAndDefines(SunCCCCompiler.java:134)
        at
org.netbeans.modules.cnd.makeproject.api.compilers.SunCCCCompiler.getSystemIncludesAndDefines(SunCCCCompiler.java:123)
        at
org.netbeans.modules.cnd.makeproject.api.compilers.SunCCCCompiler.getSystemIncludeDirectories(SunCCCCompiler.java:100)
        at org.netbeans.modules.cnd.makeproject.ui.options.PredefinedPanel.updatePanels(PredefinedPanel.java:81)
        at org.netbeans.modules.cnd.makeproject.ui.options.PredefinedPanel.<init>(PredefinedPanel.java:71)
        at org.netbeans.modules.cnd.makeproject.ui.options.ParserSettingsPanel.updateTabs(ParserSettingsPanel.java:208)
        - locked <0xdc19a1f8> (a org.netbeans.modules.cnd.makeproject.ui.options.ParserSettingsPanel)
        at
org.netbeans.modules.cnd.makeproject.ui.options.ParserSettingsPanel.updateCompilerCollections(ParserSettingsPanel.java:184)
        at org.netbeans.modules.cnd.makeproject.ui.options.ParserSettingsPanel.stateChanged(ParserSettingsPanel.java:242)
        at org.netbeans.modules.cnd.ui.options.ToolsPanel.fireCompilerSetChange(ToolsPanel.java:849)
        at org.netbeans.modules.cnd.ui.options.ToolsPanel.changeCompilerSet(ToolsPanel.java:615)
        at org.netbeans.modules.cnd.ui.options.ToolsPanel.onCompilerSetChanged(ToolsPanel.java:285)
        at org.netbeans.modules.cnd.ui.options.ToolsPanel.update(ToolsPanel.java:533)
        at org.netbeans.modules.cnd.ui.options.ToolsPanel.update(ToolsPanel.java:477)
        at org.netbeans.modules.cnd.ui.options.ToolsPanel.onNewDevHostSelected(ToolsPanel.java:306)
        at org.netbeans.modules.cnd.ui.options.ToolsPanel.itemStateChanged(ToolsPanel.java:934)
        at javax.swing.JComboBox.fireItemStateChanged(JComboBox.java:1205)
Comment 1 Vladimir Kvashin 2009-05-22 19:21:18 UTC
The workaround for the stack that is mentioned here is to invoke these methods while setting up remote host
CompilerSet compilerCollection = ...
BasicCompiler cCompiler = (BasicCompiler) compilerCollection.getTool(Tool.CCompiler);
BasicCompiler cppCompiler = (BasicCompiler) compilerCollection.getTool(Tool.CCCompiler);
cCompiler.getSystemIncludeDirectories();
cCompiler.getSystemPreprocessorSymbols();
cppCompiler.getSystemIncludeDirectories();
cppCompiler.getSystemPreprocessorSymbols();



Comment 2 Thomas Preisler 2009-10-22 16:29:23 UTC
The tools dialog doesn't belong to projects. Code is in core and works independently on projects. In general toolchain
issues are not project issues.
Comment 3 Alexander Simon 2009-10-23 12:35:58 UTC
fixed month before, change set:
http://hg.netbeans.org/cnd-main/rev/3662c022bb84