aboutsummaryrefslogtreecommitdiff
path: root/doc/manual/rl-next/stack-overflow-segfaults.md
diff options
context:
space:
mode:
authoreldritch horrors <pennae@lix.systems>2024-03-04 07:35:20 +0100
committereldritch horrors <pennae@lix.systems>2024-03-04 07:35:20 +0100
commit96f1a404d08d1dd00ef395bcdc53c7599c860ecf (patch)
treec2c10849ccfa865ae649be873fa9ed0d6d4d4da6 /doc/manual/rl-next/stack-overflow-segfaults.md
parente1b1e6f7abb62b7e86a1d12aead1bd931089cd7a (diff)
Merge pull request #9617 from 9999years/stack-overflow-segfault
Fix segfault on infinite recursion in some cases (cherry picked from commit bf1b294bd81ca76c5ec9fe3ecd52196bf52a8300) Change-Id: Id137541426ec8536567835953fccf986a3aebf16
Diffstat (limited to 'doc/manual/rl-next/stack-overflow-segfaults.md')
-rw-r--r--doc/manual/rl-next/stack-overflow-segfaults.md32
1 files changed, 32 insertions, 0 deletions
diff --git a/doc/manual/rl-next/stack-overflow-segfaults.md b/doc/manual/rl-next/stack-overflow-segfaults.md
new file mode 100644
index 000000000..3d9753248
--- /dev/null
+++ b/doc/manual/rl-next/stack-overflow-segfaults.md
@@ -0,0 +1,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)
+ | ^
+```