eclipse-xtext / eclipse-xtext/xtext

[generator][trace] LeafIterator cannot handle zero length TraceRegions

Open
#2,573 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Java
Stars
831
Forks
330
Avg merge
3d 7h
Merged PRs (30d)
12

Description

using xtext 2.8.4

the LeafIterator.computeNext() method may run into a infinite loop if there is a trace region with length zero.

if current.offset == expectedOffset it will return firstLeafOfCurrent will be returned.
this does not advance expectedOffset since the length is zero.

i assume the zero length based regions should be filtered out before (or never been created) or the iterator should be able to handle them.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with LeafIterator.computeNext() and trace-region handling in the generator trace subsystem. Reproduce the infinite loop using a TraceRegion with zero length, then determine whether such regions should be filtered before iteration or handled by the iterator. Done means zero-length regions no longer cause non-termination.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
devtools
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.