Skip to content

Deep JSON causes stack overflow #1180

Closed

Description

@jdh30

JsonValue parses JSON uses a suite of mutually recursive functions but the recursive calls are not in tail position so deep JSON values cause a stack overflow.

For example:

String.replicate 50000 "[" + String.replicate 50000 "]"
|> FSharp.Data.JsonValue.Parse

causes a stack overflow on my machine.

Activity

  1. ovatsus commented on Sep 1, 2018

    @ovatsus

    @jdh30, could you send a PR making them tail recursive?

  2. added a commit that references this issue on Oct 28, 2018
    54b8864
  3. added a commit that references this issue on Jun 18, 2019
    715c219
  4. added 2 commits that reference this issue on Oct 5, 2020
    17c5632
    91cae9d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions