From: "Ludovic Courtès" <ludo@gnu.org>
To: 58631@debbugs.gnu.org
Subject: bug#58631: [Shepherd] Indefinite heap growth (memory leak)
Date: Sat, 22 Oct 2022 22:29:58 +0200 [thread overview]
Message-ID: <87ilkb4n5l.fsf_-_@gnu.org> (raw)
In-Reply-To: <87a65qhmh3.fsf@gnu.org> ("Ludovic Courtès"'s message of "Thu, 20 Oct 2022 11:29:28 +0200")
[-- Attachment #1: Type: text/plain, Size: 863 bytes --]
An update: I can reproduce in a VM running a slightly simplified version
of ‘hydra/berlin.scm’, with loop running:
while true; do wget -qO/dev/null http://localhost:3000/nix-cache-info; done
to trigger ‘guix publish’ logging.
Better, I can mostly reproduce the issue with the attached config file,
then starting shepherd:
rm -f sock && ./shepherd -s sock -c log-conf.scm -I
… monitoring heap usage:
./herd -s sock eval root '(gc-stats)'
… and triggering inetd service startup, which in turn triggers heap
growth:
while : ; do echo foo> /dev/tcp/localhost/4567 ; done
Then the heap size reported by ‘gc-stats’ seems to hit a threshold above
which is stop growing, or it grows too slowly (IOW the problem is not as
easy to observe as on berlin).
That’s pretty much all I have so far. :-/
Ludo’.
[-- Attachment #2: the shepherd config file --]
[-- Type: text/plain, Size: 1390 bytes --]
;; https://issues.guix.gnu.org/58631
(define %command
(list "/bin/sh" "-c"
(string-append "while true; do "
(string-concatenate
(make-list 30
(string-append
"echo "
(string-concatenate
(make-list 8 "logging "))
"; ")))
"sleep 0.2; "
" done")))
(define %echo-server
;; Simple echo server.
'("/bin/sh" "-c" "echo hello; read line; echo line; echo done"))
(define loss
(make-vector (* 10 (expt 2 20))))
(register-services
(make <service>
#:provides '(test-logging)
#:start (make-forkexec-constructor %command
#:log-file "/tmp/service.log")
#:stop (make-kill-destructor))
(make <service>
#:provides '(test-inetd)
#:start (make-inetd-constructor %echo-server
(list
(endpoint (make-socket-address
AF_INET
INADDR_LOOPBACK
4567))))
#:stop (make-inetd-destructor)))
(start 'test-logging)
(start 'test-inetd)
(pk 'init-gc (gc-stats))
next prev parent reply other threads:[~2022-10-24 1:14 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-19 12:17 bug#58631: Shepherd crash on berlin Ludovic Courtès
2022-10-19 16:24 ` Ludovic Courtès
2022-10-20 9:29 ` Ludovic Courtès
2022-10-21 13:07 ` Liliana Marie Prikler
2022-10-22 20:20 ` bug#58631: [Shepherd] Indefinite heap growth (memory leak) Ludovic Courtès
2022-10-22 20:21 ` Ludovic Courtès
2022-10-22 20:29 ` Ludovic Courtès [this message]
2022-10-29 10:01 ` Ludovic Courtès
2022-10-29 14:54 ` Maxime Devos
2022-10-30 9:39 ` Ludovic Courtès
2022-11-06 22:45 ` Ludovic Courtès
2022-11-07 10:43 ` Ludovic Courtès
2022-11-10 8:51 ` Ludovic Courtès
2022-11-11 10:55 ` Ludovic Courtès
2022-10-20 17:49 ` Joshua Branson via Bug reports for GNU Guix
2022-10-20 21:46 ` Ludovic Courtès
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87ilkb4n5l.fsf_-_@gnu.org \
--to=ludo@gnu.org \
--cc=58631@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).