unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
* bug#41264: Bootstrap packages fail to build.
@ 2020-05-14 15:17 Mathieu Othacehe
  2020-05-15 12:11 ` Mathieu Othacehe
  0 siblings, 1 reply; 6+ messages in thread
From: Mathieu Othacehe @ 2020-05-14 15:17 UTC (permalink / raw)
  To: 41264

[-- Attachment #1: Type: text/plain, Size: 2424 bytes --]


Hello,

This command fails on one of my systems:

--8<---------------cut here---------------start------------->8---
guix build  -e "(@@ (gnu packages commencement) glibc-mesboot0)"
--8<---------------cut here---------------end--------------->8---

with the following error:

--8<---------------cut here---------------start------------->8---
phase `unpack' succeeded after 11.8 seconds
starting phase `apply-boot-patch'
patch: **** fstatsterror: unknown error:  
command "patch" "--force" "-p1" "-i" "/gnu/store/pfz4y5i7krlvam2m8lpddmg9vi44rpqh-glibc-boot-2.2.5.patch" failed with status 2
note: keeping build directory `/tmp/guix-build-glibc-mesboot0-2.2.5.drv-1'
builder for `/gnu/store/jcqggqckhiq43y2ivlfhpkbfbp2vyjlc-glibc-mesboot0-2.2.5.drv' failed with exit code 1
build of /gnu/store/jcqggqckhiq43y2ivlfhpkbfbp2vyjlc-glibc-mesboot0-2.2.5.drv failed
View build log at '/var/log/guix/drvs/jc/qggqckhiq43y2ivlfhpkbfbp2vyjlc-glibc-mesboot0-2.2.5.drv.bz2'.
guix build: error: build of `/gnu/store/jcqggqckhiq43y2ivlfhpkbfbp2vyjlc-glibc-mesboot0-2.2.5.drv' failed
--8<---------------cut here---------------end--------------->8---

Here's a stracing of the failing "patch" command:

--8<---------------cut here---------------start------------->8---
open("/gnu/store/pfz4y5i7krlvam2m8lpddmg9vi44rpqh-glibc-boot-2.2.5.patch", O_RDONLY) = 3
brk(0x9377913)                          = 0x9377913
fstat(3, 0xffb29328)                    = -1 EOVERFLOW (Value too large for defined data type)
--8<---------------cut here---------------end--------------->8---

"patch-mesboot" is built for 32 bits. Hence, it can be using
"__ia32_sys_fstat", "__ia32_compat_sys_newfstat" or
"__ia32_compat_sys_x86_fstat64" syscall for "fstat". Here, according to
perf, it's using __ia32_compat_sys_newfstat which is overflowing on my
file system (inode count to high or so).

There's a little demonstration program attached. When built with `gcc
-m32 test.c', I have:

--8<---------------cut here---------------start------------->8---
fstat(3, 0xffad5874)                    = -1 EOVERFLOW (Value too large for defined data type)
fstat64(3, {st_mode=S_IFDIR|0555, st_size=4096, ...}) = 0
fstat64(3, {st_mode=S_IFDIR|0555, st_size=4096, ...}) = 0
--8<---------------cut here---------------end--------------->8---

So I think somehow, bootstrap packages use the legacy "fstat" syscall,
which may overflow on a 64 bits system.

WDYT,

Thanks,

Mathieu

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: t.c --]
[-- Type: text/x-csrc, Size: 543 bytes --]

#define _GNU_SOURCE
#include <unistd.h>
#include <sys/syscall.h>

#include <sys/types.h>
#include <sys/stat.h>
#include <time.h>
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <sys/sysmacros.h>

int
main(int argc, char *argv[])
{
    struct stat sb;

    if (argc != 2) {
        fprintf(stderr, "Usage: %s <pathname>\n", argv[0]);
        exit(EXIT_FAILURE);
    }

    int fd = open(argv[1], O_RDONLY);
    syscall(__NR_fstat, fd, &sb);
    syscall(__NR_fstat64, fd, &sb);
    fstat(fd, &sb);


    exit(EXIT_SUCCESS);
}

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

end of thread, other threads:[~2023-02-15  8:46 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-14 15:17 bug#41264: Bootstrap packages fail to build Mathieu Othacehe
2020-05-15 12:11 ` Mathieu Othacehe
2020-05-19  8:52   ` Mathieu Othacehe
2020-05-19 16:52     ` Jan Nieuwenhuizen
2023-02-13 11:28       ` bug#49985: Bootstrap packages fail to build due to mes-libc lacking 'stat64' etc. syscalls Jan Nieuwenhuizen
2023-02-15  8:45         ` bug#41264: " Janneke Nieuwenhuizen

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