nix-super/doc/manual
Rebecca Turner 7434caca05
Fix segfault on infinite recursion in some cases
This fixes a segfault on infinite function call recursion (rather than
infinite thunk recursion) by tracking the function call depth in
`EvalState`.

Additionally, to avoid printing extremely long stack traces, stack
frames are now deduplicated, with a `(19997 duplicate traces omitted)`
message. This should only really be triggered in infinite recursion
scenarios.

Before:

    $ nix-instantiate --eval --expr '(x: x x) (x: x x)'
    Segmentation fault: 11

After:

    $ nix-instantiate --eval --expr '(x: x x) (x: x x)'
    error: stack overflow

           at «string»:1:14:
                1| (x: x x) (x: x x)
                 |              ^

    $ nix-instantiate --eval --expr '(x: x x) (x: x x)' --show-trace
    error:
           … from call site
             at «string»:1:1:
                1| (x: x x) (x: x x)
                 | ^

           … while calling anonymous lambda
             at «string»:1:2:
                1| (x: x x) (x: x x)
                 |  ^

           … from call site
             at «string»:1:5:
                1| (x: x x) (x: x x)
                 |     ^

           … while calling anonymous lambda
             at «string»:1:11:
                1| (x: x x) (x: x x)
                 |           ^

           … from call site
             at «string»:1:14:
                1| (x: x x) (x: x x)
                 |              ^

           (19997 duplicate traces omitted)

           error: stack overflow
           at «string»:1:14:
                1| (x: x x) (x: x x)
                 |              ^
2023-12-29 22:16:44 -08:00
..
rl-next Fix segfault on infinite recursion in some cases 2023-12-29 22:16:44 -08:00
src Change "dervation" typos to "derivation" 2023-12-26 17:12:28 -05:00
theme doc/manual: don't need to copy highlight.js manually 2021-08-04 19:47:05 -07:00
_redirects add redirect to new store page 2023-12-01 01:54:48 +01:00
anchors.jq doc: Port anchors preprocessor to jq script 2022-05-26 18:17:21 +02:00
book.toml manual: Check links 2023-01-10 22:30:41 +01:00
custom.css disallow selecting shell prompt in code samples 2022-12-05 11:01:46 +01:00
generate-builtin-constants.nix use lookup paths in helper expressions consistently 2023-11-30 21:53:31 +01:00
generate-builtins.nix document fetchTree (#9258) 2023-12-10 05:16:32 +00:00
generate-manpage.nix fix links in stores overview 2023-12-02 00:56:41 +01:00
generate-settings.nix document fetchTree (#9258) 2023-12-10 05:16:32 +00:00
generate-store-info.nix document fetchTree (#9258) 2023-12-10 05:16:32 +00:00
generate-store-types.nix Document each store type on its own page 2023-12-01 01:27:52 +01:00
generate-xp-features-shortlist.nix use lookup paths in helper expressions consistently 2023-11-30 21:53:31 +01:00
generate-xp-features.nix Document each store type on its own page 2023-12-01 01:27:52 +01:00
local.mk Split --disable-tests, fix cross builds 2023-12-18 10:47:50 -05:00
quote-literals.xsl Generate release notes again 2014-03-12 14:24:29 +01:00
redirects.js add path based redirects 2023-11-27 08:33:03 +01:00
utils.nix Document each store type on its own page 2023-12-01 01:27:52 +01:00