summary refs log tree commit diff
path: root/gnu/packages/patches
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2022-11-06 12:32:58 +0100
committerLudovic Courtès <ludo@gnu.org>2022-11-06 12:38:03 +0100
commit7138ba34fa11d3eb2d9e7e44771e698f53415dbc (patch)
tree6881c85ad74ff374b83720c665a6960e35024db7 /gnu/packages/patches
parent905443abb742315d89901f3b011980ac796d78a4 (diff)
downloadguix-7138ba34fa11d3eb2d9e7e44771e698f53415dbc.tar.gz
gnu: guile@3.0.8: Add patch to address continuation memory leak.
* gnu/packages/patches/guile-continuation-stack-leak.patch: New patch.
* gnu/local.mk (dist_patch_DATA): Add it.
* gnu/packages/guile.scm (guile-3.0-latest)[source]: Use it.
Diffstat (limited to 'gnu/packages/patches')
-rw-r--r--gnu/packages/patches/guile-continuation-stack-leak.patch27
1 files changed, 27 insertions, 0 deletions
diff --git a/gnu/packages/patches/guile-continuation-stack-leak.patch b/gnu/packages/patches/guile-continuation-stack-leak.patch
new file mode 100644
index 0000000000..0e57b7bb4e
--- /dev/null
+++ b/gnu/packages/patches/guile-continuation-stack-leak.patch
@@ -0,0 +1,27 @@
+This patch fixes a memory leak when capturing and resuming delimited
+continuations intensively, as is the case with the Shepherd 0.9+:
+
+  https://issues.guix.gnu.org/59021
+
+diff --git a/libguile/vm.c b/libguile/vm.c
+index 6fd5c554f..516bae773 100644
+--- a/libguile/vm.c
++++ b/libguile/vm.c
+@@ -165,11 +165,13 @@ capture_stack (union scm_vm_stack_element *stack_top,
+                scm_t_dynstack *dynstack, uint32_t flags)
+ {
+   struct scm_vm_cont *p;
++  size_t stack_size;
+ 
+-  p = scm_gc_malloc (sizeof (*p), "capture_vm_cont");
+-  p->stack_size = stack_top - sp;
+-  p->stack_bottom = scm_gc_malloc (p->stack_size * sizeof (*p->stack_bottom),
+-                                   "capture_vm_cont");
++  stack_size = stack_top - sp;
++  p = scm_gc_malloc (sizeof (*p) + stack_size * sizeof (*p->stack_bottom),
++                     "capture_vm_cont");
++  p->stack_size = stack_size;
++  p->stack_bottom = (void *) ((char *) p + sizeof (*p));
+   p->vra = vra;
+   p->mra = mra;
+   p->fp_offset = stack_top - fp;