Skip to content

Intermittent Freezes During do_dpkg_build on Debian Trixie Host with Distro Set to Debian Bookworm and below #113

@baprusty

Description

@baprusty

The build intermittently freezes during the do_dpkg_build task when building an image on a Debian Trixie host targeting the Debian Bookworm, Debian Bullseye and Debian Buster distro, using kas-container to trigger the build.

Steps to reproduce:

  1. Launch the kas-container menu and configure the build as follows:
Machine selection		-> qemuamd64
Distro Selection		-> Debian 12 (bookworm)
Image type Selection 	-> Base image

Keep all other settings at their default values.
2. Select Build.

Result:

Build starts to intermittently freeze starting from this point:

bp@ipc847e:~/isar$ (next)tail -f testbuild/tmp/work/debian-bookworm-amd64/samefile/2.14-r0/temp/log.do_dpkg_build
-----------------

Command: dpkg-buildpackage --sanitize-env -us -uc -b -rfakeroot
dpkg-buildpackage: info: source package samefile
dpkg-buildpackage: info: source version 2.14
dpkg-buildpackage: info: source distribution UNRELEASED
dpkg-buildpackage: info: source changed by Unknown maintainer <unknown@example.com>
 dpkg-source --before-build .
dpkg-buildpackage: info: host architecture amd64
 fakeroot debian/rules clean

Time taken by complete build:

bp@ipc847e:~/isar$ (next)./kas/kas-container --ssh-dir ~/.ssh/ shell
2025-09-02 05:49:34 - INFO     - kas 4.8.1 started
2025-09-02 05:49:34 - INFO     - Using /repo as root for repository isar
2025-09-02 05:49:34 - INFO     - To start the default build, run: bitbake -c build isar-image-base
builder@d60bde9645c4:/work/build$ time bitbake isar-image-base
Loading cache: 100% |                                                                                                                                                                            | ETA:  --:--:--
Loaded 0 entries from dependency cache.
Parsing recipes: 100% |###########################################################################################################################################################################| Time: 0:00:00
Parsing of 73 .bb files complete (0 cached, 73 parsed). 77 targets, 18 skipped, 0 masked, 0 errors.
NOTE: Resolving any missing task queue dependencies
Sstate summary: Wanted 21 Local 0 Mirrors 0 Missed 21 Current 0 (0% match, 0% complete)#########################################################################################                  | ETA:  0:00:00
Initialising tasks: 100% |########################################################################################################################################################################| Time: 0:00:00
NOTE: Executing Tasks
WARNING: prebuilt-podman-img-0.1-r0 do_fetch: Missing checksum for 'docker://quay.io/libpod/alpine;tag=latest', consider using this SRC_URI in the recipe:
SRC_URI = "docker://quay.io/libpod/alpine;tag=latest;digest=sha256:fa93b01658e3a5a1686dc3ae55f170d8de487006fb53a28efcd12ab0710a2e5f"
WARNING: isar-image-base-1.0-r0 do_rootfs_postprocess: You are using external layers that will not be considered in the build_id. Consider changing ISAR_RELEASE_CMD.
NOTE: Tasks Summary: Attempted 224 tasks of which 0 didn't need to be rerun and all succeeded.

Summary: There were 2 WARNING messages.

real    52m40.111s
user    0m2.527s
sys     0m0.519s

Examples of intermittently frozen tasks:

Currently 12 running tasks (194 of 224)  86% |###########################################################################################################################################                       |
0: libhello-0.3-f4a5669-r0 do_dpkg_build - 6m48s (pid 17856)
1: enable-fsck-0.2-r0 do_dpkg_build - 6m48s (pid 18248)
2: sshd-regen-keys-0.5-r0 do_dpkg_build - 6m48s (pid 18254)
3: example-module-amd64-1.0-r0 do_dpkg_build - 6m48s (pid 18251)
...
...

Note: The build only takes 4 minutes to complete if the DISTRO is set to debian-trixie in this case and doesn't freeze.

Findings:

  • It freezes only when the dpkg-buildpackage is triggered with elevated privileges, using fakeroot.

  • Found a similar bug reported in Debian, fakeroot (<= v1.34-1) hangs: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1072521

  • Online sources suggests fakeroot 1.31 has hanging issues under certain kernel/userspace combinations (as container image is kas-isar bookworm based which still use host kernel i.e., 6.12.x).
    From the Bug report, the hang issue got fixed in fakeroot v1.35 (but, Bookworm still use v1.31). This is due to introduction of close_range system call to handle resource cleanup more robustly, addressing hang issues.

  • When the freeze happens, the CPU usage jumps to 100% and stays there as mentioned in the bug. Screenshot:

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions