* Re: bootstrap guile segfaults on powerpc 32-bit
2019-11-06 17:35 ` Ludovic Courtès
@ 2019-11-07 7:30 ` Efraim Flashner
2019-11-09 20:24 ` Efraim Flashner
0 siblings, 1 reply; 5+ messages in thread
From: Efraim Flashner @ 2019-11-07 7:30 UTC (permalink / raw)
To: Ludovic Courtès; +Cc: guix-devel
[-- Attachment #1.1: Type: text/plain, Size: 4031 bytes --]
On Wed, Nov 06, 2019 at 06:35:09PM +0100, Ludovic Courtès wrote:
> Hi!
>
> Efraim Flashner <efraim@flashner.co.il> skribis:
>
> > I'm trying again to see about porting Guix to 32-bit powerpc and I've
> > come across a problem with the static guile. static guile has bin/
> > share/ and lib/ outputs. Looking at (gnu packages bootstrap), the
> > make-guile-wrapper function around line 377 takes its own bin/guile to
> > wrap itself in the code from share and the precompiled go files in lib/.
> > Unfortunately on powerpc I'm getting the error:
> >
> > /gnu/store/krb9h94g81f4xgsjwfs58p8fiir5gmpq-build-bootstrap-guile.sh: line 8: 5 Segmentation fault GUILE_SYSTEM_PATH=$out/share/guile/2.2 GUILE_SYSTEM_COMPILED_PATH=$out/lib/guile/2.2/ccache $out
> > /bin/guile -c "(begin (use-modules (ice-9 match)) (match (command-line) ((_ out bash) (let ((bin-dir (string-append out \"/bin\")) (guile (string-append out \"/bin/guile\")) (guile-real (string-append out
> > \"/bin/.guile-real\")) (dollar (string (integer->char 36)))) (chmod bin-dir 493) (rename-file guile guile-real) (call-with-output-file guile (lambda (p) (format p \"#!~a\\nexport GUILE_SYSTEM_PATH=~a/sha
> > re/guile/2.2\\nexport GUILE_SYSTEM_COMPILED_PATH=~a/lib/guile/2.2/ccache\\nexec -a \\\"~a0\\\" ~a \\\"~a@\\\"\\n\" bash out out dollar guile-real dollar))) (chmod guile 365) (chmod bin-dir 365)))))" $out
> > /gnu/store/rbz12p3wl7dlrn5gyk6yp62ixmcir3vb-bash
> > /gnu/store/krb9h94g81f4xgsjwfs58p8fiir5gmpq-build-bootstrap-guile.sh: line 11: 6 Segmentation fault $out/bin/guile --version
> > builder for `/gnu/store/cr6anc23kmprmilvyhi721b5b4sacln5-guile-bootstrap-2.2.drv' failed with exit code 139
>
> Indeed, here’s what I see:
>
> --8<---------------cut here---------------start------------->8---
> $ ./pre-inst-env guix build guile-static-stripped --target=powerpc-linux-gnu
> 5.5 MB will be downloaded:
> /gnu/store/nsscff8a2yic1x4cgdqlzd5829asln4w-guile-static-stripped-2.2.6
> substituting /gnu/store/nsscff8a2yic1x4cgdqlzd5829asln4w-guile-static-stripped-2.2.6...
> downloading from https://ci.guix.gnu.org/nar/lzip/nsscff8a2yic1x4cgdqlzd5829asln4w-guile-static-stripped-2.2.6...
> guile-static-stripped-2.2.6 5.2MiB 2.2MiB/s 00:02 [##################] 100.0%
>
> /gnu/store/nsscff8a2yic1x4cgdqlzd5829asln4w-guile-static-stripped-2.2.6
> $ qemu-ppc /gnu/store/nsscff8a2yic1x4cgdqlzd5829asln4w-guile-static-stripped-2.2.6/bin/guile -q
> guile: warning: failed to install locale
> qemu: uncaught target signal 11 (Segmentation fault) - core dumped
> Adres-eraro
> $ git log |head -1
> commit 198a7ac02fe52acfed996cb66d3c79e2e8595747
> --8<---------------cut here---------------end--------------->8---
>
> I’d need a cross-gdb for powerpc-linux-gnu to actually get a backtrace,
> though.
>
> Are you able to get a backtrace on the actual PowerPC machine?
>
strace was easy to do, I have that attached. I haven't used gdb very
much. Here's the initial "I figured out how to make it do something":
(ins)efraim@g4:~/guile-static$ gdb -q ./bin/guile
Reading symbols from ./bin/guile...
(No debugging symbols found in ./bin/guile)
(ins)(gdb) run
Starting program: /home/efraim/guile-static/bin/guile
guile: warning: failed to install locale
Program received signal SIGSEGV, Segmentation fault.
0x10073d90 in ?? ()
I figured it was worth trying with other architectures, so I built
%guile-static-stripped for x86_64-linux:
./pre-inst-env guix build -e '(@@ (gnu packages make-bootstrap) %guile-static-stripped)'
but that one didn't have any problems. Now I'm building it for
i686-linux. After that I'll try again with the bootstrap-tarballs, but
i686-linux -> powerpc-linux and see if that changes anything.
> Thanks,
> Ludo’.
--
Efraim Flashner <efraim@flashner.co.il> אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted
[-- Attachment #1.2: guile-strace --]
[-- Type: text/plain, Size: 7271 bytes --]
execve("./bin/guile", ["./bin/guile", "-q"], 0xbfeb83ec /* 27 vars */) = 0
brk(NULL) = 0x1076b000
brk(0x1076bd48) = 0x1076bd48
uname({sysname="Linux", nodename="g4", ...}) = 0
set_tid_address(0x1076b068) = 2734
set_robust_list(0x1076b070, 12) = 0
rt_sigaction(SIGRTMIN, {sa_handler=0x100f50f8, sa_mask=[], sa_flags=SA_SIGINFO}, NULL, 8) = 0
rt_sigaction(SIGRT_1, {sa_handler=0x100f51dc, sa_mask=[], sa_flags=SA_RESTART|SA_SIGINFO}, NULL, 8) = 0
rt_sigprocmask(SIG_UNBLOCK, [RTMIN RT_1], NULL, 8) = 0
ugetrlimit(RLIMIT_STACK, {rlim_cur=8192*1024, rlim_max=RLIM_INFINITY}) = 0
readlink("/proc/self/exe", "/home/efraim/guile-static/bin/gu"..., 4096) = 35
brk(0x1078cd48) = 0x1078cd48
brk(0x1078d000) = 0x1078d000
openat(AT_FDCWD, "/run/current-system/locale/2.29/locale-archive", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/gnu/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-glibc-cross-powerpc-linux-gnu-2.29/share/locale/locale.alias", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/run/current-system/locale/2.29/en_US.UTF-8/LC_IDENTIFICATION", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/run/current-system/locale/2.29/en_US.utf8/LC_IDENTIFICATION", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/run/current-system/locale/2.29/en_US/LC_IDENTIFICATION", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/run/current-system/locale/2.29/en.UTF-8/LC_IDENTIFICATION", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/run/current-system/locale/2.29/en.utf8/LC_IDENTIFICATION", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/run/current-system/locale/2.29/en/LC_IDENTIFICATION", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
write(2, "guile: warning: failed to instal"..., 41) = 41
futex(0x1034dd54, FUTEX_WAKE_PRIVATE, 2147483647) = 0
openat(AT_FDCWD, "/proc/self/maps", O_RDONLY|O_CLOEXEC) = 3
ugetrlimit(RLIMIT_STACK, {rlim_cur=8192*1024, rlim_max=RLIM_INFINITY}) = 0
fstat64(3, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
read(3, "00100000-00103000 r-xp 00000000 "..., 1024) = 380
close(3) = 0
sched_getaffinity(2734, 32, [0]) = 4
brk(0x1079d000) = 0x1079d000
brk(0x107ad000) = 0x107ad000
brk(0x107bd000) = 0x107bd000
brk(0x107cd000) = 0x107cd000
brk(0x107dd000) = 0x107dd000
rt_sigaction(SIGPWR, {sa_handler=0x100e6590, sa_mask=~[INT QUIT ABRT TERM RTMIN RT_1], sa_flags=SA_RESTART|SA_SIGINFO}, NULL, 8) = 0
rt_sigaction(SIGXCPU, {sa_handler=0x100e6280, sa_mask=~[INT QUIT ABRT TERM RTMIN RT_1], sa_flags=SA_RESTART}, NULL, 8) = 0
rt_sigprocmask(SIG_UNBLOCK, [XCPU PWR], NULL, 8) = 0
openat(AT_FDCWD, "/proc/stat", O_RDONLY) = 3
read(3, "cpu 2783050 8294 428571 3066401"..., 4096) = 1344
close(3) = 0
swapcontext(0xbff823d8, 0) = 0
brk(0x1085d000) = 0x1085d000
pipe2([3, 4], O_CLOEXEC) = 0
futex(0x1034dca8, FUTEX_WAKE_PRIVATE, 2147483647) = 0
clock_gettime(CLOCK_PROCESS_CPUTIME_ID, {tv_sec=0, tv_nsec=10033856}) = 0
openat(AT_FDCWD, "/dev/urandom", O_RDONLY|O_LARGEFILE) = 5
fstat64(5, {st_mode=S_IFCHR|0666, st_rdev=makedev(0x1, 0x9), ...}) = 0
ioctl(5, TCGETS, 0xbff82848) = -1 EINVAL (Invalid argument)
read(5, "#ms\22\0\230\376\224Q\0011g\223\305}\201\5=\n\23\315Y\t\213\270\16]\217#\351\326Y"..., 4096) = 4096
close(5) = 0
brk(0x1086d000) = 0x1086d000
openat(AT_FDCWD, "/gnu/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-glibc-cross-powerpc-linux-gnu-2.29/lib/gconv/gconv-modules.cache", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/gnu/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-glibc-cross-powerpc-linux-gnu-2.29/lib/gconv/gconv-modules", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
futex(0x10360970, FUTEX_WAKE_PRIVATE, 2147483647) = 0
ioctl(0, TCGETS, {B38400 opost isig icanon echo ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7c3e000
fcntl64(0, F_GETFL) = 0x2 (flags O_RDWR)
_llseek(0, 0, 0xbff823b8, SEEK_CUR) = -1 ESPIPE (Illegal seek)
ioctl(1, TCGETS, {B38400 opost isig icanon echo ...}) = 0
fcntl64(1, F_GETFL) = 0x2 (flags O_RDWR)
_llseek(1, 0, 0xbff823b8, SEEK_CUR) = -1 ESPIPE (Illegal seek)
ioctl(2, TCGETS, {B38400 opost isig icanon echo ...}) = 0
fcntl64(2, F_GETFL) = 0x2 (flags O_RDWR)
_llseek(2, 0, 0xbff823b8, SEEK_CUR) = -1 ESPIPE (Illegal seek)
readlink("/proc/self/exe", "/home/efraim/guile-static/bin/gu"..., 256) = 35
lstat64("/home", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
lstat64("/home/efraim", {st_mode=S_IFDIR|0755, st_size=12288, ...}) = 0
lstat64("/home/efraim/guile-static", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
lstat64("/home/efraim/guile-static/bin", {st_mode=S_IFDIR|0555, st_size=4096, ...}) = 0
stat64("/home/efraim/guile-static/share/guile/2.2/ice-9/eval.scm", {st_mode=S_IFREG|0444, st_size=25718, ...}) = 0
stat64("/home/efraim/guile-static/lib/guile/2.2/ccache/ice-9/eval.go", {st_mode=S_IFREG|0444, st_size=87205, ...}) = 0
openat(AT_FDCWD, "/home/efraim/guile-static/lib/guile/2.2/ccache/ice-9/eval.go", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 5
_llseek(5, 0, [87205], SEEK_END) = 0
mmap2(NULL, 87205, PROT_READ, MAP_PRIVATE, 5, 0) = 0xb7c28000
close(5) = 0
mprotect(0xb7c38000, 1892, PROT_READ|PROT_WRITE) = 0
prlimit64(0, RLIMIT_STACK, NULL, {rlim_cur=8192*1024, rlim_max=RLIM64_INFINITY}) = 0
stat64("/home/efraim/guile-static/share/guile/2.2/init.scm", 0xbff829c8) = -1 ENOENT (No such file or directory)
stat64("/home/efraim/guile-static/share/guile/2.2/ice-9/boot-9.scm", {st_mode=S_IFREG|0444, st_size=147395, ...}) = 0
stat64("/home/efraim/guile-static/lib/guile/2.2/ccache/ice-9/boot-9.go", {st_mode=S_IFREG|0444, st_size=516405, ...}) = 0
openat(AT_FDCWD, "/home/efraim/guile-static/lib/guile/2.2/ccache/ice-9/boot-9.go", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 5
_llseek(5, 0, [516405], SEEK_END) = 0
mmap2(NULL, 516405, PROT_READ, MAP_PRIVATE, 5, 0) = 0xb7ba9000
close(5) = 0
mprotect(0xb7bf9000, 73376, PROT_READ|PROT_WRITE) = 0
stat64("/home/efraim/guile-static/share/guile/2.2/ice-9/psyntax-pp.scm", {st_mode=S_IFREG|0444, st_size=184880, ...}) = 0
stat64("/home/efraim/guile-static/lib/guile/2.2/ccache/ice-9/psyntax-pp.go", {st_mode=S_IFREG|0444, st_size=472565, ...}) = 0
openat(AT_FDCWD, "/home/efraim/guile-static/lib/guile/2.2/ccache/ice-9/psyntax-pp.go", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 5
_llseek(5, 0, [472565], SEEK_END) = 0
mmap2(NULL, 472565, PROT_READ, MAP_PRIVATE, 5, 0) = 0xb7b35000
close(5) = 0
mprotect(0xb7b85000, 34352, PROT_READ|PROT_WRITE) = 0
--- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0x31e8c378} ---
+++ killed by SIGSEGV +++
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread