SonarLint Eclipse v1.3.0 issue (thread locked)

91 views
Skip to first unread message

Alix Lourme

unread,
Mar 2, 2016, 12:13:26 PM3/2/16
to SonarLint
Hi,

I'm facing to a thread issue with SonarLint Eclipse v1.3.0.

Context : Eclipse plugin development (=> commons-io in META.INF file, ...) with Eclipse Kepler (project configuration not again upgraded to a more recent Eclipse version).

There are many "SonarLint analysis" thread BLOCKED with a waiting to lock on this thread :


"SonarLint analysis" daemon prio=6 tid=0x000000000e108000 nid=0x1688 runnable [0x000000001fdae000]
   java
.lang.Thread.State: RUNNABLE
    at java
.io.WinNTFileSystem.getBooleanAttributes(Native Method)
    at java
.io.File.isDirectory(File.java:843)
    at org
.apache.commons.io.filefilter.DirectoryFileFilter.accept(DirectoryFileFilter.java:70)
    at org
.apache.commons.io.filefilter.AndFileFilter.accept(AndFileFilter.java:122)
    at org
.apache.commons.io.filefilter.OrFileFilter.accept(OrFileFilter.java:118)
    at java
.io.File.listFiles(File.java:1285)
    at org
.apache.commons.io.FileUtils.innerListFiles(FileUtils.java:478)
    at org
.apache.commons.io.FileUtils.innerListFiles(FileUtils.java:486)
    at org
.apache.commons.io.FileUtils.innerListFiles(FileUtils.java:486)
    at org
.apache.commons.io.FileUtils.innerListFiles(FileUtils.java:486)
    at org
.apache.commons.io.FileUtils.innerListFiles(FileUtils.java:486)
    at org
.apache.commons.io.FileUtils.innerListFiles(FileUtils.java:486)
    at org
.apache.commons.io.FileUtils.innerListFiles(FileUtils.java:486)
    at org
.apache.commons.io.FileUtils.innerListFiles(FileUtils.java:486)
    at org
.apache.commons.io.FileUtils.listFiles(FileUtils.java:528)
    at org
.sonar.java.AbstractJavaClasspath.getMatchingFiles(AbstractJavaClasspath.java:133)
    at org
.sonar.java.AbstractJavaClasspath.getFilesForPattern(AbstractJavaClasspath.java:120)
    at org
.sonar.java.AbstractJavaClasspath.getFilesFromProperty(AbstractJavaClasspath.java:84)
    at org
.sonar.java.JavaClasspath.init(JavaClasspath.java:49)
    at org
.sonar.java.AbstractJavaClasspath.getElements(AbstractJavaClasspath.java:170)
    at org
.sonar.java.SonarComponents.getJavaClasspath(SonarComponents.java:131)
    at org
.sonar.java.JavaSquid.<init>(JavaSquid.java:83)
    at org
.sonar.plugins.java.JavaSquidSensor.analyse(JavaSquidSensor.java:89)
    at org
.sonarsource.sonarlint.core.analyzer.sensor.SensorsExecutor.executeSensor(SensorsExecutor.java:54)
    at org
.sonarsource.sonarlint.core.analyzer.sensor.SensorsExecutor.execute(SensorsExecutor.java:47)
    at org
.sonarsource.sonarlint.core.analyzer.sensor.PhaseExecutor.execute(PhaseExecutor.java:45)
    at org
.sonarsource.sonarlint.core.container.analysis.AnalysisContainer.doAfterStart(AnalysisContainer.java:134)
    at org
.sonarsource.sonarlint.core.container.ComponentContainer.startComponents(ComponentContainer.java:128)
    at org
.sonarsource.sonarlint.core.container.ComponentContainer.execute(ComponentContainer.java:113)
    at org
.sonarsource.sonarlint.core.container.global.GlobalContainer.analyze(GlobalContainer.java:102)
    at org
.sonarsource.sonarlint.core.SonarLintClientImpl.analyze(SonarLintClientImpl.java:85)
    at org
.sonarlint.eclipse.core.internal.jobs.SonarLintClientFacade.startAnalysis(SonarLintClientFacade.java:72)
   
- locked <0x00000000e5b81b38> (a org.sonarlint.eclipse.core.internal.jobs.SonarLintClientFacade)
    at org
.sonarlint.eclipse.core.internal.jobs.AnalyzeProjectJob$1.run(AnalyzeProjectJob.java:338)

   
Locked ownable synchronizers:
   
- None


How could I investigate the root cause ?

Thanks. Best regards.

Duarte Meneses

unread,
Mar 3, 2016, 2:51:10 AM3/3/16
to Alix Lourme, SonarLint
Hi Alix

The stack trace shows one thread running. Could you show the stack of the blocked threads?
What do you mean waiting to lock on this thread?


Thanks.


--
You received this message because you are subscribed to the Google Groups "SonarLint" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonarlint+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarlint/bfbaba56-accc-43fa-bebd-af1ca7c058e1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Duarte MENESES | SonarSource

Alix Lourme

unread,
Mar 3, 2016, 4:05:27 AM3/3/16
to SonarLint, alix....@gmail.com
Hi Duarte,

The stack of one blocked thread is :

"SonarLint analysis" daemon prio=6 tid=0x000000000e99d000 nid=0x1ea8 waiting for monitor entry [0x0000000014c5f000]
   java
.lang.Thread.State: BLOCKED (on object monitor)
    at org
.sonarlint.eclipse.core.internal.jobs.SonarLintClientFacade.startAnalysis(SonarLintClientFacade.java:66)
   
- waiting to lock <0x00000000e8637320> (a org.sonarlint.eclipse.core.internal.jobs.SonarLintClientFacade)

    at org
.sonarlint.eclipse.core.internal.jobs.AnalyzeProjectJob$1.run(AnalyzeProjectJob.java:338)

   
Locked ownable synchronizers:
   
- None

But after multiple thread dump checks and waiting a lot ... I realize this is not a real "thread lock" ; the problem comes from the JavaClasspath initialization.

This task takes a lot of time and is executed many times (each file save?) even without changes on dependencies :

Starting SonarLint
Index files
1 files indexed
Configured Java source version (sonar.java.source): 7
JavaClasspath initialization...
JavaClasspath initialization done: 71609 ms
JavaTestClasspath initialization...
JavaTestClasspath initialization done: 73206 ms
Java Main Files AST scan...
[...]
JavaClasspath initialization...
JavaClasspath initialization done: 79850 ms
JavaTestClasspath initialization...
JavaTestClasspath initialization done: 79713 ms
Java Main Files AST scan...
[...]
JavaClasspath initialization...
JavaClasspath initialization done: 103780 ms
JavaTestClasspath initialization...
JavaTestClasspath initialization done: 110078 ms
Java Main Files AST scan...
[...]
JavaClasspath initialization...

Perhaps the root cause comes from (ideas without serious evidence or analysis) :
- Eclipse plugin development (~30 jars in Plug-in Dependencies) => big classpath or to bigger jar to analysis
- The commons-io used is the one in Eclipse so a little old (Kepler) with a performance issue

Is there a way to check which files the AbstractJavaClasspath looks like ?

Best regards.

Julien HENRY

unread,
Mar 3, 2016, 4:29:28 AM3/3/16
to Alix Lourme, SonarLint
Hi Alix,

Indeed we already talked internally about possible performance issue for big classpath, but we were waiting for real user feedback to spend time on this topic.

You can see the value passed to sonar.java.libraries and sonar.java.binaries by switching to debug mode in SonarLintConsole.

++

Julien

Alix Lourme

unread,
Mar 3, 2016, 5:11:52 AM3/3/16
to SonarLint, alix....@gmail.com
Hi,


You can see the value passed to sonar.java.libraries and sonar.java.binaries by switching to debug mode in SonarLintConsole.

RTFM could have been an answer ^^, thanks.

This issues seems come from the content of classpath, not really the size (I have some projects with ~150 Maven dependencies, the classpath analysis takes ~1s).

Here the dependencies from debug mode :

sonar.binaries=[workspace]/[project]/target/classes
sonar
.java.binaries=[workspace]/[project]/target/classes
sonar
.java.test.binaries=[workspace]/[project]/target/classes

sonar
.java.libraries=
[jdk7]\jre\lib\resources.jar
[jdk7]\jre\lib\rt.jar
[jdk7]\jre\lib\jsse.jar
[jdk7]\jre\lib\jce.jar
[jdk7]\jre\lib\charsets.jar
[jdk7]\jre\lib\jfr.jar
[jdk7]\jre\lib\ext\access-bridge-64.jar
[jdk7]\jre\lib\ext\dnsns.jar
[jdk7]\jre\lib\ext\jaccess.jar
[jdk7]\jre\lib\ext\localedata.jar
[jdk7]\jre\lib\ext\sunec.jar
[jdk7]\jre\lib\ext\sunjce_provider.jar
[jdk7]\jre\lib\ext\sunmscapi.jar
[jdk7]\jre\lib\ext\zipfs.jar
[EclipseKeplerSR2]\plugins\org.eclipse.ui_3.105.0.v20130522-1122.jar
[EclipseKeplerSR2]\plugins\org.eclipse.swt_3.102.1.v20140206-1334.jar
[EclipseKeplerSR2]\plugins\com.ibm.etools.webedit.xulrunner.fragment_1.0.0.v20140311_2325.jar
[EclipseKeplerSR2]\plugins\org.eclipse.swt.win32.win32.x86_64_3.102.1.v20140206-1358.jar
[EclipseKeplerSR2]\plugins\org.eclipse.jface_3.9.1.v20130725-1141.jar
[EclipseKeplerSR2]\plugins\org.eclipse.core.commands_3.6.100.v20130515-1857.jar
[EclipseKeplerSR2]\plugins\org.eclipse.ui.workbench_3.105.2.v20140211-1711.jar
[EclipseKeplerSR2]\plugins\org.eclipse.e4.ui.workbench3_0.12.0.v20130515-1857.jar
[EclipseKeplerSR2]\plugins\org.eclipse.core.runtime_3.9.100.v20131218-1515.jar
[EclipseKeplerSR2]\plugins\javax.annotation_1.1.0.v201209060031.jar
[EclipseKeplerSR2]\plugins\javax.inject_1.0.0.v20091030.jar
[EclipseKeplerSR2]\plugins\org.eclipse.osgi_3.9.1.v20140110-1610.jar
[EclipseKeplerSR2]\plugins\org.eclipse.equinox.weaving.hook_1.0.200.I20130319-1000.jar
[EclipseKeplerSR2]\plugins\org.eclipse.equinox.common_3.6.200.v20130402-1505.jar
[EclipseKeplerSR2]\plugins\org.eclipse.core.jobs_3.5.300.v20130429-1813.jar
[EclipseKeplerSR2]\plugins\org.eclipse.core.runtime.compatibility.registry_3.5.200.v20130514-1256\runtime_registry_compatibility.jar
[EclipseKeplerSR2]\plugins\org.eclipse.equinox.registry_3.5.301.v20130717-1549.jar
[EclipseKeplerSR2]\plugins\org.eclipse.equinox.preferences_3.5.100.v20130422-1538.jar
[EclipseKeplerSR2]\plugins\org.eclipse.core.contenttype_3.4.200.v20130326-1255.jar
[EclipseKeplerSR2]\plugins\org.eclipse.equinox.app_1.3.100.v20130327-1442.jar
[EclipseKeplerSR2]\plugins\org.eclipse.core.resources_3.8.101.v20130717-0806.jar
[EclipseKeplerSR2]\plugins\org.eclipse.core.net_1.2.200.v20130430-1352.jar
[EclipseKeplerSR2]\plugins\org.eclipse.debug.core_3.8.0.v20130514-0954.jar
[EclipseKeplerSR2]\plugins\org.eclipse.core.variables_3.2.700.v20130402-1741.jar
[EclipseKeplerSR2]\plugins\org.jdom_1.1.1.v201101151400.jar
[EclipseKeplerSR2]\plugins\org.eclipse.jdt.core_3.9.50.v20140317-1741.jar
[EclipseKeplerSR2]\plugins\org.eclipse.jdt.compiler.apt_1.0.650.v20140316-1836.jar
[EclipseKeplerSR2]\plugins\org.eclipse.jdt.compiler.tool_1.0.250.v20140316-1836.jar
[EclipseKeplerSR2]\plugins\org.apache.commons.io_2.0.1.v201105210651.jar
[EclipseKeplerSR2]\plugins\org.apache.commons.lang_2.6.0.v201205030909.jar

sonar
.java.test.libraries=
[jdk7]\jre\lib\resources.jar
[jdk7]\jre\lib\rt.jar
[jdk7]\jre\lib\jsse.jar
[jdk7]\jre\lib\jce.jar
[jdk7]\jre\lib\charsets.jar
[jdk7]\jre\lib\jfr.jar
[jdk7]\jre\lib\ext\access-bridge-64.jar
[jdk7]\jre\lib\ext\dnsns.jar
[jdk7]\jre\lib\ext\jaccess.jar
[jdk7]\jre\lib\ext\localedata.jar
[jdk7]\jre\lib\ext\sunec.jar
[jdk7]\jre\lib\ext\sunjce_provider.jar
[jdk7]\jre\lib\ext\sunmscapi.jar
[jdk7]\jre\lib\ext\zipfs.jar
[EclipseKeplerSR2]\plugins\org.eclipse.ui_3.105.0.v20130522-1122.jar
[EclipseKeplerSR2]\plugins\org.eclipse.swt_3.102.1.v20140206-1334.jar
[EclipseKeplerSR2]\plugins\com.ibm.etools.webedit.xulrunner.fragment_1.0.0.v20140311_2325.jar
[EclipseKeplerSR2]\plugins\org.eclipse.swt.win32.win32.x86_64_3.102.1.v20140206-1358.jar
[EclipseKeplerSR2]\plugins\org.eclipse.jface_3.9.1.v20130725-1141.jar
[EclipseKeplerSR2]\plugins\org.eclipse.core.commands_3.6.100.v20130515-1857.jar
[EclipseKeplerSR2]\plugins\org.eclipse.ui.workbench_3.105.2.v20140211-1711.jar
[EclipseKeplerSR2]\plugins\org.eclipse.e4.ui.workbench3_0.12.0.v20130515-1857.jar
[EclipseKeplerSR2]\plugins\org.eclipse.core.runtime_3.9.100.v20131218-1515.jar
[EclipseKeplerSR2]\plugins\javax.annotation_1.1.0.v201209060031.jar
[EclipseKeplerSR2]\plugins\javax.inject_1.0.0.v20091030.jar
[EclipseKeplerSR2]\plugins\org.eclipse.osgi_3.9.1.v20140110-1610.jar
[EclipseKeplerSR2]\plugins\org.eclipse.equinox.weaving.hook_1.0.200.I20130319-1000.jar
[EclipseKeplerSR2]\plugins\org.eclipse.equinox.common_3.6.200.v20130402-1505.jar
[EclipseKeplerSR2]\plugins\org.eclipse.core.jobs_3.5.300.v20130429-1813.jar
[EclipseKeplerSR2]\plugins\org.eclipse.core.runtime.compatibility.registry_3.5.200.v20130514-1256\runtime_registry_compatibility.jar
[EclipseKeplerSR2]\plugins\org.eclipse.equinox.registry_3.5.301.v20130717-1549.jar
[EclipseKeplerSR2]\plugins\org.eclipse.equinox.preferences_3.5.100.v20130422-1538.jar
[EclipseKeplerSR2]\plugins\org.eclipse.core.contenttype_3.4.200.v20130326-1255.jar
[EclipseKeplerSR2]\plugins\org.eclipse.equinox.app_1.3.100.v20130327-1442.jar
[EclipseKeplerSR2]\plugins\org.eclipse.core.resources_3.8.101.v20130717-0806.jar
[EclipseKeplerSR2]\plugins\org.eclipse.core.net_1.2.200.v20130430-1352.jar
[EclipseKeplerSR2]\plugins\org.eclipse.debug.core_3.8.0.v20130514-0954.jar
[EclipseKeplerSR2]\plugins\org.eclipse.core.variables_3.2.700.v20130402-1741.jar
[EclipseKeplerSR2]\plugins\org.jdom_1.1.1.v201101151400.jar
[EclipseKeplerSR2]\plugins\org.eclipse.jdt.core_3.9.50.v20140317-1741.jar
[EclipseKeplerSR2]\plugins\org.eclipse.jdt.compiler.apt_1.0.650.v20140316-1836.jar
[EclipseKeplerSR2]\plugins\org.eclipse.jdt.compiler.tool_1.0.250.v20140316-1836.jar
[EclipseKeplerSR2]\plugins\org.apache.commons.io_2.0.1.v201105210651.jar
[EclipseKeplerSR2]\plugins\org.apache.commons.lang_2.6.0.v201205030909.jar



Available for anything or others items, helping investigate this issue. I will try to switch this development plugin on Eclipse Mars, for comparison (but requires à little time, hard to found at the moment).
Best regards.

Alix Lourme

unread,
Mar 3, 2016, 5:15:22 AM3/3/16
to SonarLint, alix....@gmail.com
Humm ... partial content (cut) in my previous reply, see dependencies.txt file.


Available for anything or others items, helping investigate this issue.
I will try to switch this development plugin on Eclipse Mars, for comparison (but requires à little time, hard to found)

Best regards.
dependencies.txt

Julien HENRY

unread,
Mar 4, 2016, 2:58:12 AM3/4/16
to Alix Lourme, SonarLint
Hi Alix,

I will create a ticket to track progress on this topic since I'm currently busy with connected experience ;) But I confirm that I'm also facing some performance issue when developing SonarLint itself. It is not as bad as you mention (I have a very fast SSD disk), but there is a 1 or 2 second lag that is very annoying when you are used to have instant feedback :).


++

Julien


--
You received this message because you are subscribed to the Google Groups "SonarLint" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonarlint+...@googlegroups.com.

Alix Lourme

unread,
Mar 4, 2016, 4:49:44 AM3/4/16
to SonarLint, alix....@gmail.com
Hi Julien,

https://jira.sonarsource.com/browse/SLE-41

Thanks, I will complement this issue if I found relevant facts.

connected experience

IMO, it is a more valuable feature than a performance issue only on Eclipse plugin projects ;-).

++

Julien HENRY

unread,
Mar 4, 2016, 7:07:43 AM3/4/16
to SonarLint, alix....@gmail.com
We finally found the root cause of the issue. We'll be fixed in next version of SonarLint.

Thanks for reporting this.

Nicolas Peru

unread,
Mar 4, 2016, 7:09:57 AM3/4/16
to Julien HENRY, SonarLint, alix....@gmail.com
Hi, 
Just to let you know that will also lead to improvement on java plugin side. So thanks for the feedback !

Cheers,


For more options, visit https://groups.google.com/d/optout.
--
Nicolas PERU | SonarSource
Senior Developer
http://sonarsource.com

Alix Lourme

unread,
Mar 4, 2016, 7:14:20 AM3/4/16
to SonarLint, julien...@sonarsource.com, alix....@gmail.com

Wow, so efficient ! Thanks guys.
Reply all
Reply to author
Forward
0 new messages