SonarLint issue with Clear Case Eclipse plugin for change set files

609 views
Skip to first unread message

alpe...@gmail.com

unread,
Jan 6, 2017, 5:57:37 AM1/6/17
to SonarLint
Just to give background, with new version of SonarLint there is feature to see new issues coming from change file. This is shown in new tab called "SonarLint Report".  In order to work that SonarLint plugin need to talk to SCM plugin to fetch changeset.  This is not working for Clear case. Older version of clear case plugin 7.x version has not even implemented method getSubscriber() method in ProviderType which will return subscribers list. With new Clear Case plugin (Clear Team Explorer plugin version 8.0.1) , now method is implemented but still changeset retrieval part not working. 

With latest Clear case plugin version and Sonarlint plugin 2.5.0, when I click on Current project to get new issues in changed file, I don't get anything but popup saying "An internal error occurred during: "Analyze changeset". java.lang.StackOverflowError".  There is absolutely nothing printed in debug log or output log. 


As far as I know there is nothing like symbolic link or virtual resource in project. There could be inter-dependency between 2 projects but I can't figure out exactly which files. Is it possible for to get some debug version where something more printed before I get this error? Presently nothing is printed in log and directly (almost immediately) pops up this error window in eclipse (tried with 4.4 Luna & 4.6 Neon).  


Regards,
Alpesh

Julien HENRY

unread,
Jan 8, 2017, 8:50:02 AM1/8/17
to Alpesh Shah, SonarLint
Hi Alpesh,

I have created a special build that will catch and log the StackOverflowError. Please try it from: https://github.com/SonarSource/sonarlint-eclipse/releases/download/test_clearcase/org.sonarlint.eclipse.site-2.6.0-SNAPSHOT.zip

I hope it will help the better understand the root cause.

++

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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarlint/b91228d5-353a-4eee-83a1-1649fa8ae630%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

alpe...@gmail.com

unread,
Jan 9, 2017, 2:15:41 AM1/9/17
to SonarLint, alpe...@gmail.com
Thanks Julien for special build. 

I got something that will help to narrow down issue.  From below stack trace I am not sure if issue with Clear Case or Sonarlint or the way my projects are organised in multilevel maven projects.


Unable to analyze changed files
java
.lang.StackOverflowError
 at org
.eclipse.core.runtime.Path.<init>(Path.java:208)
 at org
.eclipse.core.internal.watson.ElementTreeIterator.requestPath(ElementTreeIterator.java:167)
 at org
.eclipse.core.internal.resources.ResourceProxy.requestFullPath(ResourceProxy.java:116)
 at org
.eclipse.core.internal.resources.ResourceProxy.requestResource(ResourceProxy.java:126)
 at org
.eclipse.core.internal.resources.Resource$2.visit(Resource.java:120)
 at org
.eclipse.core.internal.resources.Resource$1.visitElement(Resource.java:84)
 at org
.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:82)
 at org
.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:87)
 at org
.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:87)
 at org
.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:87)
 at org
.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:87)
 at org
.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:87)
 at org
.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:87)
 at org
.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:87)
 at org
.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:87)
 at org
.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:87)
 at org
.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:87)
 at org
.eclipse.core.internal.watson.ElementTreeIterator.iterate(ElementTreeIterator.java:129)
 at org
.eclipse.core.internal.resources.Resource.accept(Resource.java:94)
 at org
.eclipse.core.internal.resources.Resource.accept(Resource.java:52)
 at org
.eclipse.core.internal.resources.Resource.accept(Resource.java:117)
 at org
.eclipse.core.internal.resources.Resource.accept(Resource.java:105)
 at com
.ibm.rational.clearcase.ide.plugin.CCSubscriber.members(CCSubscriber.java:100)
 at org
.sonarlint.eclipse.core.internal.jobs.AnalyzeChangedFilesJob.collect(AnalyzeChangedFilesJob.java:144)
 at org
.sonarlint.eclipse.core.internal.jobs.AnalyzeChangedFilesJob.collect(AnalyzeChangedFilesJob.java:145)
 at org
.sonarlint.eclipse.core.internal.jobs.AnalyzeChangedFilesJob.collect(AnalyzeChangedFilesJob.java:145)
 at org
.sonarlint.eclipse.core.internal.jobs.AnalyzeChangedFilesJob.collect(AnalyzeChangedFilesJob.java:145)


............................  same last line repeats......


I suspect, issue may be the way my maven projects are organised because when I analyzed another project at little higher level, I see below error message which shows that execution moved little further but memory give up :(

Unable to analyze changed files
java
.lang.OutOfMemoryError: GC overhead limit exceeded
 at java
.lang.String.substring(Unknown Source)
 at org
.eclipse.core.runtime.Path.computeSegments(Path.java:547)
 at org
.eclipse.core.runtime.Path.initialize(Path.java:669)
 at org
.eclipse.core.runtime.Path.<init>(Path.java:208)
 at org
.eclipse.core.internal.watson.ElementTreeIterator.requestPath(ElementTreeIterator.java:167)
 at org
.eclipse.core.internal.resources.ResourceProxy.requestFullPath(ResourceProxy.java:116)
 at org
.eclipse.core.internal.resources.ResourceProxy.requestResource(ResourceProxy.java:126)
 at org
.eclipse.core.internal.resources.Resource$2.visit(Resource.java:120)
 at org
.eclipse.core.internal.resources.Resource$1.visitElement(Resource.java:84)
 at org
.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:82)
 at org
.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:87)
 at org
.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:87)
 at org
.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:87)
 at org
.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:87)
 at org
.eclipse.core.internal.watson.ElementTreeIterator.iterate(ElementTreeIterator.java:129)
 at org
.eclipse.core.internal.resources.Resource.accept(Resource.java:94)
 at org
.eclipse.core.internal.resources.Resource.accept(Resource.java:52)
 at org
.eclipse.core.internal.resources.Resource.accept(Resource.java:117)
 at org
.eclipse.core.internal.resources.Resource.accept(Resource.java:105)
 at com
.ibm.rational.clearcase.ide.plugin.CCSubscriber.members(CCSubscriber.java:100)
 at org
.sonarlint.eclipse.core.internal.jobs.AnalyzeChangedFilesJob.collect(AnalyzeChangedFilesJob.java:144)
 at org
.sonarlint.eclipse.core.internal.jobs.AnalyzeChangedFilesJob.collect(AnalyzeChangedFilesJob.java:145)


For your information, I have around 60 projects which are organised in 3 level deep hierarchy and built by single root pom. Where root pom has some modules defined and there are sun modules e.g.

Root Project Pom
-- Module 1
-- Module 2
-- Sub Root Project pom 1
------ Module 3
------ Module 4
-- Sub Root Project pom 1
------ Module 5
------ Module 6

Root and Sub root project pom is just defining modules to be built as part of own build. Earlier I was trying to check on Module 4 which has Stackoverflow error. Now I checked with Module 1 which is causing Memory issue. I will see to resolve memory issue but meanwhile thanks to give some hint.  One more point is there are modules which are built as part of Sub root project but physical directory is outside of sub root project directory.

PS: This may be not correct way to organize maven projects but it is legacy structure which I have already raised concern to change.


Regards,
Alpesh

On Sunday, January 8, 2017 at 7:20:02 PM UTC+5:30, Julien HENRY wrote:
Hi Alpesh,

I have created a special build that will catch and log the StackOverflowError. Please try it from: https://github.com/SonarSource/sonarlint-eclipse/releases/download/test_clearcase/org.sonarlint.eclipse.site-2.6.0-SNAPSHOT.zip

I hope it will help the better understand the root cause.

++

Julien
2017-01-06 11:57 GMT+01:00 <alpe...@gmail.com>:
Just to give background, with new version of SonarLint there is feature to see new issues coming from change file. This is shown in new tab called "SonarLint Report".  In order to work that SonarLint plugin need to talk to SCM plugin to fetch changeset.  This is not working for Clear case. Older version of clear case plugin 7.x version has not even implemented method getSubscriber() method in ProviderType which will return subscribers list. With new Clear Case plugin (Clear Team Explorer plugin version 8.0.1) , now method is implemented but still changeset retrieval part not working. 

With latest Clear case plugin version and Sonarlint plugin 2.5.0, when I click on Current project to get new issues in changed file, I don't get anything but popup saying "An internal error occurred during: "Analyze changeset". java.lang.StackOverflowError".  There is absolutely nothing printed in debug log or output log. 


As far as I know there is nothing like symbolic link or virtual resource in project. There could be inter-dependency between 2 projects but I can't figure out exactly which files. Is it possible for to get some debug version where something more printed before I get this error? Presently nothing is printed in log and directly (almost immediately) pops up this error window in eclipse (tried with 4.4 Luna & 4.6 Neon).  


Regards,
Alpesh

--
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.
Message has been deleted

alpe...@gmail.com

unread,
Jan 9, 2017, 2:33:55 AM1/9/17
to SonarLint, alpe...@gmail.com
FYI, when I increased Eclipse memory, it hang the Eclipse (Neon 4.6) during change set analysis.

Julien HENRY

unread,
Jan 9, 2017, 4:21:38 AM1/9/17
to Alpesh Shah, SonarLint
For me there is a bug in ClearCase since Subscriber::members seems to return the same resource (or maybe a cycle). 

Please try this new build were I have added more logs to spot the offending resource:


2017-01-09 8:33 GMT+01:00 <alpe...@gmail.com>:
FYI, when I increased Eclipse memory, it hang the Eclipse (Neon 4.6) during change set analysis.

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarlint/ffa7acc7-44c5-4951-8b7d-6129a76e2029%40googlegroups.com.

alpe...@gmail.com

unread,
Jan 9, 2017, 6:59:30 AM1/9/17
to SonarLint, alpe...@gmail.com
Hello Julien,

I see below messages now


Collecting SCM status for /MyProject
Collecting SCM status for /MyProject
Collecting SCM status for /MyProject
Collecting SCM status for /MyProject

----------- After lots of above lines -------------


Unable to analyze changed files
java
.lang.StackOverflowError

 at org
.eclipse.core.runtime.Path.initialize(Path.java:669)
 at org
.eclipse.core.runtime.Path.<init>(Path.java:208)
 at org
.eclipse.core.internal.watson.ElementTreeIterator.requestPath(ElementTreeIterator.java:167)
 at org
.eclipse.core.internal.resources.ResourceProxy.requestFullPath(ResourceProxy.java:116)
 at org
.eclipse.core.internal.resources.ResourceProxy.requestResource(ResourceProxy.java:126)
 at org
.eclipse.core.internal.resources.Resource$2.visit(Resource.java:120)
 at org
.eclipse.core.internal.resources.Resource$1.visitElement(Resource.java:84)
 at org
.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:82)
 at org
.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:87)
 at org
.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:87)
 at org
.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:87)
 at org
.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:87)

 at org
.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:87)
 at org
.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:87)
 at org
.eclipse.core.internal.watson.ElementTreeIterator.iterate(ElementTreeIterator.java:129)
 at org
.eclipse.core.internal.resources.Resource.accept(Resource.java:94)
 at org
.eclipse.core.internal.resources.Resource.accept(Resource.java:52)
 at org
.eclipse.core.internal.resources.Resource.accept(Resource.java:117)
 at org
.eclipse.core.internal.resources.Resource.accept(Resource.java:105)
 at com
.ibm.rational.clearcase.ide.plugin.CCSubscriber.members(CCSubscriber.java:100)

 at org
.sonarlint.eclipse.core.internal.jobs.AnalyzeChangedFilesJob.collect(AnalyzeChangedFilesJob.java:146)

For better understanding if Clear Case code has any issue, here is clear case plugin code which I decompiled

public IResource[] members(IResource resource)
   
throws TeamException
 
{
    org
.eclipse.core.resources.IProject pj = null;
   
Visitor visitor = new Visitor(null);
   
if ((resource instanceof IProject)) {
      pj
= (IProject)resource;
   
} else {
      pj
= resource.getProject();
   
}
   
if (CMService.getDefault().isCCControlled(pj)) {
     
try
     
{
        resource
.accept(visitor);
       
return visitor.getIResourceArray();
     
}
     
catch (CoreException e)
     
{
       
CTELogger.logError(e);
       
return new IResource[0];
     
}
   
}
   
return new IResource[0];
 
}


Here is private Visitor class used in above code

private class Visitor
    implements IResourceVisitor
  {
    private ArrayList<IResource> rList = new ArrayList();
    
    private Visitor() {}
    
    public boolean visit(IResource resource)
      throws CoreException
    {
      if (!this.rList.contains(resource)) {
        this.rList.add(resource);
      }
      if ((resource instanceof IFile)) {
        return false;
      }
      if (((resource instanceof IFolder)) || ((resource instanceof IProject))) {
        return true;
      }
      return false;
    }
    
    public IResource[] getIResourceArray()
    {
      IResource[] irArray = (IResource[])this.rList.toArray(new IResource[this.rList.size()]);
      return irArray;
    }
  }

Regards,
Alpesh

Reply all
Reply to author
Forward
0 new messages