Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 341596

Summary: Infinite loop in org.eclipse.acceleo.common.utils.CompactLinkedHashSet#deleteIndex
Product: [Modeling] Acceleo Reporter: Nicolas Bros <nicolas.bros>
Component: CoreAssignee: Project Inbox <acceleo-inbox>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: laurent.goubet, modisco.web-inbox
Version: 3.0.0   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:
Bug Depends on:    
Bug Blocks: 341193    
Attachments:
Description Flags
stacktrace none

Description Nicolas Bros CLA 2011-04-01 05:49:31 EDT
Created attachment 192344 [details]
stacktrace

Some MoDisco unit tests are failing due to a timeout. It appears that the tests get stuck in an infinite loop in Acceleo code:
I think that the while loop in CompactLinkedHashSet#deleteIndex never meets its condition.

Note that I couldn't reproduce this locally. It only happens randomly on a Hudson instance on Eclipse servers.

See the attached stack trace.
Comment 1 Nicolas Bros CLA 2011-04-01 06:08:52 EDT
This is with:
org.eclipse.acceleo.common_3.1.0.v20110323-1016.jar

Note that the test in question doesn't use Acceleo explicitly. The test is deleting a project, which causes a workspace change notification, which Acceleo acts on by (trying to) remove an element from the set.
Comment 2 Laurent Goubet CLA 2011-04-01 07:42:10 EDT
I can't understand how this loop could be infinite ... Could you tell me which of your unit test fails, and how I can reproduce the problem if there are mandatory steps other than simply launching the offending suite?
Comment 3 Nicolas Bros CLA 2011-04-01 07:58:09 EDT
(In reply to comment #2)
> I can't understand how this loop could be infinite ... Could you tell me which
> of your unit test fails

The test is here:
https://dev.eclipse.org/svnroot/modeling/org.eclipse.mdt.modisco/tests/trunk/org.eclipse.modisco.jee.jsp.discoverer.tests/src/org/eclipse/modisco/jee/jsp/discoverer/tests/compatibility/TestHtml.java

> and how I can reproduce the problem if there are
> mandatory steps other than simply launching the offending suite?
I couldn't identify which conditions triggered this problem. This happens often (but not at each run) on Hudson, but I couldn't reproduce locally.

Maybe we could try to run the tests on Hudson with a version of the acceleo.common plug-in with some debug code to print information about what happens in the method and in the loop?
Comment 4 Laurent Goubet CLA 2011-04-01 08:06:04 EDT
"couldn't reproduce locally" and "random" are two things I really don't like to see on bugzillas :p.

I've just commited a fix on HEAD that should remove the possibility of a failure (that the only possibility I see for an infinite loop there). Could you try and see if you manage to reproduce?
Comment 5 Nicolas Bros CLA 2011-04-01 08:28:17 EDT
(In reply to comment #4)
> "couldn't reproduce locally" and "random" are two things I really don't like to
> see on bugzillas :p.

I know, me neither :)

> I've just commited a fix on HEAD that should remove the possibility of a
> failure (that the only possibility I see for an infinite loop there). Could you
> try and see if you manage to reproduce?

Do you have a nightly update site from which I can get the fixed binaries?

I looked in:
http://download.eclipse.org/modeling/m2t/acceleo/updates/nightly/3.1/
But it seems the last version dates back from 2011-03-21
Comment 6 Laurent Goubet CLA 2011-04-01 08:44:33 EDT
I just promoted a new nightly with this change, you can grab it from the nightly update site you mentionned in your previous comment :).
Comment 7 Nicolas Bros CLA 2011-04-01 09:08:38 EDT
Thank you. I will report back here after a few builds to confirm the problem is solved.
Comment 8 Nicolas Bros CLA 2011-04-05 05:27:26 EDT
I haven't seen this error again since I switched to the nightly build.
So, I'm marking this bug as fixed.
Comment 9 Laurent Goubet CLA 2011-04-05 05:32:58 EDT
Thanks for the update. I hope this is indeed fixed and not hidden, but with no way to validate, I'll just pray this doesn't pop out again some time in the future.
Comment 10 Laurent Goubet CLA 2011-08-18 04:21:54 EDT
Closing our "resolved" and "verified" bugs.