Skip to content

Segfault when displaying a self-referencing attrset as JSON #12289

Open
@hgl

Description

Describe the bug

When displaying a self-referencing attrset as JSON, it would be great if nix could show an error message along with the stack.

Steps To Reproduce

test.nix

let
  a = {
    b = a;
  };
in
a
$ nix eval --json -f test.nix .
fish: Job 1, 'nix eval --json -f test.nix .' terminated by signal SIGSEGV (Address boundary error)

Expected behavior

An error message showing the stack

Metadata

Additional context

Checklist


Add 👍 to issues you find important.

Metadata

Assignees

No one assigned

    Labels

    bugidea approvedThe given proposal has been discussed and approved by the Nix team. An implementation is welcome.languageThe Nix expression language; parser, interpreter, primops, evaluation, etc

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions