• Bug#1101839: python3-tqdm: segmentation fault in destructor method

    From Emmanuel Arias@21:1/5 to All on Mon Jul 14 12:10:02 2025
    Hi Roland,

    For some reason I cannot reproduce the bug. I'm running autopktests in
    this way, previously I removed your Testuite deactivation.

    ```
    autopkgtest python-nxtomomill_1.1.0-4.dsc -- unshare --release unstable
    ```

    But I have a setuptools error instead:

    ```
    ERROR Backend 'setuptools.build_meta:__legacy__' is not available.
    ```

    Can you confirm please, if you are still reproducing the error, and please, could you provide how do you run autopkgtests?

    Thanks in advance!


    --
    cheers,
    Emmanuel Arias

    ⢀⣴⠾⠻⢶⣦⠀
    ⣾⠁⢠⠒⠀⣿⡁ [email protected]
    ⢿⡄⠘⠷⠚⠋⠀ OpenPGP: 13796755BBC72BB8ABE2AEB5 FA9DEC5DE11C63F1
    ⠈⠳⣄

    -----BEGIN PGP SIGNATURE-----

    iQIzBAABCgAdFiEEE3lnVbvHK7ir4q61+p3sXeEcY/EFAmh01gYACgkQ+p3sXeEc Y/EwlBAAgri5gGY4FnYUZZZfbCUPDZP1251QPJaqG8OswP26ZP18buf/39IhK58+ yie7A7t5AsIwsdbZDq4fgVAWg8isq2Di6VAIz1h1vA4Oa7bRgigodDshDo8RLVDx AWpXS/jfGsOwQMl6vKZOaT51iwLHi0v7+LYzsyLtWuB20cagHZXaoyJEWt3aL/X3 ZUYUpwvONygQp+nWFXYA7Q6s4Wb+T+AQUo9V6+O+rATZEl2OlFeWG4HiSCfW+58r LjtkF9AVPbriaR+w9RANVYIO9M+mOLL9GBlhI9ko0hp0NyY74iLA1JhvA0H+kr92 DBqUIDh9/93rKiwjo9L+ZUCVVwLpl65By79lKqeQb+4F/37mMsz5RQpxnxEs/i37 +TKlN2OKMdeyY2XnwBkSiqjkSL39+l2hP40NERsn6LBwLaVh5GWMZBtcjGOk0u8t 31ngn1AgWp2VTb+cHEKJTf4oCn1dwiMMlomhzMew5HSyKdE/V6nFiZbybzDE0haU WeNIXA1T2yBw/NfbOrNcdjgGP20UIKtJgdeCzVO3S0vNqMrtN4ogHX1wambKHcgI iwMxNw6DNkOJWy1W8yci0NoNFMKd0A2Mx2Ea+yrb5Blnirzq267D6GUX6RZwMjYa 1V7GlM+L0rbXN+/AjCIhQ7aKpGZzVlEmHvlNwjzocH+ACZw
  • From =?UTF-8?B?R8OhYm9yIE7DqW1ldGg=?=@21:1/5 to All on Sat Jul 26 17:10:01 2025
    Hi,

    Following on your idea here I can reproduce the segfault in unstable w/o nxtomomill at all. In a mostly empty unstable Docker I see:

    ```
    $ cat x.py
    import pytest
    from tqdm import tqdm

    @pytest.mark.parametrize("progress", (None, tqdm(desc="hola")))
    def test_poc(progress):
    if progress is not None:
    progress.total = 100
    progress.n = 20
    progress.refresh()
    assert 1==1
    $ pytest x.py
    ============================================================== test
    session starts
    ===============================================================
    platform linux -- Python 3.13.4, pytest-8.3.5, pluggy-1.5.0
    rootdir: /x
    collected 2 items


    x.py ..
    [100%]

    =============================================================== 2 passed
    in 0.02s ================================================================ Segmentation fault (core dumped)
    $ dpkg -l|grep tqdm
    ii python3-tqdm 4.67.1-5 all
    fast, extensible progress bar for Python 3 and CLI tool
    ```

    So it seems this is indeed due some pytest--tqdm interaction; maybe
    something to do with how the former creates parameter lists early during
    module setup time, I'm not sure.

    However if tqdm is needed to be tested with, but its output can be
    omitted then `tqdm(..., disable=True)` makes the test work.

    Alternatively one can postpone tqdm initialization:

    ```
    ...
    @pytest.mark.parametrize("progress", (None, lambda: tqdm(desc="hola")))
    def test_poc(progress):
    if progress is not None:
    progress = progress()
    ...
    ```

    I can't find any details/prohibitions of tqdm use in pytest manuals and
    I'm unsure if this actually is a tqdm bug, but maybe the workaround can
    be filed against nxtomomill?

    BR,
    Gábor

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)