Skip to content

NotImplementedError raised on Linux AArch64 for multiprocessing qsize() #804

@Mousius

Description

@Mousius

Solution to issue cannot be found in the documentation.

  • I checked the documentation.

Issue

As noted on https://docs.python.org/3/library/multiprocessing.html#multiprocessing.Queue.qsize, sem_getvalue isn't implemented on certain platforms but should work on AArch64 Linux.

This is checked at build time here:
https://github.com/python/cpython/blob/0d582def34babca7417ece8a9e4e16cc2a752d44/configure.ac#L6178

Using the default Python interpreter on Ubuntu this error doesn't appear. There's an ancient fix here: https://bugs.launchpad.net/bugs/630511

Reproducer:

import multiprocessing

queue = multiprocessing.Queue()

print(queue.qsize())

With Ubuntu Python:

$ /usr/bin/python3.10 ~/repo.py
0

With conda-forge Python (tested with both 3.10 and 3.13):

$ /opt/conda/envs/py_3.13/bin/python ~/repo.py
Traceback (most recent call last):
  File "/var/lib/jenkins/repo.py", line 5, in <module>
    print(queue.qsize())
          ~~~~~~~~~~~^^
  File "/opt/conda/envs/py_3.13/lib/python3.13/multiprocessing/queues.py", line 124, in qsize
    return self._maxsize - self._sem._semlock._get_value()
                           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
NotImplementedError

Installed packages

# packages in environment at /opt/conda/envs/py_3.13:
#
# Name                    Version                   Build  Channel
_openmp_mutex             4.5                       2_gnu
bzip2                     1.0.8                h68df207_7
ca-certificates           2025.6.15            hbd8a1cb_0
ld_impl_linux-aarch64     2.43                 h5e2c951_5
libexpat                  2.7.0                h5ad3122_0
libffi                    3.4.6                he21f813_1
libgcc                    15.1.0               he277a41_2
libgcc-ng                 15.1.0               he9431aa_2
libgomp                   15.1.0               he277a41_2
liblzma                   5.8.1                h86ecc28_2
libmpdec                  4.0.0                h86ecc28_0
libsqlite                 3.50.1               h5eb1b54_0
libuuid                   2.38.1               hb4cce97_0
libzlib                   1.3.1                h86ecc28_2
ncurses                   6.5                  ha32ae93_3
openssl                   3.5.0                hd08dc88_1
pip                       25.1.1             pyh145f28c_0
python                    3.13.5          h2382df9_102_cp313
python_abi                3.13                    7_cp313
readline                  8.2                  h8382b9d_2
tk                        8.6.13          noxft_h5688188_102
tzdata                    2025b                h78e105d_0

Environment info

active environment : py_3.13
    active env location : /opt/conda/envs/py_3.13
            shell level : 2
       user config file : /var/lib/jenkins/.condarc
 populated config files : /opt/conda/.condarc
          conda version : 25.3.0
    conda-build version : not installed
         python version : 3.12.10.final.0
                 solver : libmamba (default)
       virtual packages : __archspec=1=aarch64
                          __conda=25.3.0=0
                          __glibc=2.35=0
                          __linux=6.8.0=0
                          __unix=0=0
       base environment : /opt/conda  (writable)
      conda av data dir : /opt/conda/etc/conda
  conda av metadata url : None
           channel URLs : https://artifactory.arm.com/artifactory/api/conda/mirrors.conda-forge/linux-aarch64
                          https://artifactory.arm.com/artifactory/api/conda/mirrors.conda-forge/noarch
          package cache : /opt/conda/pkgs
                          /var/lib/jenkins/.conda/pkgs
       envs directories : /opt/conda/envs
                          /var/lib/jenkins/.conda/envs
               platform : linux-aarch64
             user-agent : conda/25.3.0 requests/2.32.3 CPython/3.12.10 Linux/6.8.0-50-generic ubuntu/22.04.5 glibc/2.35 solver/libmamba conda-libmamba-solver/25.3.0 libmambapy/2.1.1
                UID:GID : 1000:1000
             netrc file : None
           offline mode : False

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions