GNU bug report logs - #55638
time-machine: backtrace about maybe-remove-expired-cache-entries

Previous Next

Package: guix;

Reported by: zimoun <zimon.toutoune <at> gmail.com>

Date: Wed, 25 May 2022 17:14:01 UTC

Severity: normal

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 55638 in the body.
You can then email your comments to 55638 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 ludo <at> gnu.org, bug-guix <at> gnu.org:
bug#55638; Package guix. (Wed, 25 May 2022 17:14:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to zimoun <zimon.toutoune <at> gmail.com>:
New bug report received and forwarded. Copy sent to ludo <at> gnu.org, bug-guix <at> gnu.org. (Wed, 25 May 2022 17:14:01 GMT) Full text and rfc822 format available.

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

From: zimoun <zimon.toutoune <at> gmail.com>
To: bug-guix <at> gnu.org
Subject: time-machine: backtrace about maybe-remove-expired-cache-entries
Date: Wed, 25 May 2022 18:49:29 +0200
Hi,

From 8a87e29, I get:


--8<---------------cut here---------------start------------->8---
$ guix time-machine --commit=9d795fb -- help
Backtrace:
          14 (primitive-load "/home/sitour/.config/guix/current/bin/…")
In guix/ui.scm:
   2229:7 13 (run-guix . _)
  2192:10 12 (run-guix-command _ . _)
In ice-9/boot-9.scm:
  1752:10 11 (with-exception-handler _ _ #:unwind? _ # _)
  1747:15 10 (with-exception-handler #<procedure 7f1459d16b40 at ic…> …)
In guix/store.scm:
    671:3  9 (_)
In ice-9/boot-9.scm:
  1752:10  8 (with-exception-handler _ _ #:unwind? _ # _)
In guix/store.scm:
   658:37  7 (thunk)
In guix/status.scm:
    809:4  6 (call-with-status-report _ _)
In guix/store.scm:
   1320:8  5 (call-with-build-handler #<procedure 7f1459e534b0 at g…> …)
In guix/inferior.scm:
    885:2  4 (cached-channel-instance #<store-connection 256.99 7f1…> …)
In guix/cache.scm:
    39:10  3 (maybe-remove-expired-cache-entries "/home/sitour/.cac…" …)
In srfi/srfi-19.scm:
   287:16  2 (time-normalize! #<time type: time-monotonic nanosecond…>)
In ice-9/boot-9.scm:
  1685:16  1 (raise-exception _ #:continuable? _)
  1685:16  0 (raise-exception _ #:continuable? _)

ice-9/boot-9.scm:1685:16: In procedure raise-exception:
In procedure <: Wrong type argument in position 2: #<eof>
--8<---------------cut here---------------end--------------->8---

Then ~/.cache/guix/inferiors/last-expiry-cleanup is empty

--8<---------------cut here---------------start------------->8---
$ cat ~/.cache/guix/inferiors/last-expiry-cleanup 

--8<---------------cut here---------------end--------------->8---

probably erased by the previous time-machine call.  Well, it still fails
until I remove the file ~/.cache/guix/inferiors/last-expiry-cleanup.

It is hard to debug.  Any idea?


Cheers,
simon




Information forwarded to bug-guix <at> gnu.org:
bug#55638; Package guix. (Thu, 26 May 2022 15:06:01 GMT) Full text and rfc822 format available.

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

From: Ludovic Courtès <ludo <at> gnu.org>
To: zimoun <zimon.toutoune <at> gmail.com>
Cc: 55638 <at> debbugs.gnu.org
Subject: Re: bug#55638: time-machine: backtrace about
 maybe-remove-expired-cache-entries
Date: Thu, 26 May 2022 17:05:23 +0200
Hi,

zimoun <zimon.toutoune <at> gmail.com> skribis:

> In guix/cache.scm:
>     39:10  3 (maybe-remove-expired-cache-entries "/home/sitour/.cac…" …)
> In srfi/srfi-19.scm:
>    287:16  2 (time-normalize! #<time type: time-monotonic nanosecond…>)
> In ice-9/boot-9.scm:
>   1685:16  1 (raise-exception _ #:continuable? _)
>   1685:16  0 (raise-exception _ #:continuable? _)
>
> ice-9/boot-9.scm:1685:16: In procedure raise-exception:
> In procedure <: Wrong type argument in position 2: #<eof>
>
>
> Then ~/.cache/guix/inferiors/last-expiry-cleanup is empty
>
> $ cat ~/.cache/guix/inferiors/last-expiry-cleanup 

This file was empty when you ran the command instead of containing an
integer (could have been a file system corruption or something like
that).

Solution:

  rm ~/.cache/guix/inferiors/last-expiry-cleanup

HTH!

Ludo’.




Information forwarded to bug-guix <at> gnu.org:
bug#55638; Package guix. (Thu, 26 May 2022 15:13:02 GMT) Full text and rfc822 format available.

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

From: Maxime Devos <maximedevos <at> telenet.be>
To: Ludovic Courtès <ludo <at> gnu.org>, zimoun
 <zimon.toutoune <at> gmail.com>
Cc: 55638 <at> debbugs.gnu.org
Subject: Re: bug#55638: time-machine: backtrace about
 maybe-remove-expired-cache-entries
Date: Thu, 26 May 2022 17:12:18 +0200
[Message part 1 (text/plain, inline)]
Ludovic Courtès schreef op do 26-05-2022 om 17:05 [+0200]:
> This file was empty when you ran the command instead of containing an
> integer (could have been a file system corruption or something like
> that).
> 
> Solution:
> 
>   rm ~/.cache/guix/inferiors/last-expiry-cleanup

It's a work-around, but there's still an underlying problem: 
guix/cache.scm doesn't do 'fsync+rename', so the file is not created
atomically, so in case of an abrupt shutdown or C-c at the wrong time,
the file becomes corrupted without fault of the file system.

As such, WDYT of making last-expiry-date more robust, by treating
invalid contents as time=0 or something like that?

Greetings,
Maxime.
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#55638; Package guix. (Fri, 27 May 2022 08:32:02 GMT) Full text and rfc822 format available.

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

From: zimoun <zimon.toutoune <at> gmail.com>
To: Ludovic Courtès <ludo <at> gnu.org>, 
 Maxime Devos <maximedevos <at> telenet.be>
Cc: 55638 <at> debbugs.gnu.org
Subject: Re: bug#55638: time-machine: backtrace about
 maybe-remove-expired-cache-entries
Date: Fri, 27 May 2022 10:31:14 +0200
Hi,

On Thu, 26 May 2022 at 17:05, Ludovic Courtès <ludo <at> gnu.org> wrote:

> This file was empty when you ran the command instead of containing an
> integer (could have been a file system corruption or something like
> that).

No, I did nothing special and the file system is not corrupted. :-)

I am just using intensively "guix time-machine".


> Solution:
>
>   rm ~/.cache/guix/inferiors/last-expiry-cleanup

Yes, this is what I did because I know enough the internals.

As Maxime said, it should be robust.  Therefore, see the fix:

https://issues.guix.gnu.org/55673


Cheers,
simon




Information forwarded to bug-guix <at> gnu.org:
bug#55638; Package guix. (Sat, 28 May 2022 17:13:02 GMT) Full text and rfc822 format available.

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

From: Ludovic Courtès <ludo <at> gnu.org>
To: Maxime Devos <maximedevos <at> telenet.be>
Cc: 55638 <at> debbugs.gnu.org, zimoun <zimon.toutoune <at> gmail.com>
Subject: Re: bug#55638: time-machine: backtrace about
 maybe-remove-expired-cache-entries
Date: Sat, 28 May 2022 19:12:19 +0200
Hi,

Maxime Devos <maximedevos <at> telenet.be> skribis:

> It's a work-around, but there's still an underlying problem: 
> guix/cache.scm doesn't do 'fsync+rename', so the file is not created
> atomically, so in case of an abrupt shutdown or C-c at the wrong time,
> the file becomes corrupted without fault of the file system.

Right, I guess this is what we should fix first, by using
‘with-atomic-file-output’ for instance.

> As such, WDYT of making last-expiry-date more robust, by treating
> invalid contents as time=0 or something like that?

That too.

Ludo’.




Information forwarded to bug-guix <at> gnu.org:
bug#55638; Package guix. (Mon, 30 May 2022 13:13:02 GMT) Full text and rfc822 format available.

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

From: zimoun <zimon.toutoune <at> gmail.com>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: Maxime Devos <maximedevos <at> telenet.be>, 55638 <at> debbugs.gnu.org
Subject: Re: bug#55638: time-machine: backtrace about
 maybe-remove-expired-cache-entries
Date: Mon, 30 May 2022 15:11:59 +0200
Hi,

On Sat, 28 May 2022 at 19:12, Ludovic Courtès <ludo <at> gnu.org> wrote:

> Right, I guess this is what we should fix first, by using
> ‘with-atomic-file-output’ for instance.

Please give a look at the patch

https://issues.guix.gnu.org/55673#18

which fixes the issue.


Cheers,
simon




bug closed, send any further explanations to 55638 <at> debbugs.gnu.org and zimoun <zimon.toutoune <at> gmail.com> Request was from Ludovic Courtès <ludo <at> gnu.org> to control <at> debbugs.gnu.org. (Fri, 08 Jul 2022 11:46:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 06 Aug 2022 11:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 263 days ago.

Previous Next


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