aboutsummaryrefslogtreecommitdiff
path: root/doc/manual/rl-next/stack-overflow-segfaults.md
blob: 3d975324830de9d0c54f633b8d3b8d1057a12a2b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
---
synopsis: Some stack overflow segfaults are fixed
issues: 9616
prs: 9617
---

The number of nested function calls has been restricted, to detect and report
infinite function call recursions. The default maximum call depth is 10,000 and
can be set with [the `max-call-depth`
option](@docroot@/command-ref/conf-file.md#conf-max-call-depth).

This fixes segfaults or the following unhelpful error message in many cases:

    error: stack overflow (possible infinite recursion)

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)
             |              ^
```