On Mon, Dec 12, 2022 at 10:40:50PM -0500, Maxim Cournoyer wrote: > Hi Guix! > > I've been trying for some time to run Guix System on an ARM board (a > TS-7970 with an i.MX6 Cortex A9 CPU). I wanted to cross-compile the > image for speed and efficiency, and stumbled upon some problems on the > way, such as https://issues.guix.gnu.org/44924, fixed on core-updates. > > Then it took me some time to figure out that Guile 3.0.7 was segfaulting > when running the initrd's init script, which would cause the following > kernel panic and backtrace: > > --8<---------------cut here---------------start------------->8--- > [ 5.913371] ALSA device list: > [ 5.913374] #0: On-board Codec > [ 5.913376] #1: imx-hdmi-soc > [ 5.921483] sdhci-esdhc-imx 2190000.usdhc: card claims to support voltages below defined range > [ 5.938332] mmc0: new SDIO card at address 0001 > [ 5.987225] mmc2: new DDR MMC card at address 0001 > [ 5.998025] mmcblk2: mmc2:0001 MMC04G 3.60 GiB > [ 6.009623] mmcblk2boot0: mmc2:0001 MMC04G partition 1 16.0 MiB > [ 6.020181] mmcblk2boot1: mmc2:0001 MMC04G partition 2 16.0 MiB > [ 6.031772] mmcblk2rpmb: mmc2:0001 MMC04G partition 3 128 KiB > [ 6.957080] Freeing unused kernel memory: 1024K (80e00000 - 80f00000) > [ 6.967865] Kernel panic - not syncing: Attempted to kill init! exitcode=0x00008b00 > [ 6.967865] > [ 6.977015] CPU3: stopping > [ 6.979732] CPU: 3 PID: 0 Comm: swapper/3 Not tainted 4.9.11-tsimx #1 > [ 6.986174] Hardware name: Freescale i.MX6 Quad/DualLite (Device Tree) > [ 6.992704] Backtrace: > [ 6.995189] [<80111d48>] (dump_backtrace) from [<80111f38>] (show_stack+0x18/0x1c) > [ 7.002765] r7:00000000 r6:20000193 r5:00000000 r4:80f2fecc > [ 7.008437] [<80111f20>] (show_stack) from [<8054d61c>] (dump_stack+0x80/0x9c) > [ 7.015669] [<8054d59c>] (dump_stack) from [<8010d8dc>] (handle_IPI+0xe0/0x178) > [ 7.022981] r7:00000000 r6:d80b1f18 r5:00000003 r4:80e7f034 > [ 7.028648] [<8010d7fc>] (handle_IPI) from [<801014d8>] (gic_handle_irq+0x70/0x78) > [ 7.036222] r7:f4a01100 r6:80f0358c r5:f4a00100 r4:d80b1f18 > [ 7.041895] [<80101468>] (gic_handle_irq) from [<80a0a34c>] (__irq_svc+0x6c/0xa8) > [ 7.049380] Exception stack(0xd80b1f18 to 0xd80b1f60) > [ 7.054434] 1f00: 00000000 00000001 > [ 7.062617] 1f20: 59eaf000 dad2fec0 9fdcb41d 9f4ecbfd dad2f1a8 00000000 00000001 00000000 > [ 7.070800] 1f40: 00000001 d80b1f9c d80b1f68 d80b1f68 80826350 80826374 60000113 ffffffff > [ 7.078981] r7:d80b1f4c r6:ffffffff r5:60000113 r4:80826374 > [ 7.084651] [<80826284>] (cpuidle_enter_state) from [<80826488>] (cpuidle_enter+0x1c/0x20) > [ 7.092921] r10:d80b1fc0 r9:80e801a0 r8:80f030f4 r7:d80b0000 r6:00000003 r5:80f08cd4 > [ 7.100752] r4:dad2f1a8 > [ 7.103301] [<8082646c>] (cpuidle_enter) from [<80165ccc>] (call_cpuidle+0x3c/0x40) > [ 7.110966] [<80165c90>] (call_cpuidle) from [<80165f48>] (cpu_startup_entry+0x188/0x1a8) > [ 7.119149] [<80165dc0>] (cpu_startup_entry) from [<8010d5b8>] (secondary_start_kernel+0x134/0x164) > [ 7.128196] r7:80f8d320 r4:80f14490 > [ 7.131779] [<8010d484>] (secondary_start_kernel) from [<1010156c>] (0x1010156c) > [ 7.139178] r7:80f8d320 r6:10c03c7d r5:00000051 r4:6809806a > [ 7.144839] CPU1: stopping > [ 7.147554] CPU: 1 PID: 0 Comm: swapper/1 Not tainted 4.9.11-tsimx #1 > [ 7.153996] Hardware name: Freescale i.MX6 Quad/DualLite (Device Tree) > [ 7.160524] Backtrace: > [ 7.162999] [<80111d48>] (dump_backtrace) from [<80111f38>] (show_stack+0x18/0x1c) > [ 7.170573] r7:00000000 r6:20000193 r5:00000000 r4:80f2fecc > [ 7.176242] [<80111f20>] (show_stack) from [<8054d61c>] (dump_stack+0x80/0x9c) > [ 7.183471] [<8054d59c>] (dump_stack) from [<8010d8dc>] (handle_IPI+0xe0/0x178) > [ 7.190783] r7:00000000 r6:d80adf18 r5:00000001 r4:80e7f034 > [ 7.196449] [<8010d7fc>] (handle_IPI) from [<801014d8>] (gic_handle_irq+0x70/0x78) > [ 7.204022] r7:f4a01100 r6:80f0358c r5:f4a00100 r4:d80adf18 > [ 7.209689] [<80101468>] (gic_handle_irq) from [<80a0a34c>] (__irq_svc+0x6c/0xa8) > [ 7.217173] Exception stack(0xd80adf18 to 0xd80adf60) > [ 7.222227] df00: 00000000 00000001 > [ 7.230410] df20: 59e93000 dad13ec0 9fdcb2cf 9f4ecbfd dad131a8 00000000 00000001 00000000 > [ 7.238592] df40: 00000001 d80adf9c d80adf68 d80adf68 80826350 80826374 60000013 ffffffff > [ 7.246773] r7:d80adf4c r6:ffffffff r5:60000013 r4:80826374 > [ 7.252439] [<80826284>] (cpuidle_enter_state) from [<80826488>] (cpuidle_enter+0x1c/0x20) > [ 7.260709] r10:d80adfc0 r9:80e801a0 r8:80f030f4 r7:d80ac000 r6:00000001 r5:80f08cd4 > [ 7.268539] r4:dad131a8 > [ 7.271082] [<8082646c>] (cpuidle_enter) from [<80165ccc>] (call_cpuidle+0x3c/0x40) > [ 7.278746] [<80165c90>] (call_cpuidle) from [<80165f48>] (cpu_startup_entry+0x188/0x1a8) > [ 7.286931] [<80165dc0>] (cpu_startup_entry) from [<8010d5b8>] (secondary_start_kernel+0x134/0x164) > [ 7.295979] r7:80f8d320 r4:80f14490 > [ 7.299560] [<8010d484>] (secondary_start_kernel) from [<1010156c>] (0x1010156c) > [ 7.306959] r7:80f8d320 r6:10c03c7d r5:00000051 r4:6809806a > [ 7.312621] CPU2: stopping > [ 7.315337] CPU: 2 PID: 0 Comm: swapper/2 Not tainted 4.9.11-tsimx #1 > [ 7.321779] Hardware name: Freescale i.MX6 Quad/DualLite (Device Tree) > [ 7.328306] Backtrace: > [ 7.330780] [<80111d48>] (dump_backtrace) from [<80111f38>] (show_stack+0x18/0x1c) > [ 7.338355] r7:00000000 r6:20000193 r5:00000000 r4:80f2fecc > [ 7.344024] [<80111f20>] (show_stack) from [<8054d61c>] (dump_stack+0x80/0x9c) > [ 7.351254] [<8054d59c>] (dump_stack) from [<8010d8dc>] (handle_IPI+0xe0/0x178) > [ 7.358567] r7:00000000 r6:d80aff18 r5:00000002 r4:80e7f034 > [ 7.364232] [<8010d7fc>] (handle_IPI) from [<801014d8>] (gic_handle_irq+0x70/0x78) > [ 7.371806] r7:f4a01100 r6:80f0358c r5:f4a00100 r4:d80aff18 > [ 7.377472] [<80101468>] (gic_handle_irq) from [<80a0a34c>] (__irq_svc+0x6c/0xa8) > [ 7.384956] Exception stack(0xd80aff18 to 0xd80aff60) > [ 7.390010] ff00: 00000000 dad24bc0 > [ 7.398192] ff20: 00000001 d80ae000 9fdcb6b7 9fca06dd dad211a8 00000001 00000001 00000004 > [ 7.406375] ff40: 00000001 d80aff9c d80aff28 d80aff68 8018eb00 80826374 20000013 ffffffff > [ 7.414555] r7:d80aff4c r6:ffffffff r5:20000013 r4:80826374 > [ 7.420222] [<80826284>] (cpuidle_enter_state) from [<80826488>] (cpuidle_enter+0x1c/0x20) > [ 7.428493] r10:d80affc0 r9:80e801a0 r8:80f030f4 r7:d80ae000 r6:00000002 r5:80f08cd4 > [ 7.436323] r4:dad211a8 > [ 7.438866] [<8082646c>] (cpuidle_enter) from [<80165ccc>] (call_cpuidle+0x3c/0x40) > [ 7.446531] [<80165c90>] (call_cpuidle) from [<80165f48>] (cpu_startup_entry+0x188/0x1a8) > [ 7.454714] [<80165dc0>] (cpu_startup_entry) from [<8010d5b8>] (secondary_start_kernel+0x134/0x164) > [ 7.463761] r7:80f8d320 r4:80f14490 > [ 7.467342] [<8010d484>] (secondary_start_kernel) from [<1010156c>] (0x1010156c) > [ 7.474742] r7:80f8d320 r6:10c03c7d r5:00000051 r4:6809806a > [ 7.480414] ---[ end Kernel panic - not syncing: Attempted to kill init! exitcode=0x00008b00 > [ 7.480414] > --8<---------------cut here---------------end--------------->8--- > > I found that guile would segfault and return an exit code of 139 > (perhaps ETXTBSY, per guile sources), by adding bash-static to the > initrd and invoking guile from there during the early boot. > > Luckily, Guile 3.0.8 doesn't have this problem, so the following fixed > it: > > --8<---------------cut here---------------start------------->8--- > modified gnu/packages/make-bootstrap.scm > @@ -797,7 +797,7 @@ (define %guile-static-stripped > ;; A stripped static Guile 3.0 binary, for use in initrds > ;; and during bootstrap. > (make-guile-static-stripped > - (make-guile-static guile-3.0 > + (make-guile-static guile-3.0-latest > '("guile-2.2-default-utf8.patch" > "guile-3.0-linux-syscalls.patch" > "guile-3.0-relocatable.patch")))) > --8<---------------cut here---------------end--------------->8--- > > The initrd now runs, but it fails with the following error: > > --8<---------------cut here---------------start------------->8--- > [ 8.448448] ALSA device list: > [ 8.451472] #0: On-board Codec > [ 8.454768] #1: imx-hdmi-soc > [ 8.461095] Freeing unused kernel memory: 1024K (80e00000 - 80f00000) > GC Warning: pthread_getattr_np or pthread_attr_getstack failed for main thread > GC Warning: Couldn't read /proc/stat > [ 8.481168] mmc0: new SDIO card at address 0001 > Welcome, this is GNU's early boot Guile. > Use 'gnu.repl' for an initrd REPL. > > ice-9/boot-9.scm:1685:16: In procedure raise-exception: > Throw to key `record-abi-mismatch-error' with args `(abi-check "~a: record ABI mismatch; recompilation needed" (#>) ())'. > > Entering a new prompt. Type `,bt' for a backtrace or `,q' to continue. > GNU Guile 3.0.8 > Copyright (C) 1995-2021 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)> > --8<---------------cut here---------------end--------------->8--- > > The .go modules appear to be correctly cross-compiled for > arm-linux-gnueabihf (they run fine on the same target using a different > OS that I can boot with). > > Ideas? Perhaps you'll need to compile more with guile-3.0-latest. If it's not too much I suppose you could try moving guile-3.0-latest to guile-3.0. Otherwise I guess you'll need to find where is being compiled and replace that guile-3.0 with guile-3.0-latest too, and then see where the next failure is. -- Efraim Flashner אפרים פלשנר GPG key = A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 Confidentiality cannot be guaranteed on emails sent or received unencrypted