unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
* bug#70266: Failure to open LUKS devices from a Shepherd service
@ 2024-04-07 21:30 Ludovic Courtès
  2024-04-07 21:54 ` Ludovic Courtès
  2024-04-07 22:19 ` aurtzy
  0 siblings, 2 replies; 6+ messages in thread
From: Ludovic Courtès @ 2024-04-07 21:30 UTC (permalink / raw)
  To: 70266

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’.




^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#70266: Failure to open LUKS devices from a Shepherd service
  2024-04-07 21:30 bug#70266: Failure to open LUKS devices from a Shepherd service Ludovic Courtès
@ 2024-04-07 21:54 ` Ludovic Courtès
  2024-04-07 22:19 ` aurtzy
  1 sibling, 0 replies; 6+ messages in thread
From: Ludovic Courtès @ 2024-04-07 21:54 UTC (permalink / raw)
  To: 70266

Ludovic Courtès <ludo@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’.




^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#70266: Failure to open LUKS devices from a Shepherd service
  2024-04-07 21:30 bug#70266: Failure to open LUKS devices from a Shepherd service Ludovic Courtès
  2024-04-07 21:54 ` Ludovic Courtès
@ 2024-04-07 22:19 ` aurtzy
  2024-04-07 23:43   ` bug#70051: " Ludovic Courtès
  1 sibling, 1 reply; 6+ messages in thread
From: aurtzy @ 2024-04-07 22:19 UTC (permalink / raw)
  To: 70266; +Cc: ludo

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





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#70051: bug#70266: Failure to open LUKS devices from a Shepherd service
  2024-04-07 22:19 ` aurtzy
@ 2024-04-07 23:43   ` Ludovic Courtès
  2024-04-08  1:05     ` aurtzy
  0 siblings, 1 reply; 6+ messages in thread
From: Ludovic Courtès @ 2024-04-07 23:43 UTC (permalink / raw)
  To: aurtzy; +Cc: 70266, 70051

Hi aurtzy,

aurtzy <aurtzy@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’.




^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#70266: Failure to open LUKS devices from a Shepherd service
  2024-04-07 23:43   ` bug#70051: " Ludovic Courtès
@ 2024-04-08  1:05     ` aurtzy
  2024-04-08 12:19       ` bug#70051: " Ludovic Courtès
  0 siblings, 1 reply; 6+ messages in thread
From: aurtzy @ 2024-04-08  1:05 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 70266, 70051

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





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#70051: bug#70266: Failure to open LUKS devices from a Shepherd service
  2024-04-08  1:05     ` aurtzy
@ 2024-04-08 12:19       ` Ludovic Courtès
  0 siblings, 0 replies; 6+ messages in thread
From: Ludovic Courtès @ 2024-04-08 12:19 UTC (permalink / raw)
  To: aurtzy; +Cc: 70266-done, 70051-done

Hi,

aurtzy <aurtzy@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’.




^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-04-10 19:45 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-07 21:30 bug#70266: Failure to open LUKS devices from a Shepherd service Ludovic Courtès
2024-04-07 21:54 ` Ludovic Courtès
2024-04-07 22:19 ` aurtzy
2024-04-07 23:43   ` bug#70051: " Ludovic Courtès
2024-04-08  1:05     ` aurtzy
2024-04-08 12:19       ` bug#70051: " Ludovic Courtès

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).