diff options
author | Efraim Flashner <[email protected]> | 2023-01-30 11:33:18 +0200 |
---|---|---|
committer | Efraim Flashner <[email protected]> | 2023-01-30 12:39:40 +0200 |
commit | 4cf1acc7f3033b50b0bf19e02c9f522d522d338c (patch) | |
tree | 9fd64956ee60304c15387eb394cd649e49f01467 /gnu/packages/patches/guile-fibers-fd-finalizer-leak.patch | |
parent | edb8c09addd186d9538d43b12af74d6c7aeea082 (diff) | |
parent | 595b53b74e3ef57a1c0c96108ba86d38a170a241 (diff) |
Merge remote-tracking branch 'origin/master' into core-updates
Conflicts:
doc/guix.texi
gnu/local.mk
gnu/packages/admin.scm
gnu/packages/base.scm
gnu/packages/chromium.scm
gnu/packages/compression.scm
gnu/packages/databases.scm
gnu/packages/diffoscope.scm
gnu/packages/freedesktop.scm
gnu/packages/gnome.scm
gnu/packages/gnupg.scm
gnu/packages/guile.scm
gnu/packages/inkscape.scm
gnu/packages/llvm.scm
gnu/packages/openldap.scm
gnu/packages/pciutils.scm
gnu/packages/ruby.scm
gnu/packages/samba.scm
gnu/packages/sqlite.scm
gnu/packages/statistics.scm
gnu/packages/syndication.scm
gnu/packages/tex.scm
gnu/packages/tls.scm
gnu/packages/version-control.scm
gnu/packages/xml.scm
guix/build-system/copy.scm
guix/scripts/home.scm
Diffstat (limited to 'gnu/packages/patches/guile-fibers-fd-finalizer-leak.patch')
-rw-r--r-- | gnu/packages/patches/guile-fibers-fd-finalizer-leak.patch | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/gnu/packages/patches/guile-fibers-fd-finalizer-leak.patch b/gnu/packages/patches/guile-fibers-fd-finalizer-leak.patch new file mode 100644 index 0000000000..2d8f9c2cf5 --- /dev/null +++ b/gnu/packages/patches/guile-fibers-fd-finalizer-leak.patch @@ -0,0 +1,54 @@ +Upstream fix for a memory leak introduced in Fibers 1.1.0 that would manifest +in shepherd: + + https://github.com/wingo/fibers/issues/65 + https://issues.guix.gnu.org/58631 + +diff --git a/fibers/scheduler.scm b/fibers/scheduler.scm +index 2b03941..760b037 100644 +--- a/fibers/scheduler.scm ++++ b/fibers/scheduler.scm +@@ -182,8 +182,10 @@ remote kernel thread." + (#f (warn "scheduler for unknown fd" fd)) + ((and events+waiters (active-events . waiters)) + ;; First, clear the active status, as the EPOLLONESHOT has +- ;; deactivated our entry in the epoll set. +- (set-car! events+waiters #f) ++ ;; deactivated our entry in the epoll set. Set the car to 0, not #f, so ++ ;; that 'schedule-tasks-for-active-fd' doesn't end up re-adding a ++ ;; finalizer on FD. ++ (set-car! events+waiters 0) + (set-cdr! events+waiters '()) + (unless (zero? (logand revents (logior EPOLLHUP EPOLLERR))) + (hashv-remove! (scheduler-fd-waiters sched) fd)) +@@ -336,21 +338,19 @@ expressed as an epoll bitfield." + + (let ((fd-waiters (hashv-ref (scheduler-fd-waiters sched) fd))) + (match fd-waiters +- ((active-events . waiters) +- (set-cdr! fd-waiters (acons events task waiters)) +- (unless (and active-events +- (= (logand events active-events) events)) +- (let ((active-events (logior events (or active-events 0)))) +- (set-car! fd-waiters active-events) +- (add-fdes-finalizer! fd (fd-finalizer fd-waiters)) +- (epoll-add*! (scheduler-epfd sched) fd +- (logior active-events EPOLLONESHOT))))) +- (#f ++ ((or #f (#f)) ;FD is new or was finalized + (let ((fd-waiters (list events (cons events task)))) + (hashv-set! (scheduler-fd-waiters sched) fd fd-waiters) + (add-fdes-finalizer! fd (fd-finalizer fd-waiters)) + (epoll-add*! (scheduler-epfd sched) fd +- (logior events EPOLLONESHOT))))))) ++ (logior events EPOLLONESHOT)))) ++ ((active-events . waiters) ++ (set-cdr! fd-waiters (acons events task waiters)) ++ (unless (= (logand events active-events) events) ++ (let ((active-events (logior events active-events))) ++ (set-car! fd-waiters active-events) ++ (epoll-add*! (scheduler-epfd sched) fd ++ (logior active-events EPOLLONESHOT)))))))) + + (define (schedule-task-when-fd-readable sched fd task) + "Arrange to schedule @var{task} on @var{sched} when the file |