Skip to content

Latx32 1.6.4 hangs on i386 apt-get --version #373

Open

Description

@luzeng87

Summary

Latx32 1.6.4 does not return when running the i386 apt-get --version command. The hang is reproducible both through the host i386 binfmt_misc registration and by invoking Latx32 explicitly. No network access is involved.

Environment

  • Host architecture: loongarch64
  • Kernel: 6.18.27, 16K page size
  • Latx32: lat-i386 1.6.4
  • Latx32 SHA-256: d18eb64f804359369fdc4406a7ea865561536e23db41843fe9cbd7b25e7e7e83
  • Latx32 Build ID: 62acc734612c72f911fad4dab9ed12816fd40a0d
  • Guest: dynamically linked i386 user space; OCI image ID sha256:586aff9495ac496e8fe0e09b2dcfc19b65be4b832cdcc0163617f75458e8c778

Reproduction

The complete cleanup-safe reproducer is:

https://github.com/luzeng87/loongrun/blob/main/tools/reproduce-latx32-apt-failure.sh

Run it with an i386 image containing Latx32, its native dependency closure, apt-get, and dpkg:

DOCKER_COMMAND="sudo docker" \
  ./tools/reproduce-latx32-apt-failure.sh <i386-image>

Equivalent failing commands are:

# Through binfmt_misc
docker run --rm --platform linux/386 --network none \
  <i386-image> /usr/bin/apt-get --version

# Explicit Latx32 entry
docker run --rm --platform linux/386 --network none \
  --entrypoint /opt/loongrun/native/lib64/ld-linux-loongarch-lp64d.so.1 \
  <i386-image> \
  --library-path /opt/loongrun/native/lib \
  /opt/loongrun/native/bin/latx-i386-1.6 \
  /usr/bin/apt-get --version

Both remain running until forcibly killed. The reproducer stops each container after 8 seconds and records exit code 124.

Controls

In the same image and invocation environment:

  • /bin/true: exits 0
  • /usr/bin/dpkg --version: exits 0
  • /usr/bin/gpgv --version: exits 0
  • dynamically linked i386 Python, X11 clients, PulseAudio clients, and dbus-send: run successfully

Observed summary:

reproduction_summary control=pass dpkg=pass binfmt_apt=timeout explicit_apt=timeout

An earlier apt-get update attempt also terminated with signal 11, but the network-free apt-get --version hang is the deterministic minimal case.

Expected result

apt-get --version should print version information and exit 0, as it does on a native i386 system.

Activity

  1. LaurenIsACoder commented on Aug 10, 2026

    @LaurenIsACoder
    Contributor

    I found a concrete bug in the same apt path on current master. The reproduced symptom was a SIGSEGV rather than a hang: lea edi,[0] returned a zero IR operand without actually clearing EDI, so apt later used a stale EDI value in the following TLS address calculation.

    I sent a fix in #387. With that change, i386 apt-get --version exits normally with both LATX_AOT=0 LATX_TU=0 and the default translation settings. I also checked the exact LEA case by temporarily reversing the fix: it fails before the change and passes after it.

    All runs invoked latx-i386 explicitly. The binfmt registration was not used or modified, and this apt command did not fork or exec another guest program during the test.

    I do not want to call the original report fixed yet because the reproduced symptom was not the same timeout. Please try #387 with the original reproducer so we can confirm whether both failures have the same root cause.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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