Skip to content

Changes in JSON.dump behaviour with cyclical structures #404

@ksylvest

Description

@ksylvest

Ruby JSON appears to have changed parsing of errors between v2.6 and v2.7 (and JSON v2.2.0 vs v2.3.0). For example - when running:

require 'json'

data = {}
data['cycle'] = data
JSON.dump(data)

With Ruby v2.6.5 / JSON v2.2.0

This raises a SystemStackError

With Ruby v2.7.0 / JSON v2.3.0

This causes fatal (machine stack overflow in critical region)

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