From unknown Fri Jun 13 11:03:17 2025 X-Loop: help-debbugs@gnu.org Subject: bug#35631: shepherd: dies on invalid code Resent-From: =?UTF-8?Q?G=C3=A1bor?= Boskovits Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Wed, 08 May 2019 11:50:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 35631 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: 35631@debbugs.gnu.org X-Debbugs-Original-To: bug-guix@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.155731619631099 (code B ref -1); Wed, 08 May 2019 11:50:02 +0000 Received: (at submit) by debbugs.gnu.org; 8 May 2019 11:49:56 +0000 Received: from localhost ([127.0.0.1]:60497 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hOL5A-00085X-BF for submit@debbugs.gnu.org; Wed, 08 May 2019 07:49:56 -0400 Received: from eggs.gnu.org ([209.51.188.92]:57296) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hOL59-00085J-1H for submit@debbugs.gnu.org; Wed, 08 May 2019 07:49:55 -0400 Received: from lists.gnu.org ([209.51.188.17]:55544) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hOL53-0006bZ-AC for submit@debbugs.gnu.org; Wed, 08 May 2019 07:49:49 -0400 Received: from eggs.gnu.org ([209.51.188.92]:43440) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hOL51-00067X-Sx for bug-guix@gnu.org; Wed, 08 May 2019 07:49:49 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM, HTML_MESSAGE,URIBL_BLOCKED autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hOL50-0006aT-J1 for bug-guix@gnu.org; Wed, 08 May 2019 07:49:47 -0400 Received: from mail-ed1-x530.google.com ([2a00:1450:4864:20::530]:36254) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hOL50-0006Zx-8Y for bug-guix@gnu.org; Wed, 08 May 2019 07:49:46 -0400 Received: by mail-ed1-x530.google.com with SMTP id a8so21808186edx.3 for ; Wed, 08 May 2019 04:49:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=fVo2/WMUnT1Bg1fIOyKJYBAP0QrJXwm5UO8zN20VX2s=; b=FxkuQu4IhrtMbOFBzmW7Bb+hY1XteyMIiTF4ZBwb0cqpat6PnK6ol7zmfaN0NYPOpo mTnwstJ74PMlMx8708FRsZsHoAnwfO9bo9pztUr0CHQxdvOAy1NmLyiy1aUbJ6YrutRi IWwjSvzUF2ZTtb9qQ5/MkLY9fRImBZAv7JNOrVCmJf4IZabIKn9EHrMqS403jyNsEE05 9WMRZSwkI4x80C8pECNCy0AhZI0Y9csnABqTtYh/6OHhn9wrh30JzGPkCZcNksfaoX3t PfQnf4mW20IAcywCoMPj/SkKZhQz0lp6H5bgbQ5Hpgh+5pgqf9lnA0b5+a1ZxAotayJG cbXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=fVo2/WMUnT1Bg1fIOyKJYBAP0QrJXwm5UO8zN20VX2s=; b=PHSq9sYyN2YOD8PBmcEx5Swu7jhxvOQL7mDiRwfwu7UsHff/AXsiid0TV2/9shkn1E yVLdTia5ib0KJip2ljOckEdxmgYGB+FAtz3e+GtY0vfW9tl5mwGSjrYd/qzck0awW1T4 McOmdjOH9DSp4AIJrskYg0epUOifI96iVTljXOduQD2KXovlMDLIouwmATcUBbvA4eFJ aKYqkydUv+XjvE6iDl9udYnnUiqf/i5IDurB1HWnMjrKt4rlsUyaDvHDZfkfspqcYdwG gF06hIfq8eMVC5t54NXlvKbo0KxVD+Ga409+3gRBwmfcp7P0StaBO0LvPxr2AFwqD600 IX4A== X-Gm-Message-State: APjAAAXAGi/F/i++ZyOoP6XV1tefoLqDgQl9VJSRzLmu55FrIiY+4EGc vAqtOVT3y8e2F3gl8wTAoFhEM7K+c4kf5nAB97SXCTM= X-Google-Smtp-Source: APXvYqz6wWzcAmlvzroOlTYMpgEFIQ0ldlInf7fRXsMO4aAbcCtCXumlhxk0lfm6SYFL9+gOUPfmabpUKmvopbvS0xU= X-Received: by 2002:a50:ac5d:: with SMTP id w29mr22444422edc.121.1557316184183; Wed, 08 May 2019 04:49:44 -0700 (PDT) MIME-Version: 1.0 From: =?UTF-8?Q?G=C3=A1bor?= Boskovits Date: Wed, 8 May 2019 13:49:32 +0200 Message-ID: Content-Type: multipart/alternative; boundary="000000000000f615e205885eed59" X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::530 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Spam-Score: -1.3 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) --000000000000f615e205885eed59 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Observed behaviour: Shepherd dies on loading invalid code. Expected behaviour: Send an error message to the log and back to the herd, that the given service could not be loaded. (Maybe a more detailed one, that helps in debugging). Continue operation without the offending service. Steps to reproduce: shepherd -s ~/shepherd.sock -c ok-service.scm & and then herd -s ~/shepherd.sock load root failing-service.scm results in the following backtrace: Backtrace: 15 (primitive-load "/root/.guix-profile/bin/shepherd") In shepherd.scm: 270:10 14 (main . _) 58:17 13 (call-with-server-socket "/root/shepherd.sock" _) 288:20 12 (_ #) In ice-9/boot-9.scm: 829:9 11 (catch system-error # =E2=80=A6) In shepherd.scm: 325:9 10 (_) In ice-9/boot-9.scm: 829:9 9 (catch quit # =E2=80=A6) In shepherd.scm: 378:11 8 (_) 380:50 7 (_ _ #) In shepherd/service.scm: 270:14 6 (condition->sexp #) In srfi/srfi-1.scm: 592:29 5 (map1 (#f "definition in expression context, where d=E2=80=A6"= =E2=80=A6)) 592:29 4 (map1 ("definition in expression context, where defi=E2=80=A6"= =E2=80=A6)) 592:17 3 (map1 (((line . 2) (column . 40) (filename . "fai=E2=80=A6")) = =E2=80=A6)) 592:17 2 (map1 ((line . 2) (column . 40) (filename . "failing=E2=80=A6"= ))) 589:5 1 (map #< result->sexp (8)> (line . 2)) In unknown file: 0 (scm-error wrong-type-arg "map" "Wrong type argument: =E2=80= =A6" =E2=80=A6) ERROR: In procedure scm-error: In procedure map: Wrong type argument: (line . 2) herd: premature end-of-file while talking to shepherd and shepherd dies: [1]+ Kil=C3=A9pett(1) shepherd -s ~/shepherd.sock -c ok-service= .scm at the end of ps ax output. The only relevant line in the logs is: May 8 13:35:46 localhost shepherd[365]: Loading failing-service.scm. This causes serious problems when shepherd is running as pid1. The content of the configuration files: ok-service.scm: (register-services (make #:provides '(ok-service) #:start ((const #t)))) failing-service.scm: (register-services (make #:provides '(failing-service) #:start ((const #t)(define x 1)))) --000000000000f615e205885eed59 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Obse= rved behaviour:
Shepherd dies on loading invalid code.
<= div>
Expected behaviour:
Send an error message to t= he log and=20 back to the herd, that the given service could not be loaded. (Maybe a=20 more detailed one, that helps in debugging).
Continue operation w= ithout the offending service.

Steps to repro= duce:
shepherd -s ~/shepherd.sock -c ok-service.scm &

and then

herd -s ~/shepherd.sock= load root failing-service.scm

results in the foll= owing backtrace:
Backtrace:
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0 15 (primitive-load "/root/.guix-profile/bin/shep= herd")
In shepherd.scm:
=C2=A0=C2=A0 270:10 14 (main . _)
=C2= =A0=C2=A0=C2=A0 58:17 13 (call-with-server-socket "/root/shepherd.sock= " _)
=C2=A0=C2=A0 288:20 12 (_ #<input-output: socket 15>)In ice-9/boot-9.scm:
=C2=A0=C2=A0=C2=A0 829:9 11 (catch system-error #&= lt;procedure 17fe9c0 at shepherd.sc=E2= =80=A6> =E2=80=A6)
In shepherd.scm:
=C2=A0=C2=A0=C2=A0 325:9 10 (_= )
In ice-9/boot-9.scm:
=C2=A0=C2=A0=C2=A0 829:9=C2=A0 9 (catch quit #= <procedure 191e100 at shepherd.scm:357:7 =E2=80=A6> =E2=80=A6)
In = shepherd.scm:
=C2=A0=C2=A0 378:11=C2=A0 8 (_)
=C2=A0=C2=A0 380:50=C2= =A0 7 (_ _ #<condition &action-runtime-error [service: #<<ser= =E2=80=A6>)
In shepherd/service.scm:
=C2=A0=C2=A0 270:14=C2=A0 6 (= condition->sexp #<condition &action-runtime-error [ser=E2=80=A6&g= t;)
In srfi/srfi-1.scm:
=C2=A0=C2=A0 592:29=C2=A0 5 (map1 (#f "d= efinition in expression context, where d=E2=80=A6" =E2=80=A6))
=C2= =A0=C2=A0 592:29=C2=A0 4 (map1 ("definition in expression context, whe= re defi=E2=80=A6" =E2=80=A6))
=C2=A0=C2=A0 592:17=C2=A0 3 (map1 (((= line . 2) (column . 40) (filename . "fai=E2=80=A6")) =E2=80=A6))<= br>=C2=A0=C2=A0 592:17=C2=A0 2 (map1 ((line . 2) (column . 40) (filename . = "failing=E2=80=A6")))
=C2=A0=C2=A0=C2=A0 589:5=C2=A0 1 (map #&= lt;<generic> result->sexp (8)> (line . 2))
In unknown file:<= br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 0 (scm-erro= r wrong-type-arg "map" "Wrong type argument: =E2=80=A6"= =E2=80=A6)

ERROR: In procedure scm-error:
In procedure map: Wron= g type argument: (line . 2)
herd: premature end-of-file while talking to= shepherd

and shepherd dies:
[1]+=C2= =A0 Kil=C3=A9pett(1)=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0 shepherd -s ~/shepherd.sock -c ok-service.scm
at= the end of ps ax output.

The only relevant line i= n the logs is:
May=C2=A0 8 13:35:46 localhost shepherd[365]: Load= ing failing-service.scm.

This causes serious probl= ems when shepherd is running as pid1.

The content = of the configuration files:
ok-service.scm:
(register-s= ervices (make <service>
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2= =A0=C2=A0=C2=A0=C2=A0 #:provides '(ok-service)
=C2=A0=C2=A0=C2=A0 = =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0 #:start ((const #t))))
failing-service.scm:
(register-services (make <service&g= t;
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0 #:prov= ides '(failing-service)
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0= =C2=A0=C2=A0=C2=A0 #:start ((const #t)(define x 1))))
--000000000000f615e205885eed59-- From unknown Fri Jun 13 11:03:17 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: =?UTF-8?Q?G=C3=A1bor?= Boskovits Subject: bug#35631: closed (Re: bug#35631: shepherd: dies on invalid code) Message-ID: References: <87ftppvx6q.fsf@gnu.org> X-Gnu-PR-Message: they-closed 35631 X-Gnu-PR-Package: guix Reply-To: 35631@debbugs.gnu.org Date: Wed, 08 May 2019 14:28:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1557325682-24487-1" This is a multi-part message in MIME format... ------------=_1557325682-24487-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #35631: shepherd: dies on invalid code which was filed against the guix package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 35631@debbugs.gnu.org. --=20 35631: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D35631 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1557325682-24487-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 35631-done) by debbugs.gnu.org; 8 May 2019 14:27:19 +0000 Received: from localhost ([127.0.0.1]:33701 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hONXT-0006Ln-BX for submit@debbugs.gnu.org; Wed, 08 May 2019 10:27:19 -0400 Received: from eggs.gnu.org ([209.51.188.92]:38460) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hONXR-0006Lb-LD for 35631-done@debbugs.gnu.org; Wed, 08 May 2019 10:27:17 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:52004) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hONXM-0001yI-Bd; Wed, 08 May 2019 10:27:12 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=37542 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1hONXL-0007ub-LL; Wed, 08 May 2019 10:27:12 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: =?utf-8?Q?G=C3=A1bor?= Boskovits Subject: Re: bug#35631: shepherd: dies on invalid code References: Date: Wed, 08 May 2019 16:27:09 +0200 In-Reply-To: (=?utf-8?Q?=22G=C3=A1bor?= Boskovits"'s message of "Wed, 8 May 2019 13:49:32 +0200") Message-ID: <87ftppvx6q.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 35631-done Cc: 35631-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hello! G=C3=A1bor Boskovits skribis: > In shepherd/service.scm: > 270:14 6 (condition->sexp #) > In srfi/srfi-1.scm: > 592:29 5 (map1 (#f "definition in expression context, where d=E2=80= =A6" =E2=80=A6)) > 592:29 4 (map1 ("definition in expression context, where defi=E2=80= =A6" =E2=80=A6)) > 592:17 3 (map1 (((line . 2) (column . 40) (filename . "fai=E2=80=A6")= ) =E2=80=A6)) > 592:17 2 (map1 ((line . 2) (column . 40) (filename . "failing=E2=80= =A6"))) > 589:5 1 (map #< result->sexp (8)> (line . 2)) > In unknown file: > 0 (scm-error wrong-type-arg "map" "Wrong type argument: =E2=80= =A6" =E2=80=A6) > > ERROR: In procedure scm-error: > In procedure map: Wrong type argument: (line . 2) > herd: premature end-of-file while talking to shepherd Thanks a lot for the reduced test case. Fixed in Shepherd commit 15c032da1cd294f8141607e0bf36e257f8b1d91a! Ludo=E2=80=99. ------------=_1557325682-24487-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 8 May 2019 11:49:56 +0000 Received: from localhost ([127.0.0.1]:60497 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hOL5A-00085X-BF for submit@debbugs.gnu.org; Wed, 08 May 2019 07:49:56 -0400 Received: from eggs.gnu.org ([209.51.188.92]:57296) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hOL59-00085J-1H for submit@debbugs.gnu.org; Wed, 08 May 2019 07:49:55 -0400 Received: from lists.gnu.org ([209.51.188.17]:55544) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hOL53-0006bZ-AC for submit@debbugs.gnu.org; Wed, 08 May 2019 07:49:49 -0400 Received: from eggs.gnu.org ([209.51.188.92]:43440) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hOL51-00067X-Sx for bug-guix@gnu.org; Wed, 08 May 2019 07:49:49 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM, HTML_MESSAGE,URIBL_BLOCKED autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hOL50-0006aT-J1 for bug-guix@gnu.org; Wed, 08 May 2019 07:49:47 -0400 Received: from mail-ed1-x530.google.com ([2a00:1450:4864:20::530]:36254) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hOL50-0006Zx-8Y for bug-guix@gnu.org; Wed, 08 May 2019 07:49:46 -0400 Received: by mail-ed1-x530.google.com with SMTP id a8so21808186edx.3 for ; Wed, 08 May 2019 04:49:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=fVo2/WMUnT1Bg1fIOyKJYBAP0QrJXwm5UO8zN20VX2s=; b=FxkuQu4IhrtMbOFBzmW7Bb+hY1XteyMIiTF4ZBwb0cqpat6PnK6ol7zmfaN0NYPOpo mTnwstJ74PMlMx8708FRsZsHoAnwfO9bo9pztUr0CHQxdvOAy1NmLyiy1aUbJ6YrutRi IWwjSvzUF2ZTtb9qQ5/MkLY9fRImBZAv7JNOrVCmJf4IZabIKn9EHrMqS403jyNsEE05 9WMRZSwkI4x80C8pECNCy0AhZI0Y9csnABqTtYh/6OHhn9wrh30JzGPkCZcNksfaoX3t PfQnf4mW20IAcywCoMPj/SkKZhQz0lp6H5bgbQ5Hpgh+5pgqf9lnA0b5+a1ZxAotayJG cbXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=fVo2/WMUnT1Bg1fIOyKJYBAP0QrJXwm5UO8zN20VX2s=; b=PHSq9sYyN2YOD8PBmcEx5Swu7jhxvOQL7mDiRwfwu7UsHff/AXsiid0TV2/9shkn1E yVLdTia5ib0KJip2ljOckEdxmgYGB+FAtz3e+GtY0vfW9tl5mwGSjrYd/qzck0awW1T4 McOmdjOH9DSp4AIJrskYg0epUOifI96iVTljXOduQD2KXovlMDLIouwmATcUBbvA4eFJ aKYqkydUv+XjvE6iDl9udYnnUiqf/i5IDurB1HWnMjrKt4rlsUyaDvHDZfkfspqcYdwG gF06hIfq8eMVC5t54NXlvKbo0KxVD+Ga409+3gRBwmfcp7P0StaBO0LvPxr2AFwqD600 IX4A== X-Gm-Message-State: APjAAAXAGi/F/i++ZyOoP6XV1tefoLqDgQl9VJSRzLmu55FrIiY+4EGc vAqtOVT3y8e2F3gl8wTAoFhEM7K+c4kf5nAB97SXCTM= X-Google-Smtp-Source: APXvYqz6wWzcAmlvzroOlTYMpgEFIQ0ldlInf7fRXsMO4aAbcCtCXumlhxk0lfm6SYFL9+gOUPfmabpUKmvopbvS0xU= X-Received: by 2002:a50:ac5d:: with SMTP id w29mr22444422edc.121.1557316184183; Wed, 08 May 2019 04:49:44 -0700 (PDT) MIME-Version: 1.0 From: =?UTF-8?Q?G=C3=A1bor_Boskovits?= Date: Wed, 8 May 2019 13:49:32 +0200 Message-ID: Subject: shepherd: dies on invalid code To: bug-guix@gnu.org Content-Type: multipart/alternative; boundary="000000000000f615e205885eed59" X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::530 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) --000000000000f615e205885eed59 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Observed behaviour: Shepherd dies on loading invalid code. Expected behaviour: Send an error message to the log and back to the herd, that the given service could not be loaded. (Maybe a more detailed one, that helps in debugging). Continue operation without the offending service. Steps to reproduce: shepherd -s ~/shepherd.sock -c ok-service.scm & and then herd -s ~/shepherd.sock load root failing-service.scm results in the following backtrace: Backtrace: 15 (primitive-load "/root/.guix-profile/bin/shepherd") In shepherd.scm: 270:10 14 (main . _) 58:17 13 (call-with-server-socket "/root/shepherd.sock" _) 288:20 12 (_ #) In ice-9/boot-9.scm: 829:9 11 (catch system-error # =E2=80=A6) In shepherd.scm: 325:9 10 (_) In ice-9/boot-9.scm: 829:9 9 (catch quit # =E2=80=A6) In shepherd.scm: 378:11 8 (_) 380:50 7 (_ _ #) In shepherd/service.scm: 270:14 6 (condition->sexp #) In srfi/srfi-1.scm: 592:29 5 (map1 (#f "definition in expression context, where d=E2=80=A6"= =E2=80=A6)) 592:29 4 (map1 ("definition in expression context, where defi=E2=80=A6"= =E2=80=A6)) 592:17 3 (map1 (((line . 2) (column . 40) (filename . "fai=E2=80=A6")) = =E2=80=A6)) 592:17 2 (map1 ((line . 2) (column . 40) (filename . "failing=E2=80=A6"= ))) 589:5 1 (map #< result->sexp (8)> (line . 2)) In unknown file: 0 (scm-error wrong-type-arg "map" "Wrong type argument: =E2=80= =A6" =E2=80=A6) ERROR: In procedure scm-error: In procedure map: Wrong type argument: (line . 2) herd: premature end-of-file while talking to shepherd and shepherd dies: [1]+ Kil=C3=A9pett(1) shepherd -s ~/shepherd.sock -c ok-service= .scm at the end of ps ax output. The only relevant line in the logs is: May 8 13:35:46 localhost shepherd[365]: Loading failing-service.scm. This causes serious problems when shepherd is running as pid1. The content of the configuration files: ok-service.scm: (register-services (make #:provides '(ok-service) #:start ((const #t)))) failing-service.scm: (register-services (make #:provides '(failing-service) #:start ((const #t)(define x 1)))) --000000000000f615e205885eed59 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Obse= rved behaviour:
Shepherd dies on loading invalid code.
<= div>
Expected behaviour:
Send an error message to t= he log and=20 back to the herd, that the given service could not be loaded. (Maybe a=20 more detailed one, that helps in debugging).
Continue operation w= ithout the offending service.

Steps to repro= duce:
shepherd -s ~/shepherd.sock -c ok-service.scm &

and then

herd -s ~/shepherd.sock= load root failing-service.scm

results in the foll= owing backtrace:
Backtrace:
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0 15 (primitive-load "/root/.guix-profile/bin/shep= herd")
In shepherd.scm:
=C2=A0=C2=A0 270:10 14 (main . _)
=C2= =A0=C2=A0=C2=A0 58:17 13 (call-with-server-socket "/root/shepherd.sock= " _)
=C2=A0=C2=A0 288:20 12 (_ #<input-output: socket 15>)In ice-9/boot-9.scm:
=C2=A0=C2=A0=C2=A0 829:9 11 (catch system-error #&= lt;procedure 17fe9c0 at shepherd.sc=E2= =80=A6> =E2=80=A6)
In shepherd.scm:
=C2=A0=C2=A0=C2=A0 325:9 10 (_= )
In ice-9/boot-9.scm:
=C2=A0=C2=A0=C2=A0 829:9=C2=A0 9 (catch quit #= <procedure 191e100 at shepherd.scm:357:7 =E2=80=A6> =E2=80=A6)
In = shepherd.scm:
=C2=A0=C2=A0 378:11=C2=A0 8 (_)
=C2=A0=C2=A0 380:50=C2= =A0 7 (_ _ #<condition &action-runtime-error [service: #<<ser= =E2=80=A6>)
In shepherd/service.scm:
=C2=A0=C2=A0 270:14=C2=A0 6 (= condition->sexp #<condition &action-runtime-error [ser=E2=80=A6&g= t;)
In srfi/srfi-1.scm:
=C2=A0=C2=A0 592:29=C2=A0 5 (map1 (#f "d= efinition in expression context, where d=E2=80=A6" =E2=80=A6))
=C2= =A0=C2=A0 592:29=C2=A0 4 (map1 ("definition in expression context, whe= re defi=E2=80=A6" =E2=80=A6))
=C2=A0=C2=A0 592:17=C2=A0 3 (map1 (((= line . 2) (column . 40) (filename . "fai=E2=80=A6")) =E2=80=A6))<= br>=C2=A0=C2=A0 592:17=C2=A0 2 (map1 ((line . 2) (column . 40) (filename . = "failing=E2=80=A6")))
=C2=A0=C2=A0=C2=A0 589:5=C2=A0 1 (map #&= lt;<generic> result->sexp (8)> (line . 2))
In unknown file:<= br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 0 (scm-erro= r wrong-type-arg "map" "Wrong type argument: =E2=80=A6"= =E2=80=A6)

ERROR: In procedure scm-error:
In procedure map: Wron= g type argument: (line . 2)
herd: premature end-of-file while talking to= shepherd

and shepherd dies:
[1]+=C2= =A0 Kil=C3=A9pett(1)=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0 shepherd -s ~/shepherd.sock -c ok-service.scm
at= the end of ps ax output.

The only relevant line i= n the logs is:
May=C2=A0 8 13:35:46 localhost shepherd[365]: Load= ing failing-service.scm.

This causes serious probl= ems when shepherd is running as pid1.

The content = of the configuration files:
ok-service.scm:
(register-s= ervices (make <service>
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2= =A0=C2=A0=C2=A0=C2=A0 #:provides '(ok-service)
=C2=A0=C2=A0=C2=A0 = =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0 #:start ((const #t))))
failing-service.scm:
(register-services (make <service&g= t;
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0 #:prov= ides '(failing-service)
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0= =C2=A0=C2=A0=C2=A0 #:start ((const #t)(define x 1))))
--000000000000f615e205885eed59-- ------------=_1557325682-24487-1--