GNU bug report logs - #70266
Failure to open LUKS devices from a Shepherd service

Previous Next

Package: guix;

Reported by: Ludovic Courtès <ludo <at> gnu.org>

Date: Sun, 7 Apr 2024 21:31:02 UTC

Severity: important

Merged with 70051

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 70266 in the body.
You can then email your comments to 70266 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-guix <at> gnu.org:
bug#70266; Package guix. (Sun, 07 Apr 2024 21:31:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Ludovic Courtès <ludo <at> gnu.org>:
New bug report received and forwarded. Copy sent to bug-guix <at> gnu.org. (Sun, 07 Apr 2024 21:31:03 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: bug-guix <at> gnu.org
Subject: Failure to open LUKS devices from a Shepherd service
Date: Sun, 07 Apr 2024 23:30:02 +0200
Hello,

Commit 6f9d844d2ece7b369d17bbe678978462425f869c led to a regression:
when a ‘luks-device-mapping’ mapped device is opened from a Shepherd
service (for instance a ‘device-mapping-XXX’ service created by
‘device-mapping-service-type’ because, say, /home is a separate LUKS
partition), said service fails to start with:

  Unbound variable: bytevector?

This is the ‘bytevector?’ referred to in ‘open-luks-device’.

As a result, the system just hangs at boot time because that
‘device-mapping-XXX’ service fails to start.

Ludo’.




Information forwarded to bug-guix <at> gnu.org:
bug#70266; Package guix. (Sun, 07 Apr 2024 21:55:01 GMT) Full text and rfc822 format available.

Message #8 received at 70266 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: 70266 <at> debbugs.gnu.org
Subject: Re: bug#70266: Failure to open LUKS devices from a Shepherd service
Date: Sun, 07 Apr 2024 23:54:30 +0200
Ludovic Courtès <ludo <at> gnu.org> skribis:

> Commit 6f9d844d2ece7b369d17bbe678978462425f869c led to a regression:
> when a ‘luks-device-mapping’ mapped device is opened from a Shepherd
> service (for instance a ‘device-mapping-XXX’ service created by
> ‘device-mapping-service-type’ because, say, /home is a separate LUKS
> partition), said service fails to start with:
>
>   Unbound variable: bytevector?
>
> This is the ‘bytevector?’ referred to in ‘open-luks-device’.

This is a situation with a non-top-level ‘use-modules’.

The problem can be illustrated like this:

--8<---------------cut here---------------start------------->8---
$ cat ~/src/guile-debugging/non-top-level-use-modules.scm
;; (define-module (xxxx))

(define (foo x)
  (use-modules (rnrs bytevectors))  ;bad!!
  (bytevector? x))

;; (pk '-> (foo (call-with-input-string "#vu8(1 2 3)" read)))

(pk 'foo foo)

$ guild compile -O1 ~/src/guile-debugging/non-top-level-use-modules.scm 
/home/ludo/src/guile-debugging/non-top-level-use-modules.scm:3:3: warning: possibly unbound variable `bytevector?'
wrote `/home/ludo/.cache/guile/ccache/3.0-LE-8-4.7/home/ludo/src/guile-debugging/non-top-level-use-modules.scm.go'
$ guile
GNU Guile 3.0.99-git
Copyright (C) 1995-2024 Free Software Foundation, Inc.

Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'.
This program is free software, and you are welcome to redistribute it
under certain conditions; type `,show c' for details.

Enter `,help' for help.
scheme@(guile-user)> ,m(sdf)
scheme@(sdf)> ,use(guile)
scheme@(sdf)> (load-compiled "/home/ludo/.cache/guile/ccache/3.0-LE-8-4.7/home/ludo/src/guile-debugging/non-top-level-use-modules.scm.go")

;;; (foo #<procedure foo (x)>)
$1 = #<procedure foo (x)>
scheme@(sdf)> ,m(guile-user)
scheme@(guile-user)> ($1 123)
;;; <stdin>:7:1: warning: possibly unbound variable `$1'
ice-9/boot-9.scm:1676:22: In procedure raise-exception:
Unbound variable: bytevector?

Entering a new prompt.  Type `,bt' for a backtrace or `,q' to contin
--8<---------------cut here---------------end--------------->8---

‘use-modules’, when used this way, loads the specified modules in
(current-module) at that point (at run time).  If you change what the
current module is, as I did above, then it breaks.

Ludo’.




Information forwarded to bug-guix <at> gnu.org:
bug#70266; Package guix. (Sun, 07 Apr 2024 22:20:02 GMT) Full text and rfc822 format available.

Message #11 received at 70266 <at> debbugs.gnu.org (full text, mbox):

From: aurtzy <aurtzy <at> gmail.com>
To: 70266 <at> debbugs.gnu.org
Cc: ludo <at> gnu.org
Subject: Re: Failure to open LUKS devices from a Shepherd service
Date: Sun, 7 Apr 2024 18:19:25 -0400
Hi Ludo',

This bug has also been reported here: https://issues.guix.gnu.org/70051

I sent a patch that a few others have confirmed fixes the issue: 
https://issues.guix.gnu.org/70051#5

Cheers,

aurtzy





Merged 70051 70266. Request was from Ludovic Courtès <ludo <at> gnu.org> to control <at> debbugs.gnu.org. (Sun, 07 Apr 2024 23:14:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-guix <at> gnu.org:
bug#70266; Package guix. (Sun, 07 Apr 2024 23:44:03 GMT) Full text and rfc822 format available.

Message #16 received at 70266 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: aurtzy <aurtzy <at> gmail.com>
Cc: 70266 <at> debbugs.gnu.org, 70051 <at> debbugs.gnu.org
Subject: Re: bug#70266: Failure to open LUKS devices from a Shepherd service
Date: Mon, 08 Apr 2024 01:43:35 +0200
Hi aurtzy,

aurtzy <aurtzy <at> gmail.com> skribis:

> This bug has also been reported here: https://issues.guix.gnu.org/70051
>
> I sent a patch that a few others have confirmed fixes the issue:
> https://issues.guix.gnu.org/70051#5

Oops, sorry for not noticing it earlier!  (That was a hard-to-debug one
so kudos for the work you and others put in it.)

I pushed these two commits to address the problem:

  49f82fca41 mapped-devices: luks: Specify modules needed at the top-level.
  6062339156 mapped-devices: <mapped-device-type> can specify modules to import.

It works well in my tests but please let me know if something’s amiss.

Thanks,
Ludo’.




Information forwarded to bug-guix <at> gnu.org:
bug#70266; Package guix. (Mon, 08 Apr 2024 01:06:02 GMT) Full text and rfc822 format available.

Message #19 received at 70266 <at> debbugs.gnu.org (full text, mbox):

From: aurtzy <aurtzy <at> gmail.com>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 70266 <at> debbugs.gnu.org, 70051 <at> debbugs.gnu.org
Subject: Re: bug#70266: Failure to open LUKS devices from a Shepherd service
Date: Sun, 7 Apr 2024 21:05:13 -0400
Hi Ludo',

On 4/7/24 19:43, Ludovic Courtès wrote:
> Oops, sorry for not noticing it earlier!  (That was a hard-to-debug one
> so kudos for the work you and others put in it.)
>
> I pushed these two commits to address the problem:
>
>    49f82fca41 mapped-devices: luks: Specify modules needed at the top-level.
>    6062339156 mapped-devices: <mapped-device-type> can specify modules to import.
>
> It works well in my tests but please let me know if something’s amiss.

Just pulled+reconfigured, and my machine boots just fine with the 
problem LUKS device being decrypted as expected again. Thanks!

Cheers,

aurtzy





Severity set to 'important' from 'normal' Request was from Ludovic Courtès <ludo <at> gnu.org> to control <at> debbugs.gnu.org. (Mon, 08 Apr 2024 12:20:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-guix <at> gnu.org:
bug#70266; Package guix. (Mon, 08 Apr 2024 12:20:03 GMT) Full text and rfc822 format available.

Message #24 received at 70266-done <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: aurtzy <aurtzy <at> gmail.com>
Cc: 70266-done <at> debbugs.gnu.org, 70051-done <at> debbugs.gnu.org
Subject: Re: bug#70266: Failure to open LUKS devices from a Shepherd service
Date: Mon, 08 Apr 2024 14:19:04 +0200
Hi,

aurtzy <aurtzy <at> gmail.com> skribis:

> On 4/7/24 19:43, Ludovic Courtès wrote:
>> Oops, sorry for not noticing it earlier!  (That was a hard-to-debug one
>> so kudos for the work you and others put in it.)
>>
>> I pushed these two commits to address the problem:
>>
>>    49f82fca41 mapped-devices: luks: Specify modules needed at the top-level.
>>    6062339156 mapped-devices: <mapped-device-type> can specify modules to import.
>>
>> It works well in my tests but please let me know if something’s amiss.
>
> Just pulled+reconfigured, and my machine boots just fine with the
> problem LUKS device being decrypted as expected again. Thanks!

Awesome, thanks for confirming, and apologies for introducing this
regression in the first place!

Ludo’.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 07 May 2024 11:24:09 GMT) Full text and rfc822 format available.

This bug report was last modified 8 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.