You are not logged in.

#1 2025-11-09 06:48:16

saeedbadrelden2021
Member
Registered: 2024-11-09
Posts: 6

mkarchiso segmentation fault during mksquashfs stage

Hello,

I'm building a custom Arch Linux ISO using mkarchiso, but the process always fails during the mksquashfs stage.

Here’s the output I get:

Parallel mksquashfs: Using 4 processors
Creating 4.0 filesystem on /home/sma/Desktop/Helwan-Linux-Dev-Cinnamon/work/iso/arch/x86_64/airootfs.sfs, block size 1048576.
[=========/                                                     ]  61614/385709  15%
/usr/bin/mkarchiso: line 184: 33780 Segmentation fault (core dumped) mksquashfs "$@" "${image_path}" -noappend "${airootfs_image_tool_options[@]}" "${mksquashfs_options[@]}"


to troubleshoot, I modified the image tool options in my profiledef.sh to limit compression threads:

sudo pacman -Syu squashfs-tools archiso

airootfs_image_tool_options=('-comp' 'xz' '-Xbcj' 'x86' '-b' '1M' '-Xdict-size' '1M' '-processors' '1')

But the segmentation fault still happens at the same stage.

I already tried:

Cleaning work/ and out/ directories before each build

Updating archiso and squashfs-tools (sudo pacman -Syu)

Running with sufficient disk space (~30GB free)

My system:

Arch Linux x86_64

Kernel:     6.17.7.arch1-1
RAM: 8GB 
squashfs-tools version:     4.7.3-1
archiso version: 64-1 
Note: I reinstalled the system from scratch before trying this build.

Thanks in advance!

Last edited by saeedbadrelden2021 (2025-11-09 07:29:26)

Offline

#2 2025-11-09 12:33:52

cybertibi
Member
Registered: 2025-11-09
Posts: 7

Re: mkarchiso segmentation fault during mksquashfs stage

Hello!
I got the same error that caused the program to crash, but I also got an error before that:
  -> Running build hook: [memdisk]
  -> Running build hook: [archiso]
==> ERROR: file not found: '/usr/lib/initcpio/udev/11-dm-initramfs.rules'
/usr/lib/initcpio/functions: line 1068: /usr/lib/initcpio/udev/11-dm-initramfs.rules: No such file or directory
  -> Running build hook: [archiso_loop_mnt]
  -> Running build hook: [block]
==> WARNING: Possibly missing firmware for module: 'qed'
==> WARNING: Possibly missing firmware for module: 'qla2xxx'
==> WARNING: Possibly missing firmware for module: 'wd719x'
==> WARNING: Possibly missing firmware for module: 'aic94xx'
==> WARNING: Possibly missing firmware for module: 'qla1280'
==> WARNING: Possibly missing firmware for module: 'bfa'
==> WARNING: Possibly missing firmware for module: 'xhci_pci_renesas'
  -> Running build hook: [filesystems]
  -> Running build hook: [keyboard]
==> Generating module dependencies
==> Creating xz-compressed initcpio image: '/boot/initramfs-linux.img'
==> WARNING: errors were encountered during the build. The image may not be complete.
error: command failed to execute correctly

It seems to be related to the initcpio program:
ERROR: file not found: '/usr/lib/initcpio/udev/11-dm-initramfs.rules'
/usr/lib/initcpio/functions: line 1068: /usr/lib/initcpio/udev/11-dm-initramfs.rules: No such file or directory

I don't know what the solution might be, maybe an update will fix it.

Offline

#3 2025-11-09 12:47:51

dimich
Member
From: Kharkiv, Ukraine
Registered: 2009-11-03
Posts: 427

Re: mkarchiso segmentation fault during mksquashfs stage

Can you check whether compression libraries used by mksquashfs are up to date?

$ pacman -Q zlib lzo lz4 xz zstd gcc-libs

Can you check whether recent core dump stored in journal?

$ coredumpctl list -n 10 mksquashfs
$ coredumpctl info mksquashfs

Offline

#4 2025-11-09 13:11:13

cybertibi
Member
Registered: 2025-11-09
Posts: 7

Re: mkarchiso segmentation fault during mksquashfs stage

All programs are up to date.
coredumpctl info mksquashfs  last output:

           PID: 248740 (mksquashfs)
           UID: 0 (root)
           GID: 0 (root)
        Signal: 11 (SEGV)
     Timestamp: Sun 2025-11-09 13:19:16 CET (42min ago)
  Command Line: mksquashfs /home/tibi/archlive/archiso/work/x86_64/airootfs /home/tibi/archlive/archiso/work/iso/answeros/x86_64/airootfs.sfs -noappend -comp xz -Xbcj x86 -b 1M -Xdict-size 1M
    Executable: /usr/bin/mksquashfs
Control Group: /user.slice/user-1000.slice/session-2.scope
          Unit: session-2.scope
         Slice: user-1000.slice
       Session: 2
     Owner UID: 1000 (tibi)
       Boot ID: 11a2595b6015445da526332b9860a9fe
    Machine ID: 07ad17a6874348289fa13141e12be34a
      Hostname: arch
       Storage: none
       Message: Process 248740 (mksquashfs) of user 0 terminated abnormally without generating a coredump.

Offline

#5 2025-11-09 14:26:26

dimich
Member
From: Kharkiv, Ukraine
Registered: 2009-11-03
Posts: 427

Re: mkarchiso segmentation fault during mksquashfs stage

cybertibi wrote:

coredumpctl info mksquashfs  last output:
           PID: 248740 (mksquashfs)
           UID: 0 (root)
           GID: 0 (root)
        Signal: 11 (SEGV)
...
       Message: Process 248740 (mksquashfs) of user 0 terminated abnormally without generating a coredump.

Is the issue reproducible when you run just mksquashfs with the same parameters from command line as non-root user? If it is, let it dump core and run

$ coredumpctl debug mksquashfs

This should start gdb. In gdb prompt run "backtrace" and show output.

Last edited by dimich (2025-11-09 14:26:51)

Offline

#6 2025-11-09 15:30:25

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 70,137

Re: mkarchiso segmentation fault during mksquashfs stage

Message: Process 248740 (mksquashfs) of user 0 terminated abnormally without generating a coredump.

Did you disable coredumps?
If you don't want to enable them and can reproduce this interactively you could try to run "gdb mksquashfs"

@cybertibi

/usr/lib/initcpio/functions: line 1068: /usr/lib/initcpio/udev/11-dm-initramfs.rules: No such file or directory

https://gitlab.archlinux.org/archlinux/ … 0c473418f8

What looks for that?

Online

#7 2025-11-09 16:17:50

cybertibi
Member
Registered: 2025-11-09
Posts: 7

Re: mkarchiso segmentation fault during mksquashfs stage

After running archiso hook:

-> Running build hook: [archiso]
==> ERROR: file not found: '/usr/lib/initcpio/udev/11-dm-initramfs.rules'
/usr/lib/initcpio/functions: line 1068: /usr/lib/initcpio/udev/11-dm-initramfs.rules: No such file or directory

Offline

#8 2025-11-09 16:57:42

qinohe
Member
From: Netherlands
Registered: 2012-06-20
Posts: 1,526

Re: mkarchiso segmentation fault during mksquashfs stage

seth wrote:

What looks for that?

At least I think nothing should, this was merged 10 months ago

https://gitlab.archlinux.org/archlinux/ … quests/416

Offline

#9 2025-11-09 16:59:52

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 70,137

Re: mkarchiso segmentation fault during mksquashfs stage

pacman -Qikk mkinitcpio
cat /etc/mkinitcpio.conf

Online

#10 2025-11-10 05:52:35

plougher
Member
Registered: 2025-11-10
Posts: 1

Re: mkarchiso segmentation fault during mksquashfs stage

Sorry everyone, but there is a bug in the latest Mksquashfs 4.7.3 (released 5th Nov).   I have made a new 4.7.4 release and it should be picked up soon.

Offline

#11 2025-11-10 13:20:44

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 70,137

Online

#12 2025-11-11 08:52:11

cybertibi
Member
Registered: 2025-11-09
Posts: 7

Re: mkarchiso segmentation fault during mksquashfs stage

This error is still present:
-> Running build hook: [archiso]
==> ERROR: file not found: '/usr/lib/initcpio/udev/11-dm-initramfs.rules'
/usr/lib/initcpio/functions: line 1068: /usr/lib/initcpio/udev/11-dm-initramfs.rules: No such file or directory

The contents of this file: /usr/lib/initcpio/install/archiso

#!/usr/bin/env bash
#
# SPDX-License-Identifier: GPL-3.0-or-later

build() {
    add_module "cdrom"
    add_module "loop"
    add_module "dm-snapshot"
    add_module "overlay"

    add_runscript

    add_binary blockdev
    add_binary dmsetup
    add_binary losetup
    add_binary openssl
    add_binary lsblk

    if command -v pv >/dev/null 2>&1; then
        add_binary pv
    else
        warning 'pv not found; falling back to cp for copy to RAM'
    fi

    add_udev_rule 60-cdrom_id.rules
    add_udev_rule 10-dm.rules
    add_udev_rule 95-dm-notify.rules
    add_udev_rule /usr/lib/initcpio/udev/11-dm-initramfs.rules

    if [[ -v ARCHISO_GNUPG_FD ]]; then
        add_binary gpg
        add_dir '/gpg' 0700
        gpg --homedir "$BUILDROOT/gpg" --import <&"$ARCHISO_GNUPG_FD"
    fi
    if [[ -v ARCHISO_TLS_FD ]]; then
        cat <&"$ARCHISO_TLS_FD" | add_file - '/codesign.crt' 644
    fi
    if [[ -v ARCHISO_TLSCA_FD ]]; then
        cat <&"$ARCHISO_TLSCA_FD" | add_file - '/codesign_CA.crt' 644
    fi
}

This line, which causes an error, is still there:
add_udev_rule /usr/lib/initcpio/udev/11-dm-initramfs.rules

Offline

#13 2025-11-11 08:57:29

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 70,137

Re: mkarchiso segmentation fault during mksquashfs stage

Online

#14 2025-11-11 09:35:26

csmnn
Member
Registered: 2017-05-10
Posts: 22

Re: mkarchiso segmentation fault during mksquashfs stage

cybertibi wrote:

This line, which causes an error, is still there:
add_udev_rule /usr/lib/initcpio/udev/11-dm-initramfs.rules

That file is owned by the package mkinitcpio-archiso.

I created an issue for it: https://gitlab.archlinux.org/archlinux/ … /issues/20

Offline

#15 2025-11-12 06:50:23

saeedbadrelden2021
Member
Registered: 2024-11-09
Posts: 6

Re: mkarchiso segmentation fault during mksquashfs stage

plougher wrote:

Sorry everyone, but there is a bug in the latest Mksquashfs 4.7.3 (released 5th Nov).   I have made a new 4.7.4 release and it should be picked up soon.

Thanks a lot — you’re the only one who really cared about my issue.
I’ve already installed squashfs-tools 4.7.4-1 yesterday, but unfortunately I’m still getting this error:

Creating 4.0 filesystem on /home/sma/Desktop/Helwan-Linux-Dev-Cinnamon/work/iso/arch/x86_64/airootfs.sfs, block size 1048576.
[================================================|              ] 302599/385596  78%
FATAL ERROR: xz uncompress failed with error code 9

Offline

#16 2025-11-12 08:20:03

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 70,137

Re: mkarchiso segmentation fault during mksquashfs stage

That's a completely different error now - xz cannot decompress a file.

EBADF 9 Bad file descriptor

Run "mkarchiso -v" and in doubt trace mkarchiso (set -x) to see what command fails if the verbose mode isn't verbose enough.

Online

#17 Yesterday 08:32:47

cybertibi
Member
Registered: 2025-11-09
Posts: 7

Re: mkarchiso segmentation fault during mksquashfs stage

csmnn wrote:
cybertibi wrote:

This line, which causes an error, is still there:
add_udev_rule /usr/lib/initcpio/udev/11-dm-initramfs.rules

That file is owned by the package mkinitcpio-archiso.

I created an issue for it: https://gitlab.archlinux.org/archlinux/ … /issues/20

I replaced the old archiso file with the new fixed version, but the error persists:

  -> Running build hook: [memdisk]
  -> Running build hook: [archiso]
==> ERROR: file not found: '/usr/lib/initcpio/udev/11-dm-initramfs.rules'
/usr/lib/initcpio/functions: line 1068: /usr/lib/initcpio/udev/11-dm-initramfs.rules: No such file or directory
  -> Running build hook: [archiso_loop_mnt]
  -> Running build hook: [block]
==> WARNING: Possibly missing firmware for module: 'qed'
==> WARNING: Possibly missing firmware for module: 'qla2xxx'
==> WARNING: Possibly missing firmware for module: 'wd719x'
==> WARNING: Possibly missing firmware for module: 'aic94xx'
==> WARNING: Possibly missing firmware for module: 'qla1280'
==> WARNING: Possibly missing firmware for module: 'bfa'
==> WARNING: Possibly missing firmware for module: 'xhci_pci_renesas'
  -> Running build hook: [filesystems]
  -> Running build hook: [keyboard]
==> Generating module dependencies
==> Creating xz-compressed initcpio image: '/boot/initramfs-linux.img'
==> WARNING: errors were encountered during the build. The image may not be complete.
error: command failed to execute correctly

Offline

#18 Yesterday 08:42:24

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 70,137

Re: mkarchiso segmentation fault during mksquashfs stage

https://archlinux.org/packages/extra/an … o-archiso/ and not been updated since january?
What exactly did you do?

Online

#19 Yesterday 10:43:43

cybertibi
Member
Registered: 2025-11-09
Posts: 7

Re: mkarchiso segmentation fault during mksquashfs stage

seth wrote:

https://archlinux.org/packages/extra/an … o-archiso/ and not been updated since january?
What exactly did you do?

I deleted the contents of the old file /usr/lib/initcpio/install/archiso, and copied the contents of the new, corrected file into its place!
The error still appears when I run the mkarchiso command.

Update:
I realized that when mkarchiso runs, it uses the mkinitcpio-archiso package included in the packages.x86_64 file, so fixing the file contents in the local system was pointless!

Last edited by cybertibi (Yesterday 10:56:13)

Offline

#20 Yesterday 11:57:08

qinohe
Member
From: Netherlands
Registered: 2012-06-20
Posts: 1,526

Re: mkarchiso segmentation fault during mksquashfs stage

The gitlab repo is already updated
Install mkinitcpio-archiso-git from AUR to install 'mkinitcpio-archiso' without '11-dm-initramfs.rules'

Offline

#21 Yesterday 16:06:09

cybertibi
Member
Registered: 2025-11-09
Posts: 7

Re: mkarchiso segmentation fault during mksquashfs stage

qinohe wrote:

The gitlab repo is already updated
Install mkinitcpio-archiso-git from AUR to install 'mkinitcpio-archiso' without '11-dm-initramfs.rules'

Thanks for your help, everyone! It seems that installing the mkinitcpio-archiso-git package has fixed the other error as well!

Offline

#22 Today 22:05:09

cakeslice
Member
Registered: 2016-12-01
Posts: 1

Re: mkarchiso segmentation fault during mksquashfs stage

Hi All, I've just come across this thread while trying to follow Busybox based initramfs (built with mkinitcpio) .

When I regenerate the initramfs with

# mkinitcpio -p linux

I get the same error:

==> ERROR: file not found: '/usr/lib/initcpio/udev/11-dm-initramfs.rules'

The issue seems to be related to changing the "encrypt" hook to "encryptssh" - reverting that removes the error.

In my case installing mkinitcpio-archiso-git didn't seem to do anything. Is there something I'm missing?

Last edited by cakeslice (Today 22:05:43)

Offline

Board footer

Powered by FluxBB