Subject: Re: bug#39727: statx error running 'guix gc' on CentOS 7

From: Paul Garlick <[email-masked]>
Date: Mon, 24 Feb 2020 12:52:42 +0000

Hi Ludo,

> This was during the “removing unused link” phase, right?
> 
Yes, that's it.

> The system is running CentOS 7:
> 
> $ cat /etc/centos-release
> CentOS Linux release 7.7.1908 (Core)
> 
> What does “uname -r” return?

3.10.0-1062.12.1.el7.x86_64

> Let me know how it goes!

I compiled a C program with the following code using gcc-toolchain
9.2.0:

#define _GNU_SOURCE
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <fcntl.h>

int main(void)
{
  struct statx st;
  if (statx(AT_FDCWD, "/",
            AT_SYMLINK_NOFOLLOW | AT_STATX_DONT_SYNC,
            /* AT_SYMLINK_NOFOLLOW, */
            STATX_SIZE | STATX_NLINK, &st) == -1)
    printf ("failed: %m\n");

  return 0;
}

Initially, with the AT_STATX_DONT_SYNC flag, the output is:

$ failed: Invalid argument

Then, without the  AT_STATX_DONT_SYNC flag, the program runs and there
is no output.

Best regards,

Paul.