Skip to content

Reach crashes on input of large nxml files with a stack overflow #792

Description

@kwalcock

I believe that it comes down to a sequence of intervals being unioned using a reduceRight, which is not tail recursive. Changing to reduceLeft seems to fix the problem. Unfortunately, multiple dependencies are involved.

The problem can last be detected in this project at

val nxmlDoc: NxmlDocument = nxmlReader.read(nxml)

which leads to the nxmlreader project

https://github.com/lum-ai/nxmlreader/blob/ef7e1440faf5dcae54cc046ba26825b08f1c84e1/src/main/scala/ai/lum/nxmlreader/standoff/Tree.scala#L57

and then to common

https://github.com/lum-ai/common/blob/b7c0b70c460790088d655a98be178cbef9767a24/src/main/scala/ai/lum/common/Interval.scala#L399

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions