mirror of
https://github.com/NixOS/nix.git
synced 2025-11-24 11:19:35 +01:00
Similar to the deepSeq fix, toJSON on deeply nested structures caused an uncontrolled OS-level stack overflow. Fix by adding call depth tracking to printValueAsJSON.
30 lines
1.3 KiB
Text
30 lines
1.3 KiB
Text
error:
|
|
… while calling the 'toJSON' builtin
|
|
at /pwd/lang/eval-fail-toJSON-stack-overflow.nix:8:1:
|
|
7| in
|
|
8| builtins.toJSON reverseLinkedList
|
|
| ^
|
|
9|
|
|
|
|
… while evaluating attribute 'tail'
|
|
at /pwd/lang/eval-fail-toJSON-stack-overflow.nix:6:67:
|
|
5| long = builtins.genList (x: x) 100000;
|
|
6| reverseLinkedList = builtins.foldl' (tail: head: { inherit head tail; }) null long;
|
|
| ^
|
|
7| in
|
|
|
|
(9997 duplicate frames omitted)
|
|
|
|
… while evaluating attribute 'head'
|
|
at /pwd/lang/eval-fail-toJSON-stack-overflow.nix:6:62:
|
|
5| long = builtins.genList (x: x) 100000;
|
|
6| reverseLinkedList = builtins.foldl' (tail: head: { inherit head tail; }) null long;
|
|
| ^
|
|
7| in
|
|
|
|
error: stack overflow; max-call-depth exceeded
|
|
at /pwd/lang/eval-fail-toJSON-stack-overflow.nix:6:62:
|
|
5| long = builtins.genList (x: x) 100000;
|
|
6| reverseLinkedList = builtins.foldl' (tail: head: { inherit head tail; }) null long;
|
|
| ^
|
|
7| in
|