LukeShortCloud / winesapOS

winesapOS - Game with Linux anywhere, no installation required!
GNU General Public License v3.0
871 stars 31 forks source link

[install] Pacman segfaults with a single server in the mirrorlist #802

Open LukeShortCloud opened 4 months ago

LukeShortCloud commented 4 months ago

Pacman will always report a segmentation fault when trying to download database files when the XferCommand is configured to use wget.

Installing arch...
+ pacstrap -i /winesapos base base-devel wget --noconfirm
==> Creating install root at /winesapos
==> Installing packages to /winesapos
:: Synchronizing package databases...
--2024-03-30 05:12:17--  http://repo.ialab.dsu.edu/archlinux/core/os/x86_64/core.db
Resolving repo.ialab.dsu.edu (repo.ialab.dsu.edu)... 138.247.115.248
Connecting to repo.ialab.dsu.edu (repo.ialab.dsu.edu)|138.247.115.248|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 131629 (129K) [application/octet-stream]
Saving to: ‘/winesapos/var/lib/pacman/sync/core.db.part’

     0K .......... .......... .......... .......... .......... 38%  539K 0s
    50K .......... .......... .......... .......... .......... 77% 1.05M 0s
   100K .......... .......... ........                        100% 62.9M=0.1s

2024-03-30 05:12:18 (921 KB/s) - ‘/winesapos/var/lib/pacman/sync/core.db.part’ saved [131629/131629]

error: segmentation fault
Please submit a full bug report with --debug if appropriate.
25h==> ERROR: Failed to install packages to new root
LukeShortCloud commented 4 months ago

It seems like the issue is with Pacman itself. There is a known bug that Pacman will result in a segfault when (1) there is only one server in a mirrorlist and (2) GPG key checking is enabled.

This was fixed 1 week ago. The latest release of Pacman is 6.1.0 from 3 weeks ago. We will have to wait for a new release of Pacman.

https://bbs.archlinux.org/viewtopic.php?id=293911 https://gitlab.archlinux.org/pacman/pacman/-/issues/108

LukeShortCloud commented 4 months ago

This issue only appears while using the new WINESAPOS_SINGLE_MIRROR=true environment variable.

LukeShortCloud commented 4 months ago

A bugfix Pacman 6.1.1 release with this fix is being planned.

https://gitlab.archlinux.org/pacman/pacman/-/milestones/2#tab-issues

LukeShortCloud commented 3 months ago

I can confirm that (1) not using a single mirror and (2) commenting out the sed commands to enable the XferCommand allows local builds to work again with pacman 6.1.0-3.

GuestSneezeOSDev commented 3 months ago

if pacman is not working we can use this command

pacman -Syu haveged
systemctl start haveged
systemctl enable haveged

rm -fr /etc/pacman.d/gnupg
pacman-key --init
pacman-key --populate archlinux
JerryWJackson commented 3 months ago

I can verify that adding a duplicate Server line immediately beneath the existing one for only the winesapos repo fixes this segfault and allows package installation and db sync to complete as expected.

So it is the same bug from upstream.

LukeShortCloud commented 2 months ago

@GuestSneezeOSDev Thanks for the suggestion! I gave it a try but the service checks to see if the Linux kernel version is 5.6 or older before starting. Newer Linux kernels appear to have patches that make the random entropy on-par with what haveged provides. As part of our builds, we already do the second part of importing the latest Arch Linux GPG keys.

@JerryWJackson Thanks for confirming! I'm holding out for Pacman 6.1.1 to be released instead of relying on the mentioned workaround of adding an extra Server = line. Hopefully that will be soon.

Oddly, our GitHub Actions pipelines used to fail with this issue on the Chaotic AUR repository but that is no longer the case. I only notice it on local builds. We use container builds (with cache removed) so everything is supposed to be reproducible but apparently it is not.

LukeShortCloud commented 2 months ago

It has now been 3 months since the last Pacman release. I looked at their release history for comparison. Usually a new release comes every 1 month. At most, it takes 4 months.

We're aiming to have another winesapOS stable release next month. If Pacman is still not updated by then, we'll apply the manual workaround of having duplicate Server = entries.

GuestSneezeOSDev commented 1 month ago

Have you tried building it manually? or you could rebuild the repo

LukeShortCloud commented 1 month ago

Great idea, yes, building our own version of Pacman (probably pacman-git from the AUR) would be our best option. I haven't done that yet. I was still hoping for this to be fixed upstream and I've been very busy lately. It has now been over 4 months since the last Pacman release.

LukeShortCloud commented 1 month ago

Pacman 7.0.0 finally came out last week with the fix for this issue. The developers decided to just skip a 6.1.1 bug fix release and jump straight to 7.0.0. However, Pacman 7.0.0 is not available in Arch Linux yet.

https://linuxiac.com/pacman-7-0-package-manager-released/ https://archlinux.org/packages/core/x86_64/pacman/

GuestSneezeOSDev commented 1 month ago

The Update should be in the AUR

LukeShortCloud commented 1 month ago

Yeah, it'll already be in pacman-git but it'd be wasted time and effort to switch to it and then go back to the stable pacman package later. I wouldn't want to keep using pacman-git as it is more unstable.

The winesapOS 4.1.0 has partially been blocked by this issue but we've also been waiting for explicit sync support for NVIDIA to work on Wayland. That should finally be in all of our packages, including kernel-fsync, sometime in the next month. Then I'll finally release 4.1.0.

Related: https://github.com/LukeShortCloud/winesapOS/issues/818

LukeShortCloud commented 3 weeks ago

Pacman 7.0.0 has a major bug where makepkg does not work. Arch Linux has not updated the Pacman package because of this. I'll go ahead with the workaround of using two servers in a mirrorlist as this is just ridiculous how long it is taking for Pacman to be fixed (almost 6 months now).