Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » XtextReconcilerJob popup error (start > length)
XtextReconcilerJob popup error (start > length) [message #1790057] Mon, 04 June 2018 10:03 Go to next message
Axel RICHARD is currently offline Axel RICHARDFriend
Messages: 35
Registered: September 2010
Location: France
Member
Hello,

With Xtext 2.10, I sometimes get a popup error: XtextReconcilerJob start > length when I type something invalid with my language.

I tried to update to Xtext 2.14, but I still get the popup.

The problem is the error seems not related with my source code. The stack trace only mention xtext, so It is difficult for me to fix the problem.

Here is the stack trace associated:

!ENTRY org.eclipse.core.jobs 4 2 2018-06-04 11:42:52.343
!MESSAGE An internal error occurred during: "XtextReconcilerJob".
!STACK 0
java.lang.StringIndexOutOfBoundsException: start > length()
at java.lang.AbstractStringBuilder.replace(AbstractStringBuilder.java:853)
at java.lang.StringBuilder.replace(StringBuilder.java:262)
at org.eclipse.xtext.ui.editor.reconciler.ReconcilerReplaceRegion$Builder.add(ReconcilerReplaceRegion.java:89)
at org.eclipse.xtext.ui.editor.reconciler.XtextReconciler.getMergedReplaceRegion(XtextReconciler.java:405)
at org.eclipse.xtext.ui.editor.reconciler.XtextReconciler.doRun(XtextReconciler.java:434)
at org.eclipse.xtext.ui.editor.reconciler.XtextReconciler.access$3(XtextReconciler.java:430)
at org.eclipse.xtext.ui.editor.reconciler.XtextReconciler$1.process(XtextReconciler.java:364)
at org.eclipse.xtext.ui.editor.reconciler.XtextReconciler$1.process(XtextReconciler.java:1)
at org.eclipse.xtext.util.concurrent.IUnitOfWork$Void.exec(IUnitOfWork.java:37)
at org.eclipse.xtext.resource.OutdatedStateManager.exec(OutdatedStateManager.java:91)
at org.eclipse.xtext.ui.editor.model.XtextDocument$XtextDocumentLocker.modify(XtextDocument.java:433)
at org.eclipse.xtext.ui.editor.model.XtextDocument.internalModify(XtextDocument.java:166)
at org.eclipse.xtext.ui.editor.reconciler.XtextReconciler.run(XtextReconciler.java:361)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)

How to fix this problem ? Any help would be appreciated.

Best regards,


Axel Richard
Obeo
Re: XtextReconcilerJob popup error (start > length) [message #1790059 is a reply to message #1790057] Mon, 04 June 2018 10:27 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 12388
Registered: July 2009
Senior Member
Could you provide a minimal grammar and model that reproduced this

Need professional support for Xtext, Xpand, EMF?
Go to: https://xtext.itemis.com
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: XtextReconcilerJob popup error (start > length) [message #1790061 is a reply to message #1790059] Mon, 04 June 2018 10:44 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 12388
Registered: July 2009
Senior Member
looks like https://bugs.eclipse.org/bugs/show_bug.cgi?id=471849 https://bugs.eclipse.org/bugs/show_bug.cgi?id=413290

Need professional support for Xtext, Xpand, EMF?
Go to: https://xtext.itemis.com
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: XtextReconcilerJob popup error (start > length) [message #1790064 is a reply to message #1790061] Mon, 04 June 2018 11:12 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 6112
Registered: July 2009
Senior Member
Hi

I've seen similar things and decided that it was failure to observe the IUnitOfText lockout correctly. Wasn't sure whether it was my bad code or Xtext's. My suspicion is that the the integrity of the original design has slipped as threading has evolved. It is certainly not uncommon for editors to get into a stale state that needs a well-chosen edit to force a reparse.

Regards

Ed Willink
Re: XtextReconcilerJob popup error (start > length) [message #1790065 is a reply to message #1790064] Mon, 04 June 2018 11:25 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 12388
Registered: July 2009
Senior Member
this could either be a bug in the xtext reconciler or a race. for both it would be helpful to have reproducible steps

Need professional support for Xtext, Xpand, EMF?
Go to: https://xtext.itemis.com
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: XtextReconcilerJob popup error (start > length) [message #1790076 is a reply to message #1790065] Mon, 04 June 2018 12:30 Go to previous messageGo to next message
Axel RICHARD is currently offline Axel RICHARDFriend
Messages: 35
Registered: September 2010
Location: France
Member
Thanks gentlemen for your answers.

Unfortunately I can't share a minimal grammar and model in my context. I should have mention this in my post, and I know I will be quite diffucult to progress on this issue without reproducible steps.
Indeed, https://bugs.eclipse.org/bugs/show_bug.cgi?id=471849 https://bugs.eclipse.org/bugs/show_bug.cgi?id=413290 seem to be the same problem.

Best regards,


Axel Richard
Obeo
Re: XtextReconcilerJob popup error (start > length) [message #1790077 is a reply to message #1790076] Mon, 04 June 2018 12:37 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 12388
Registered: July 2009
Senior Member
=> you need to analyze locally.
-do this happen when you edit small files or bug files
-does it happen if you edit slow or edit false
-does it happen if you expand the length (type) or if you shrink (delete)
-if you have a look at the code (e.g. ReconcilerReplaceRegion) and trace back the data: where does the wrong data come from?
-is in org.eclipse.xtext.ui.editor.reconciler.XtextReconciler.getMergedReplaceRegion(XtextResource) the resource text ok or are the events data outdated?


Need professional support for Xtext, Xpand, EMF?
Go to: https://xtext.itemis.com
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: XtextReconcilerJob popup error (start > length) [message #1790087 is a reply to message #1790077] Mon, 04 June 2018 15:10 Go to previous messageGo to next message
Axel RICHARD is currently offline Axel RICHARDFriend
Messages: 35
Registered: September 2010
Location: France
Member
Quote:

-do this happen when you edit small files or bug files

It happens with small files. I never tested with big files, and big files have no real meaning in my context.

Quote:

-does it happen if you edit slow or edit false

It happens when I modify a valid expression to an invalid expression, and I edit slow. Error markers appear after few seconds, and then when I try to validate my expression, the popup appears.

Quote:

-does it happen if you expand the length (type) or if you shrink (delete)

It happens when I modify a valid expression to an invalid expression that is longer than the previous valid one. If the invalid expression is smaller than the previous valid one, the popup is not raised.

Quote:

-if you have a look at the code (e.g. ReconcilerReplaceRegion) and trace back the data: where does the wrong data come from?

I don't know.

Quote:

-is in org.eclipse.xtext.ui.editor.reconciler.XtextReconciler.getMergedReplaceRegion(XtextResource) the resource text ok or are the events data outdated?

The text seems ok.


Axel Richard
Obeo
Re: XtextReconcilerJob popup error (start > length) [message #1790088 is a reply to message #1790087] Mon, 04 June 2018 15:19 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 12388
Registered: July 2009
Senior Member
as is said: this needs to be debugged and therefore to be reproduced or debugged there where it occurs

Need professional support for Xtext, Xpand, EMF?
Go to: https://xtext.itemis.com
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: XtextReconcilerJob popup error (start > length) [message #1790089 is a reply to message #1790088] Mon, 04 June 2018 15:45 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 6112
Registered: July 2009
Senior Member
Hi

I debugged it once in situ. It was 'impossible' demonstrating that a concurrency had occurred. I think it somehow needs to be instrumented by Xtext. I don't recall an Xtext exception ever being thrown because I didn't use a IUnitOfWork correctly, rather Sebastian or Jan or ... kindly pointed out the error of my ways in a bug report / forum message.

While I wouldn't particularly advocate the nannying of EMF Transaction within Papyrus that insists on an appropriate Modify Transaction before allowing mutable EMF operations, it might help if Xtext was able to assert that certain critical operations are within a correct IUnitOfWork. Perhaps a debug variant of Xtext could leverage EMF Transaction. to demonstrate that the primary Xtext functionality is as intended, and optionally allow developers to check their extensions.

Without instrumentation, this kind of concurrency bug will only be found by luck or insightful review.

Regards

Ed Willink
Previous Topic:Reference other Xtext model
Next Topic:LanguageServer with Apache HTTP Client, endless wait on read
Goto Forum:
  


Current Time: Sun Nov 18 19:25:38 GMT 2018

Powered by FUDForum. Page generated in 0.02576 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top