Bug 242130 - SVN hangs in SVNRepositoryResource.getRoot() method
Summary: SVN hangs in SVNRepositoryResource.getRoot() method
Status: RESOLVED FIXED
Alias: None
Product: Subversive
Classification: Technology
Component: Core (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: Alexander Gurov CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-07-25 18:39 EDT by Neale Upstone CLA
Modified: 2008-08-07 05:23 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Neale Upstone CLA 2008-07-25 18:39:02 EDT
Build ID:  I20080617-2000

Steps To Reproduce:
Subversive ver: 0.7.1.I20080612-1500

The quirks of the project that might be relevant:
- I'd just renamed it (rename proj in Eclipse, rename folder on SVN server, and then do a "Switch..." to the new URL.
- The project contains an svn:external folder for src
- I'd just created a new package which hasn't yet been added nor committed.
- Commit is working on other projects


More information:
Maxing out one core here...

   java.lang.Thread.State: RUNNABLE
	at java.lang.AbstractStringBuilder.append(Unknown Source)
	at java.lang.StringBuilder.append(Unknown Source)
	at org.eclipse.team.svn.core.utility.SVNUtility.normalizeURL(SVNUtility.java:704)
	at org.eclipse.team.svn.core.svnstorage.SVNRepositoryResource.getParent(SVNRepositoryResource.java:126)
	at org.eclipse.team.svn.core.svnstorage.SVNRepositoryResource.getRoot(SVNRepositoryResource.java:138)
	- locked <0x0fe81ed0> (a org.eclipse.team.svn.core.svnstorage.SVNRepositoryFile)
	at org.eclipse.team.svn.core.utility.SVNUtility.isTagOperated(SVNUtility.java:1201)
	at org.eclipse.team.svn.ui.action.local.CommitAction.runImpl(CommitAction.java:42)
	at org.eclipse.team.svn.ui.action.AbstractSVNTeamAction$2.runImpl(AbstractSVNTeamAction.java:82)
	at org.eclipse.team.svn.core.operation.AbstractActionOperation.run(AbstractActionOperation.java:76)
	at org.eclipse.team.svn.core.operation.LoggedOperation.run(LoggedOperation.java:37)
	at org.eclipse.team.svn.core.utility.ProgressMonitorUtility.doTask(ProgressMonitorUtility.java:103)
	at org.eclipse.team.svn.core.utility.ProgressMonitorUtility.doTaskExternal(ProgressMonitorUtility.java:89)
	at org.eclipse.team.svn.core.utility.ProgressMonitorUtility.doTaskExternal(ProgressMonitorUtility.java:80)
	at org.eclipse.team.svn.ui.action.AbstractSVNTeamAction.execute(AbstractSVNTeamAction.java:75)
	at org.eclipse.team.internal.ui.actions.TeamAction.run(TeamAction.java:514)
	at org.eclipse.team.internal.ui.actions.TeamAction.runWithEvent(TeamAction.java:548)
	at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginAction.java:241)
	at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:583)
	at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:500)
	at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:411)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3823)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3422)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2382)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2346)
	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2198)
	at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:493)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:288)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:488)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:113)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:193)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:382)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:549)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1236)
Comment 1 Neale Upstone CLA 2008-07-25 19:09:18 EDT
Some further detail:
- I was able to commit some parts of the related project, but not then src folder where the new package was created.
- When trying to commit other changes using "Commit..." the changes were not selected by default as is normal (although I can see a reason why), but then got ignored when I selected them, resulting in a commit statement of:
    svn commit "C:\dev\workspace\proj" -m "WIP"

- If I used the Synchronise View, the commit succeeded:
    svn commit "C:\dev\workspace\proj\src\File.java" -N -m "WIP"

I found a workaround, which was to commit the new package via a checkout of the project to which the svn:external linked, and to then update my project to get those changes in.
Comment 2 Alexander Gurov CLA 2008-07-28 07:31:31 EDT
>at java.lang.AbstractStringBuilder.append(Unknown Source)
>at java.lang.StringBuilder.append(Unknown Source)

This part of the provided stack trace points to the JRE libraries. Moreover this part of JRE libraries cannot hang if JVM works fine. So, please check your environment for hardware or software errors.
Comment 3 Neale Upstone CLA 2008-07-28 07:50:31 EDT
WHAT!?

This is a repeatable bug with a demonstrated workaround that occurs in SVN.

Please read the bug report.   Somehow, you are either calling append() repeatedly, or you are calling it with something huge.


Comment 4 Alexander Gurov CLA 2008-07-28 08:27:52 EDT
Neale, 

>This is a repeatable bug with a demonstrated workaround that occurs in SVN. Please read the bug report.
Good, but: 
1) I have read your report. I have checked your case several times before closing this report. I haven't any problems.
2) May be you provided wrong stack trace? If so, please check the topic at http://wiki.eclipse.org/How_to_report_a_deadlock

>Somehow, you are either calling append() repeatedly, or you are calling it with something huge.
The function code below:
public static String normalizeURL(String url) {
    StringTokenizer tokenizer = new StringTokenizer(PatternProvider.replaceAll(url, "([\\\\])+", "/"), "/", false);
    String retVal = "";
    while (tokenizer.hasMoreTokens()) {
        String token = tokenizer.nextToken();
        retVal += retVal.length() == 0 ? token : ("/" + token);
    }
    int idx = retVal.indexOf(':') + 1;
    return idx == 0 ? retVal : retVal.substring(0, idx) + (url.startsWith("file:///") ? "//" : "/") + retVal.substring(idx);
}


append() is called here:
        retVal += retVal.length() == 0 ? token : ("/" + token);
				
and here:
    return idx == 0 ? retVal : retVal.substring(0, idx) + (url.startsWith("file:///") ? "//" : "/") + retVal.substring(idx);

The string which is processed by this function is the URL related to one of resources in your project.

So, as for me the described problem looks incredibly.
Comment 5 Neale Upstone CLA 2008-07-28 08:53:29 EDT
Ok.

I don't understand why you think I reported a deadlock?  My report says "maxing out one core here" prior to giving the RUNNING stack trace.

Prior to submitting the report I scanned the stack trace for waits on locks held by other threads and could not see any issues.

The issue clearly seemed to be a running thread.

I'm a bit tight on time at the moment, but I'll see if I can re-create the issue (having had to work around it to get on) from scratch under debug, and step through what's going on.

Do note that this situation persisted through several "-clean" restarts of Eclipse.
Comment 6 Alexander Gurov CLA 2008-07-28 09:38:13 EDT
>I don't understand why you think I reported a deadlock?  My report says "maxing out one core here" prior to giving the RUNNING stack trace.
There is no difference between two reasons why a program stops responding: if it hangs on some lock object or if it pegged 100% of CPU time (or 100% of one of the CPU cores time).

>I'm a bit tight on time at the moment, but I'll see if I can re-create the issue (having had to work around it to get on) from scratch under debug, and step through what's going on.
Ok, thank you. I will wait for additional information on this problem.
Comment 7 Alexander Gurov CLA 2008-08-06 05:28:38 EDT
"Worker-28" prio=5 tid=0x292374d8 nid=0xce4 runnable [0x29f9e000..0x29f9fa68]
     at org.eclipse.core.runtime.Path.computeSegments(Path.java:483)
     at org.eclipse.core.runtime.Path.initialize(Path.java:600)
     at org.eclipse.core.runtime.Path.<init>(Path.java:162)
     at org.eclipse.team.svn.core.svnstorage.SVNRepositoryLocation.asRepositoryContainer(SVNRepositoryLocation.java:321)
     at org.eclipse.team.svn.core.svnstorage.SVNRepositoryLocationWrapper.asRepositoryContainer(SVNRepositoryLocationWrapper.java:63)
     at org.eclipse.team.svn.core.svnstorage.SVNRepositoryResource.asRepositoryContainer(SVNRepositoryResource.java:162)
     at org.eclipse.team.svn.core.svnstorage.SVNRepositoryResource.getParent(SVNRepositoryResource.java:131)
     at org.eclipse.team.svn.core.svnstorage.SVNRepositoryResource.getRoot(SVNRepositoryResource.java:138)
     - locked <0x08602ab8> (a org.eclipse.team.svn.core.svnstorage.SVNRepositoryFile)
     at org.eclipse.team.svn.ui.synchronize.update.UpdateSubscriber$2.cacheComments(UpdateSubscriber.java:166)
     at org.eclipse.team.svn.ui.synchronize.update.UpdateSubscriber$2.getComment(UpdateSubscriber.java:155)
     at org.eclipse.team.svn.core.svnstorage.SVNFileChange.getComment(SVNFileChange.java:68)
     - locked <0x08602b18> (a org.eclipse.team.svn.core.svnstorage.SVNFileChange)
     at org.eclipse.team.svn.core.svnstorage.SVNRemoteStorage.resourceChangeAsBytes(SVNRemoteStorage.java:212)
     at org.eclipse.team.svn.ui.synchronize.AbstractSVNSubscriber$2.runImpl(AbstractSVNSubscriber.java:233)
     at org.eclipse.team.svn.core.operation.AbstractActionOperation.run(AbstractActionOperation.java:76)
     at org.eclipse.team.svn.core.utility.ProgressMonitorUtility.doTask(ProgressMonitorUtility.java:103)
     at org.eclipse.team.svn.core.operation.CompositeOperation.runImpl(CompositeOperation.java:94)
     at org.eclipse.team.svn.core.operation.AbstractActionOperation.run(AbstractActionOperation.java:76)
     at org.eclipse.team.svn.core.operation.LoggedOperation.run(LoggedOperation.java:37)
     at org.eclipse.team.svn.core.utility.ProgressMonitorUtility.doTask(ProgressMonitorUtility.java:103)
     at org.eclipse.team.svn.core.utility.ProgressMonitorUtility.doTaskExternal(ProgressMonitorUtility.java:89)
     at org.eclipse.team.svn.ui.synchronize.AbstractSVNSubscriber.findChanges(AbstractSVNSubscriber.java:242)
     at org.eclipse.team.svn.ui.synchronize.AbstractSVNSubscriber$UpdateStatusOperation$2.run(AbstractSVNSubscriber.java:277)
     at org.eclipse.team.svn.core.utility.ProgressMonitorUtility.doSubTask(ProgressMonitorUtility.java:117)
     at org.eclipse.team.svn.core.operation.AbstractActionOperation.protectStep(AbstractActionOperation.java:145)
     at org.eclipse.team.svn.core.operation.AbstractActionOperation.protectStep(AbstractActionOperation.java:140)
     at org.eclipse.team.svn.ui.synchronize.AbstractSVNSubscriber$UpdateStatusOperation.runImpl(AbstractSVNSubscriber.java:275)
     at org.eclipse.team.svn.core.operation.AbstractActionOperation.run(AbstractActionOperation.java:76)
     at org.eclipse.team.svn.core.operation.LoggedOperation.run(LoggedOperation.java:37)
     at org.eclipse.team.svn.core.utility.ProgressMonitorUtility.doTask(ProgressMonitorUtility.java:103)
     at org.eclipse.team.svn.core.utility.ProgressMonitorUtility.doTaskExternal(ProgressMonitorUtility.java:89)
     at org.eclipse.team.svn.core.utility.ProgressMonitorUtility.doTaskExternal(ProgressMonitorUtility.java:80)
     at org.eclipse.team.svn.ui.synchronize.AbstractSVNSubscriber.refresh(AbstractSVNSubscriber.java:147)
     at org.eclipse.team.svn.ui.synchronize.update.UpdateSubscriber.refresh(UpdateSubscriber.java:62)
     at org.eclipse.team.internal.ui.synchronize.RefreshSubscriberParticipantJob.doRefresh(RefreshSubscriberParticipantJob.java:116)
     at org.eclipse.team.internal.ui.synchronize.RefreshParticipantJob.run(RefreshParticipantJob.java:309)
     at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)

"Worker-28" prio=5 tid=0x292374d8 nid=0xce4 runnable [0x29f9f000..0x29f9fa68]
     at java.util.LinkedHashMap.get(Unknown Source)
     at org.eclipse.team.svn.core.utility.PatternProvider.getPattern(PatternProvider.java:39)
     - locked <0x23d765a8> (a java.lang.Class)
     at org.eclipse.team.svn.core.utility.PatternProvider.replaceAll(PatternProvider.java:35)
     at org.eclipse.team.svn.core.utility.SVNUtility.normalizeURL(SVNUtility.java:719)
     at org.eclipse.team.svn.core.svnstorage.SVNRepositoryResource.getParent(SVNRepositoryResource.java:126)
     at org.eclipse.team.svn.core.svnstorage.SVNRepositoryResource.getRoot(SVNRepositoryResource.java:138)
     - locked <0x08602ab8> (a org.eclipse.team.svn.core.svnstorage.SVNRepositoryFile)
     at org.eclipse.team.svn.ui.synchronize.update.UpdateSubscriber$2.cacheComments(UpdateSubscriber.java:166)
     at org.eclipse.team.svn.ui.synchronize.update.UpdateSubscriber$2.getComment(UpdateSubscriber.java:155)
     at org.eclipse.team.svn.core.svnstorage.SVNFileChange.getComment(SVNFileChange.java:68)
     - locked <0x08602b18> (a org.eclipse.team.svn.core.svnstorage.SVNFileChange)
     at org.eclipse.team.svn.core.svnstorage.SVNRemoteStorage.resourceChangeAsBytes(SVNRemoteStorage.java:212)
     at org.eclipse.team.svn.ui.synchronize.AbstractSVNSubscriber$2.runImpl(AbstractSVNSubscriber.java:233)
     at org.eclipse.team.svn.core.operation.AbstractActionOperation.run(AbstractActionOperation.java:76)
     at org.eclipse.team.svn.core.utility.ProgressMonitorUtility.doTask(ProgressMonitorUtility.java:103)
     at org.eclipse.team.svn.core.operation.CompositeOperation.runImpl(CompositeOperation.java:94)
     at org.eclipse.team.svn.core.operation.AbstractActionOperation.run(AbstractActionOperation.java:76)
     at org.eclipse.team.svn.core.operation.LoggedOperation.run(LoggedOperation.java:37)
     at org.eclipse.team.svn.core.utility.ProgressMonitorUtility.doTask(ProgressMonitorUtility.java:103)
     at org.eclipse.team.svn.core.utility.ProgressMonitorUtility.doTaskExternal(ProgressMonitorUtility.java:89)
     at org.eclipse.team.svn.ui.synchronize.AbstractSVNSubscriber.findChanges(AbstractSVNSubscriber.java:242)
     at org.eclipse.team.svn.ui.synchronize.AbstractSVNSubscriber$UpdateStatusOperation$2.run(AbstractSVNSubscriber.java:277)
     at org.eclipse.team.svn.core.utility.ProgressMonitorUtility.doSubTask(ProgressMonitorUtility.java:117)
     at org.eclipse.team.svn.core.operation.AbstractActionOperation.protectStep(AbstractActionOperation.java:145)
     at org.eclipse.team.svn.core.operation.AbstractActionOperation.protectStep(AbstractActionOperation.java:140)
     at org.eclipse.team.svn.ui.synchronize.AbstractSVNSubscriber$UpdateStatusOperation.runImpl(AbstractSVNSubscriber.java:275)
     at org.eclipse.team.svn.core.operation.AbstractActionOperation.run(AbstractActionOperation.java:76)
     at org.eclipse.team.svn.core.operation.LoggedOperation.run(LoggedOperation.java:37)
     at org.eclipse.team.svn.core.utility.ProgressMonitorUtility.doTask(ProgressMonitorUtility.java:103)
     at org.eclipse.team.svn.core.utility.ProgressMonitorUtility.doTaskExternal(ProgressMonitorUtility.java:89)
     at org.eclipse.team.svn.core.utility.ProgressMonitorUtility.doTaskExternal(ProgressMonitorUtility.java:80)
     at org.eclipse.team.svn.ui.synchronize.AbstractSVNSubscriber.refresh(AbstractSVNSubscriber.java:147)
     at org.eclipse.team.svn.ui.synchronize.update.UpdateSubscriber.refresh(UpdateSubscriber.java:62)
     at org.eclipse.team.internal.ui.synchronize.RefreshSubscriberParticipantJob.doRefresh(RefreshSubscriberParticipantJob.java:116)
     at org.eclipse.team.internal.ui.synchronize.RefreshParticipantJob.run(RefreshParticipantJob.java:309)
     at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Comment 8 Alexander Gurov CLA 2008-08-07 05:23:38 EDT
It looks like the problem is in the SVNRepositoryResource.getParent() method. Unfortunately I still cannot reproduce this situation in debug environment (both stack traces are reported by another user) and the problem reason remains unclean. 
So, in order to avoid the problem I've added the validation code and instead of going to the endless loop now a debug exception should be thrown. This change will be available in the weekly build.

If after updating of the Subversive plug-in it is still going to the endless loop please reopen this report. Otherwise if the IllegalArgumentException with an URL in message is thrown, please report it as a new bug.