Skip to content

[Bug]: processes such as ctest freezing in container when using more than 1 CPU core #293

Closed

Description

@jgehw

I have done the following

  • I have searched the existing issues
  • If possible, I've reproduced the issue using the 'main' branch of this project

Steps to reproduce

  • hardware: MacBook Pro M2 Max (don't know if this is a requirement; I don't have any other hardware to test with)
  • container v0.2.0 installed via homebrew (it's not a new bug, it was also already present on v0.1.0)
  • container image pull gcc:15.1.0-bookworm (it's not specific to this container; lots of other containers do the job as well; this one is just the simplest to reproduce with)
  • place cmake-3.31.8-linux-x86_64.sh and jansson-2.14.tar.gz in /Users/.../some_dir
  • container run -c 2 -m 16G --rm -it --entrypoint /bin/bash --arch amd64 -v /Users/.../some_dir:/my gcc
  • in the container:
cd /my
sh cmake-3.31.8-linux-x86_64.sh
pushd /usr/bin
ln -s /my/cmake-3.31.8-linux-x86_64/bin/cmake
ln -s /my/cmake-3.31.8-linux-x86_64/bin/ctest
popd
tar xfz jansson-2.14.tar.gz
cd jansson-2.14
cmake .
make
make check

Current behavior

Subprocess ctest of make check freezes during the tests. If you're unlucky, already process cmake freezes two steps earlier. Seems quite random at which stage exactly it freezes.

Possibly helpful observations:

  • If you use a container that has strace installed, and via a second shell container exec -it <hash of the container> /bin/bash attach to the frozen process via strace -p <its pid>, the frozen process continues to run as expected (all tests passed, exit code 0). Thus, it seems that an EINTR unblocks the frozen process again.
  • The bug does not occur when running the container with just 1 CPU core.

Expected behavior

Must not freeze also when the container is run with many (e.g. 12) CPU cores.

Environment

- OS: macOS 15.5
- Xcode: 16.4
- Container: 0.2.0

Relevant log output

Code of Conduct

  • I agree to follow this project's Code of Conduct

Activity

  1. added theissue type on Jul 3, 2025
  2. yerseg commented on Jul 15, 2025

    @yerseg

    Having same issue with my ubuntu-based dev container. My CMake build hangs always at some time but goes under strace.

  3. self-assigned this
    on Aug 7, 2025
  4. jglogan commented on Aug 15, 2025

    @jglogan
    Contributor

    validated against GitHub artifacts:

    https://github.com/akheron/jansson/releases/tag/v2.14

    % openssl sha256 cmake-3.31.8-linux-x86_64.sh 
    SHA256(cmake-3.31.8-linux-x86_64.sh)= 6b1cf99c8cfe5f9c256dc9be5f20a44d07af6149d98c8ca6bb2534c440ce0681

    https://github.com/Kitware/CMake/releases/tag/v3.31.8

    % openssl sha256 ~/Downloads/jansson-2.14.tar.gz 
    SHA256(/Users/john/Downloads/jansson-2.14.tar.gz)= 5798d010e41cf8d76b66236cfb2f2543c8d082181d16bc3085ab49538d4b9929
  5. jglogan commented on Aug 15, 2025

    @jglogan
    Contributor

    created for convenience:

    run.sh

    #! /bin/bash -ex
    container image pull gcc:15.1.0-bookworm
    container run -c ${1:-2} -m ${2:-16G} --rm -it --entrypoint /bin/bash --arch amd64 -v ${PWD}:/my -w /my gcc

    build.sh

    #! /bin/bash -ex
    
    sh cmake-3.31.8-linux-x86_64.sh
    pushd /usr/bin
    ln -s /my/cmake-3.31.8-linux-x86_64/bin/cmake
    ln -s /my/cmake-3.31.8-linux-x86_64/bin/ctest
    popd
    rm -rf jansson-2.14
    tar xfz jansson-2.14.tar.gz
    cd jansson-2.14
    cmake .
    make
    make check
  6. jglogan commented on Aug 15, 2025

    @jglogan
    Contributor

    @jgehw @yerseg I'm on an M3 Pro Max, when I tried with 2 CPUs, running the commands one by one, everything worked fine.

    Went to 10 CPUs and just ran the build script and I see it hang in cmake.

    ps output:

    root@e7556c68-4ffa-4651-a272-258cc3a40810:/my# ps -ef
    UID        PID  PPID  C STIME TTY          TIME CMD
    root         1     0  0 00:42 ?        00:00:00 /bin/bash
    root         3     1  0 00:43 ?        00:00:00 /bin/bash -ex ./build.sh
    root        18     3  0 00:43 ?        00:00:00 /usr/bin/cmake .
    root        59    18  0 00:43 ?        00:00:00 [cmake] <defunct>
    root        73     0  0 00:46 ?        00:00:00 /usr/bin/bash
    root       146    73 80 00:47 ?        00:00:00 /usr/bin/ps -ef

    Attached strace to PID 18 and cmake completed. make worked, make check also hung.

    Nothing obvious in the boot logs but that's not going to show anything about the shell's child processes.

  7. removed their assignment
    on Aug 15, 2025
  8. dcantah commented on Aug 26, 2025

    @dcantah
    Contributor

    We've identified this as a Rosetta emulation issue. The Rosetta team is investigating!

  9. jglogan commented on Mar 31, 2026

    @jglogan
    Contributor

    Please retest with macOS 26.2 or newer. I believe that the Rosetta fix for this issue landed there.

    I tested with on my system using the build.sh script above and don't see the hang.

    Open a new issue with full repro steps if you see it happening on 26.2 or newer.

  10. jgehw commented on Apr 11, 2026

    @jgehw
    Author

    I retested with macOS 26.4 -- that fixed the issue :-)

    Many thanks!

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions