conda-forge / libnetcdf-feedstock

A conda-smithy repository for libnetcdf.
BSD 3-Clause "New" or "Revised" License
3 stars 43 forks source link

Recent builds cause hanging on Windows #182

Open djhoese opened 1 year ago

djhoese commented 1 year ago

Solution to issue cannot be found in the documentation.

Issue

The CI in GitHub Actions for the Satpy library have started hanging on Windows. It seems to be related to the specific build of libnetcdf. With:

libnetcdf 4.9.2 nompi_h5902ca5_107 conda-forge/win-64

it works fine. With the same code and same dependencies except for the newer build of libnetcdf:

libnetcdf 4.9.2 nompi_h624ddae_109 conda-forge/win-64

Pytest finishes running Satpy's tests (successfully) but then never exits. There is no other difference from what I can tell except the libnetcdf build. A fellow contributor @simonrp84 was able to reproduce this on his local Windows machine. His environment is what's providing the output for the below conda commands.

Otherwise, here is a passing Satpy CI job:

https://github.com/pytroll/satpy/actions/runs/5577565489/jobs/10190534313

And a hanging one:

https://github.com/pytroll/satpy/actions/runs/5594450997/jobs/10229326506

Installed packages

# packages in environment at C:\Users\Simon\miniconda3:
#
# Name                    Version                   Build  Channel
affine                    2.4.0              pyhd8ed1ab_0    conda-forge
aiobotocore               2.5.0              pyhd8ed1ab_0    conda-forge
aiohttp                   3.8.4           py311ha68e1ae_1    conda-forge
aioitertools              0.11.0             pyhd8ed1ab_0    conda-forge
aiosignal                 1.3.1              pyhd8ed1ab_0    conda-forge
alabaster                 0.7.13             pyhd8ed1ab_0    conda-forge
anyio                     3.7.1              pyhd8ed1ab_0    conda-forge
aom                       3.5.0                h63175ca_0    conda-forge
appdirs                   1.4.4              pyh9f0ad1d_0    conda-forge
argon2-cffi               21.3.0             pyhd8ed1ab_0    conda-forge
argon2-cffi-bindings      21.2.0          py311ha68e1ae_3    conda-forge
arrow-cpp                 12.0.0           h57928b3_1_cpu    conda-forge
asciitree                 0.3.3                      py_2    conda-forge
asdf                      2.14.3             pyhd8ed1ab_1    conda-forge
asdf-astropy              0.4.0              pyhd8ed1ab_1    conda-forge
asdf-coordinates-schemas  0.2.0              pyhd8ed1ab_1    conda-forge
asdf-standard             1.0.3              pyhd8ed1ab_0    conda-forge
asdf-transform-schemas    0.3.0              pyhd8ed1ab_0    conda-forge
asdf-unit-schemas         0.1.0              pyhd8ed1ab_0    conda-forge
asdf-wcs-schemas          0.1.1              pyhd8ed1ab_0    conda-forge
astropy                   5.3.1           py311h59ca53f_0    conda-forge
asttokens                 2.2.1              pyhd8ed1ab_0    conda-forge
async-timeout             4.0.2              pyhd8ed1ab_0    conda-forge
attrs                     23.1.0             pyh71513ae_1    conda-forge
aws-c-auth                0.7.0                h6f3c987_2    conda-forge
aws-c-cal                 0.6.0                h6ba3258_0    conda-forge
aws-c-common              0.8.23               hcfcfb64_0    conda-forge
aws-c-compression         0.2.17               h420beca_1    conda-forge
aws-c-event-stream        0.3.1                had47b81_1    conda-forge
aws-c-http                0.7.11               h72ba615_0    conda-forge
aws-c-io                  0.13.28              ha35c040_0    conda-forge
aws-c-mqtt                0.8.14               h4941efa_2    conda-forge
aws-c-s3                  0.3.13               he04eaa7_2    conda-forge
aws-c-sdkutils            0.1.11               h420beca_1    conda-forge
aws-checksums             0.1.16               h420beca_1    conda-forge
aws-crt-cpp               0.20.3               h247a981_4    conda-forge
aws-sdk-cpp               1.10.57             h1a0519f_17    conda-forge
awscli                    1.27.76         py311h1ea47a8_2    conda-forge
babel                     2.12.1             pyhd8ed1ab_1    conda-forge
backcall                  0.2.0              pyh9f0ad1d_0    conda-forge
backports                 1.0                pyhd8ed1ab_3    conda-forge
backports.functools_lru_cache 1.6.5              pyhd8ed1ab_0    conda-forge
backports.zoneinfo        0.2.1           py311h1ea47a8_7    conda-forge
beautifulsoup4            4.12.2             pyha770c72_0    conda-forge
bleach                    6.0.0              pyhd8ed1ab_0    conda-forge
blosc                     1.21.4               hdccc3a2_0    conda-forge
bokeh                     3.2.0              pyhd8ed1ab_0    conda-forge
boltons                   23.0.0             pyhd8ed1ab_0    conda-forge
boost-cpp                 1.78.0               h9f4b32c_3    conda-forge
boto3                     1.26.76            pyhd8ed1ab_0    conda-forge
botocore                  1.29.76            pyhd8ed1ab_0    conda-forge
bottleneck                1.3.7           py311h59ca53f_0    conda-forge
branca                    0.6.0              pyhd8ed1ab_0    conda-forge
brotli                    1.0.9                hcfcfb64_9    conda-forge
brotli-bin                1.0.9                hcfcfb64_9    conda-forge
brotlipy                  0.7.0           py311ha68e1ae_1005    conda-forge
build                     0.7.0              pyhd8ed1ab_0    conda-forge
bzip2                     1.0.8                h8ffe710_4    conda-forge
c-ares                    1.19.1               hcfcfb64_0    conda-forge
c-blosc2                  2.10.0               h183a6f4_0    conda-forge
ca-certificates           2023.5.7             h56e8100_0    conda-forge
cached-property           1.5.2                hd8ed1ab_1    conda-forge
cached_property           1.5.2              pyha770c72_1    conda-forge
cachetools                5.3.1              pyhd8ed1ab_0    conda-forge
caerus                    0.1.9                    pypi_0    pypi
cairo                     1.16.0            hdecc03f_1016    conda-forge
cartopy                   0.21.1          py311h178a126_1    conda-forge
certifi                   2023.5.7           pyhd8ed1ab_0    conda-forge
cffi                      1.15.1          py311h7d9ee11_3    conda-forge
cfgrib                    0.9.10.4           pyhd8ed1ab_0    conda-forge
cfgv                      3.3.1              pyhd8ed1ab_0    conda-forge
cfitsio                   4.2.0                h9ebe7e4_0    conda-forge
cftime                    1.6.2           py311h59ca53f_1    conda-forge
chardet                   5.1.0           py311h1ea47a8_0    conda-forge
charls                    2.4.2                h1537add_0    conda-forge
charset-normalizer        3.2.0              pyhd8ed1ab_0    conda-forge
click                     8.1.6           win_pyh7428d3b_0    conda-forge
click-plugins             1.1.1                      py_0    conda-forge
cligj                     0.7.2              pyhd8ed1ab_1    conda-forge
cloudpickle               2.2.1              pyhd8ed1ab_0    conda-forge
cmarkgfm                  0.8.0           py311ha68e1ae_2    conda-forge
cogeo-mosaic              5.1.1                    pypi_0    pypi
color-operations          0.1.1           py311h59ca53f_2    conda-forge
colorama                  0.4.4              pyh9f0ad1d_0    conda-forge
comm                      0.1.3              pyhd8ed1ab_0    conda-forge
conda                     23.5.2          py311h1ea47a8_0    conda-forge
conda-build               3.24.0          py311h1ea47a8_1    conda-forge
conda-package-handling    2.0.2              pyh38be061_0    conda-forge
conda-package-streaming   0.8.0              pyhd8ed1ab_0    conda-forge
configobj                 5.0.8              pyhd8ed1ab_0    conda-forge
contourpy                 1.1.0           py311h005e61a_0    conda-forge
coverage                  7.2.7           py311ha68e1ae_0    conda-forge
cramjam                   2.6.2                    pypi_0    pypi
cryptography              41.0.2          py311h28e9c30_0    conda-forge
cuda-version              11.8                 h70ddcb2_2    conda-forge
cudatoolkit               11.8.0              h09e9e62_12    conda-forge
cupy                      12.1.0          py311h77068d7_0    conda-forge
curl                      8.1.2                h68f0423_0    conda-forge
cycler                    0.11.0             pyhd8ed1ab_0    conda-forge
cytoolz                   0.12.0          py311ha68e1ae_1    conda-forge
dask                      2023.7.0           pyhd8ed1ab_0    conda-forge
dask-core                 2023.7.0           pyhd8ed1ab_0    conda-forge
dav1d                     1.2.1                hcfcfb64_0    conda-forge
debugpy                   1.6.7           py311h12c1d0e_0    conda-forge
decorator                 5.1.1              pyhd8ed1ab_0    conda-forge
defusedxml                0.7.1              pyhd8ed1ab_0    conda-forge
distlib                   0.3.7              pyhd8ed1ab_0    conda-forge
distributed               2023.7.0           pyhd8ed1ab_0    conda-forge
docutils                  0.15.2          py311h1ea47a8_6    conda-forge
donfig                    0.8.1              pyhd8ed1ab_0    conda-forge
eccodes                   2.31.0               ha10300a_0    conda-forge
ecmwf-opendata            0.2.0                     dev_0    <develop>
entrypoints               0.4                pyhd8ed1ab_0    conda-forge
ephem                     4.1.4           py311ha68e1ae_0    conda-forge
eumdac                    2.0.1              pyhd8ed1ab_0    conda-forge
exceptiongroup            1.1.2              pyhd8ed1ab_0    conda-forge
executing                 1.2.0              pyhd8ed1ab_0    conda-forge
expat                     2.5.0                h63175ca_1    conda-forge
fastapi                   0.94.1                   pypi_0    pypi
fasteners                 0.17.3             pyhd8ed1ab_0    conda-forge
fastrlock                 0.8             py311h12c1d0e_3    conda-forge
ffmpeg                    6.0.0           gpl_h2b371f0_103    conda-forge
filelock                  3.12.2             pyhd8ed1ab_0    conda-forge
findlibs                  0.0.5              pyhd8ed1ab_0    conda-forge
findpeaks                 2.5.0                    pypi_0    pypi
fiona                     1.9.4           py311h4e4dc46_0    conda-forge
flit-core                 3.9.0              pyhd8ed1ab_0    conda-forge
fmt                       9.1.0                h181d51b_0    conda-forge
folium                    0.14.0             pyhd8ed1ab_0    conda-forge
font-ttf-dejavu-sans-mono 2.37                 hab24e00_0    conda-forge
font-ttf-inconsolata      3.000                h77eed37_0    conda-forge
font-ttf-source-code-pro  2.038                h77eed37_0    conda-forge
font-ttf-ubuntu           0.83                 hab24e00_0    conda-forge
fontconfig                2.14.2               hbde0cde_0    conda-forge
fonts-conda-ecosystem     1                             0    conda-forge
fonts-conda-forge         1                             0    conda-forge
fonttools                 4.41.0          py311ha68e1ae_0    conda-forge
freeglut                  3.2.2                h63175ca_2    conda-forge
freetype                  2.12.1               h546665d_1    conda-forge
freexl                    1.0.6                h67ca5e6_1    conda-forge
frozenlist                1.4.0           py311ha68e1ae_0    conda-forge
fsspec                    2023.6.0           pyh1a96a4e_0    conda-forge
gdal                      3.7.0           py311h68c9619_3    conda-forge
geojson-pydantic          0.6.3              pyhd8ed1ab_0    conda-forge
geopandas                 0.13.2             pyhd8ed1ab_1    conda-forge
geopandas-base            0.13.2             pyha770c72_1    conda-forge
geos                      3.11.2               h1537add_0    conda-forge
geotiff                   1.7.1               h4e61e90_10    conda-forge
gettext                   0.21.1               h5728263_0    conda-forge
gflags                    2.2.2             ha925a31_1004    conda-forge
giflib                    5.2.1                h64bf75a_3    conda-forge
glib                      2.76.4               h12be248_0    conda-forge
glib-tools                2.76.4               h12be248_0    conda-forge
glmtools                  0.1.dev0                  dev_0    <develop>
glob2                     0.7                        py_0    conda-forge
glog                      0.6.0                h4797de2_0    conda-forge
graphite2                 1.3.13                     1000    conda-forge
gst-plugins-base          1.22.4               h001b923_1    conda-forge
gstreamer                 1.22.4               hb4038d2_1    conda-forge
gwcs                      0.18.3             pyhd8ed1ab_0    conda-forge
h11                       0.14.0             pyhd8ed1ab_0    conda-forge
h2                        4.1.0              pyhd8ed1ab_0    conda-forge
h5netcdf                  1.2.0              pyhd8ed1ab_0    conda-forge
h5py                      3.9.0           nompi_py311hc8b35be_101    conda-forge
harfbuzz                  7.3.0                h196d34a_0    conda-forge
hdf4                      4.2.15               h1334946_6    conda-forge
hdf5                      1.14.1          nompi_h73e8ff5_100    conda-forge
hpack                     4.0.0              pyh9f0ad1d_0    conda-forge
httpcore                  0.17.3             pyhd8ed1ab_0    conda-forge
httpx                     0.24.1             pyhd8ed1ab_0    conda-forge
hyperframe                6.0.1              pyhd8ed1ab_0    conda-forge
hypothesis                6.81.2             pyha770c72_0    conda-forge
icu                       72.1                 h63175ca_0    conda-forge
identify                  2.5.24             pyhd8ed1ab_0    conda-forge
idna                      3.4                pyhd8ed1ab_0    conda-forge
imagecodecs               2023.1.23       py311h2c9abbb_2    conda-forge
imageio                   2.31.1             pyh24c5eb1_0    conda-forge
imagesize                 1.4.1              pyhd8ed1ab_0    conda-forge
importlib-metadata        6.8.0              pyha770c72_0    conda-forge
importlib-resources       6.0.0              pyhd8ed1ab_1    conda-forge
importlib_metadata        6.8.0                hd8ed1ab_0    conda-forge
importlib_resources       6.0.0              pyhd8ed1ab_1    conda-forge
iniconfig                 2.0.0              pyhd8ed1ab_0    conda-forge
intel-openmp              2023.1.0         h57928b3_46319    conda-forge
ipykernel                 6.24.0             pyh6817e22_0    conda-forge
ipython                   8.14.0             pyh08f2357_0    conda-forge
ipython_genutils          0.2.0                      py_1    conda-forge
ipywidgets                8.0.7              pyhd8ed1ab_0    conda-forge
jaraco.classes            3.3.0              pyhd8ed1ab_0    conda-forge
jasper                    4.0.0                h00710e9_1    conda-forge
jedi                      0.18.2             pyhd8ed1ab_0    conda-forge
jinja2                    3.1.2              pyhd8ed1ab_1    conda-forge
jmespath                  1.0.1              pyhd8ed1ab_0    conda-forge
joblib                    1.3.0              pyhd8ed1ab_1    conda-forge
jplephem                  2.18               pyh78acc04_0    conda-forge
jsonpatch                 1.32               pyhd8ed1ab_0    conda-forge
jsonpointer               2.0                        py_0    conda-forge
jsonschema                4.18.4             pyhd8ed1ab_0    conda-forge
jsonschema-specifications 2023.7.1           pyhd8ed1ab_0    conda-forge
jupyter                   1.0.0           py311h1ea47a8_8    conda-forge
jupyter_client            8.3.0              pyhd8ed1ab_0    conda-forge
jupyter_console           6.6.3              pyhd8ed1ab_0    conda-forge
jupyter_core              5.3.1           py311h1ea47a8_0    conda-forge
jupyter_events            0.6.3              pyhd8ed1ab_0    conda-forge
jupyter_server            2.7.0              pyhd8ed1ab_0    conda-forge
jupyter_server_terminals  0.4.4              pyhd8ed1ab_1    conda-forge
jupyterlab_pygments       0.2.2              pyhd8ed1ab_0    conda-forge
jupyterlab_widgets        3.0.8              pyhd8ed1ab_0    conda-forge
jxrlib                    1.1                  h8ffe710_2    conda-forge
kealib                    1.5.1                h96def13_4    conda-forge
keyring                   24.2.0          py311h1ea47a8_0    conda-forge
kiwisolver                1.4.4           py311h005e61a_1    conda-forge
krb5                      1.20.1               heb0366b_0    conda-forge
lazy_loader               0.2                pyhd8ed1ab_0    conda-forge
lcms2                     2.15                 h3e3b177_1    conda-forge
lerc                      4.0.0                h63175ca_0    conda-forge
libabseil                 20230125.0      cxx17_h63175ca_1    conda-forge
libaec                    1.0.6                h63175ca_1    conda-forge
libarchive                3.6.2                h6f8411a_1    conda-forge
libarrow                  12.0.0           h91bed3e_1_cpu    conda-forge
libavif                   0.11.1               ha7b97ba_2    conda-forge
libblas                   3.9.0              17_win64_mkl    conda-forge
libbrotlicommon           1.0.9                hcfcfb64_9    conda-forge
libbrotlidec              1.0.9                hcfcfb64_9    conda-forge
libbrotlienc              1.0.9                hcfcfb64_9    conda-forge
libcblas                  3.9.0              17_win64_mkl    conda-forge
libclang                  16.0.6          default_heb8d277_0    conda-forge
libclang13                16.0.6          default_hc80b9e7_0    conda-forge
libcrc32c                 1.1.2                h0e60522_0    conda-forge
libcurl                   8.1.2                h68f0423_0    conda-forge
libdeflate                1.18                 hcfcfb64_0    conda-forge
libevent                  2.1.12               h3671451_1    conda-forge
libexpat                  2.5.0                h63175ca_1    conda-forge
libffi                    3.4.2                h8ffe710_5    conda-forge
libgdal                   3.7.0                h123a834_3    conda-forge
libglib                   2.76.4               he8f3873_0    conda-forge
libgoogle-cloud           2.10.0               h00b2bdc_0    conda-forge
libgrpc                   1.54.2               h32da247_0    conda-forge
libhwloc                  2.9.1           nocuda_h15da153_6    conda-forge
libiconv                  1.17                 h8ffe710_0    conda-forge
libjpeg-turbo             2.1.5.1              hcfcfb64_0    conda-forge
libkml                    1.3.0             hf2ab4e4_1015    conda-forge
liblapack                 3.9.0              17_win64_mkl    conda-forge
liblapacke                3.9.0              17_win64_mkl    conda-forge
liblief                   0.12.3               h63175ca_0    conda-forge
libmamba                  1.4.9                ha24f096_0    conda-forge
libmambapy                1.4.9           py311h29ee5fe_0    conda-forge
libnetcdf                 4.9.2           nompi_h624ddae_109    conda-forge
libogg                    1.3.4                h8ffe710_1    conda-forge
libopencv                 4.7.0           py311h787696b_6    conda-forge
libopus                   1.3.1                h8ffe710_1    conda-forge
libpng                    1.6.39               h19919ed_0    conda-forge
libpq                     15.3                 ha9684e8_1    conda-forge
libprotobuf               3.21.12              h12be248_0    conda-forge
librttopo                 1.1.0               he1da8c1_13    conda-forge
libsodium                 1.0.18               h8d14728_1    conda-forge
libsolv                   0.7.24               h12be248_1    conda-forge
libspatialindex           1.9.3                h39d44d4_4    conda-forge
libspatialite             5.0.1               hf8d749d_27    conda-forge
libsqlite                 3.42.0               hcfcfb64_0    conda-forge
libssh2                   1.11.0               h7dfc565_0    conda-forge
libthrift                 0.18.1               h06f6336_2    conda-forge
libtiff                   4.5.1                h6c8260b_0    conda-forge
libutf8proc               2.8.0                h82a8f57_0    conda-forge
libvorbis                 1.3.7                h0e60522_0    conda-forge
libwebp-base              1.3.1                hcfcfb64_0    conda-forge
libxcb                    1.15                 hcd874cb_0    conda-forge
libxml2                   2.11.4               hc3477c8_0    conda-forge
libzip                    1.9.2                h519de47_1    conda-forge
libzlib                   1.2.13               hcfcfb64_5    conda-forge
libzopfli                 1.0.3                h0e60522_0    conda-forge
llvmlite                  0.40.0                   pypi_0    pypi
locket                    1.0.0              pyhd8ed1ab_0    conda-forge
lz4                       4.3.2           py311haddf500_0    conda-forge
lz4-c                     1.9.4                hcfcfb64_0    conda-forge
lzo                       2.10              he774522_1000    conda-forge
m2-msys2-runtime          2.5.0.17080.65c939c               3    conda-forge
m2-patch                  2.7.5                         2    conda-forge
m2w64-gcc-libgfortran     5.3.0                         6    conda-forge
m2w64-gcc-libs            5.3.0                         7    conda-forge
m2w64-gcc-libs-core       5.3.0                         7    conda-forge
m2w64-gmp                 6.1.0                         2    conda-forge
m2w64-libwinpthread-git   5.0.0.4634.697f757               2    conda-forge
make                      4.3                  h3d2af85_1    conda-forge
mamba                     1.4.9           py311h8cb466b_0    conda-forge
mapclassify               2.5.0              pyhd8ed1ab_1    conda-forge
markdown-it-py            3.0.0              pyhd8ed1ab_0    conda-forge
markupsafe                2.1.3           py311ha68e1ae_0    conda-forge
matplotlib                3.7.1           py311h1ea47a8_0    conda-forge
matplotlib-base           3.7.1           py311h6e989c2_0    conda-forge
matplotlib-inline         0.1.6              pyhd8ed1ab_0    conda-forge
mdurl                     0.1.0              pyhd8ed1ab_0    conda-forge
menuinst                  1.4.19          py311h1ea47a8_1    conda-forge
mercantile                1.2.1                    pypi_0    pypi
miniforge_console_shortcut 2.0                  h57928b3_1    conda-forge
mistune                   3.0.0              pyhd8ed1ab_0    conda-forge
mkl                       2022.1.0           h6a75c08_874    conda-forge
more-itertools            9.1.0              pyhd8ed1ab_0    conda-forge
morecantile               4.3.0              pyhd8ed1ab_0    conda-forge
msgpack-python            1.0.5           py311h005e61a_0    conda-forge
msys2-conda-epoch         20160418                      1    conda-forge
multidict                 6.0.4           py311ha68e1ae_0    conda-forge
multiurl                  0.2.1                    pypi_0    pypi
munch                     4.0.0              pyhd8ed1ab_0    conda-forge
munkres                   1.1.4              pyh9f0ad1d_0    conda-forge
nbclassic                 1.0.0              pyhb4ecaf3_1    conda-forge
nbclient                  0.8.0              pyhd8ed1ab_0    conda-forge
nbconvert                 7.7.1              pyhd8ed1ab_1    conda-forge
nbconvert-core            7.7.1              pyhd8ed1ab_1    conda-forge
nbconvert-pandoc          7.7.1              pyhd8ed1ab_1    conda-forge
nbformat                  5.9.1              pyhd8ed1ab_0    conda-forge
nest-asyncio              1.5.6              pyhd8ed1ab_0    conda-forge
netcdf4                   1.6.4           nompi_py311h91f5014_101    conda-forge
networkx                  3.1                pyhd8ed1ab_0    conda-forge
nodeenv                   1.8.0              pyhd8ed1ab_0    conda-forge
notebook                  6.5.4              pyha770c72_0    conda-forge
notebook-shim             0.2.3              pyhd8ed1ab_0    conda-forge
numba                     0.57.1          py311h2c0921f_0    conda-forge
numcodecs                 0.11.0          py311h12c1d0e_1    conda-forge
numexpr                   2.8.4           mkl_py311h9a3bfb6_0    conda-forge
numpy                     1.24.4          py311h0b4df5a_0    conda-forge
odfpy                     1.4.1                      py_0    conda-forge
opencv                    4.7.0           py311h1ea47a8_6    conda-forge
openh264                  2.3.1                h63175ca_2    conda-forge
openjpeg                  2.5.0                ha2aaf27_2    conda-forge
openssl                   3.1.1                hcfcfb64_1    conda-forge
orc                       1.8.3                hada7b9e_1    conda-forge
overrides                 7.3.1              pyhd8ed1ab_0    conda-forge
packaging                 23.1               pyhd8ed1ab_0    conda-forge
pandas                    2.0.3           py311hf63dbb6_1    conda-forge
pandoc                    3.1.3                h57928b3_0    conda-forge
pandocfilters             1.5.0              pyhd8ed1ab_0    conda-forge
parquet-cpp               1.5.1                         2    conda-forge
parso                     0.8.3              pyhd8ed1ab_0    conda-forge
partd                     1.4.0              pyhd8ed1ab_0    conda-forge
pbr                       5.11.1             pyhd8ed1ab_0    conda-forge
pcre2                     10.40                h17e33f8_0    conda-forge
peakdetect                1.1                      pypi_0    pypi
pep517                    0.13.0             pyhd8ed1ab_0    conda-forge
photutils                 1.8.0           py311h59ca53f_0    conda-forge
pickleshare               0.7.5                   py_1003    conda-forge
pillow                    10.0.0          py311hde623f7_0    conda-forge
pip                       23.2               pyhd8ed1ab_0    conda-forge
pixman                    0.40.0               h8ffe710_0    conda-forge
pkginfo                   1.9.6              pyhd8ed1ab_0    conda-forge
pkgutil-resolve-name      1.3.10             pyhd8ed1ab_0    conda-forge
platformdirs              3.9.1              pyhd8ed1ab_0    conda-forge
pluggy                    1.2.0              pyhd8ed1ab_0    conda-forge
ply                       3.11                       py_1    conda-forge
pooch                     1.7.0              pyha770c72_3    conda-forge
poppler                   23.05.0              h45d20d0_1    conda-forge
poppler-data              0.4.12               hd8ed1ab_0    conda-forge
postgresql                15.3                 h96452e4_1    conda-forge
pre-commit                3.3.3              pyha770c72_0    conda-forge
pre_commit                3.3.3                hd8ed1ab_0    conda-forge
proj                      9.2.1                h660b3b0_0    conda-forge
prometheus_client         0.17.1             pyhd8ed1ab_0    conda-forge
prompt-toolkit            3.0.39             pyha770c72_0    conda-forge
prompt_toolkit            3.0.39               hd8ed1ab_0    conda-forge
psutil                    5.9.5           py311ha68e1ae_0    conda-forge
pthread-stubs             0.4               hcd874cb_1001    conda-forge
pthreads-win32            2.9.1                hfa6e2cd_3    conda-forge
pure_eval                 0.2.2              pyhd8ed1ab_0    conda-forge
py-lief                   0.12.3          py311h12c1d0e_0    conda-forge
py-opencv                 4.7.0           py311h3810d55_6    conda-forge
pyarrow                   12.0.0          py311h6a6099b_1_cpu    conda-forge
pyasn1                    0.4.8                      py_0    conda-forge
pyatmcor                  0.0.1                    pypi_0    pypi
pybind11-abi              4                    hd8ed1ab_3    conda-forge
pycosat                   0.6.4           py311ha68e1ae_1    conda-forge
pycparser                 2.21               pyhd8ed1ab_0    conda-forge
pydantic                  1.10.11         py311ha68e1ae_0    conda-forge
pyerfa                    2.0.0.3         py311h59ca53f_0    conda-forge
pyflextrkr                1.0.0                     dev_0    <develop>
pygments                  2.15.1             pyhd8ed1ab_0    conda-forge
pygrib                    2.1.4           py311hb25bc96_7    conda-forge
pyhdf                     0.10.5          py311h702c2b7_1    conda-forge
pykdtree                  1.3.7.post0     py311h59ca53f_0    conda-forge
pyopenssl                 23.2.0             pyhd8ed1ab_1    conda-forge
pyorbital                 1.8.0              pyhd8ed1ab_0    conda-forge
pyparsing                 3.1.0              pyhd8ed1ab_0    conda-forge
pyproj                    3.6.0           py311hcff2a09_1    conda-forge
pyqt                      5.15.7          py311h125bc19_3    conda-forge
pyqt5-sip                 12.11.0         py311h12c1d0e_3    conda-forge
pyresample                1.27.1          py311hf63dbb6_1    conda-forge
pyrsistent                0.19.3          py311ha68e1ae_0    conda-forge
pyshp                     2.3.1              pyhd8ed1ab_0    conda-forge
pysocks                   1.7.1              pyh0701188_6    conda-forge
pyspectral                0.10.6.dev215+g60b5551.d20230710          pypi_0    pypi
pystac                    1.8.2              pyhd8ed1ab_0    conda-forge
pytest                    7.4.0              pyhd8ed1ab_0    conda-forge
pytest-arraydiff          0.5.0              pyhd8ed1ab_0    conda-forge
pytest-astropy            0.10.0             pyhd8ed1ab_0    conda-forge
pytest-astropy-header     0.2.2              pyhd8ed1ab_0    conda-forge
pytest-cov                4.1.0              pyhd8ed1ab_0    conda-forge
pytest-doctestplus        0.13.0             pyhd8ed1ab_0    conda-forge
pytest-filter-subpackage  0.1.1                      py_0    conda-forge
pytest-lazy-fixture       0.6.3                      py_0    conda-forge
pytest-mock               3.11.1             pyhd8ed1ab_0    conda-forge
pytest-openfiles          0.5.0                      py_0    conda-forge
pytest-remotedata         0.4.0              pyhd8ed1ab_0    conda-forge
python                    3.11.4          h2628c8c_0_cpython    conda-forge
python-dateutil           2.8.2              pyhd8ed1ab_0    conda-forge
python-dotenv             1.0.0              pyhd8ed1ab_0    conda-forge
python-eccodes            1.6.0           py311h59ca53f_0    conda-forge
python-fastjsonschema     2.17.1             pyhd8ed1ab_0    conda-forge
python-geotiepoints       1.6.0           py311h59ca53f_0    conda-forge
python-json-logger        2.0.7              pyhd8ed1ab_0    conda-forge
python-libarchive-c       5.0             py311h1ea47a8_1    conda-forge
python-tzdata             2023.3             pyhd8ed1ab_0    conda-forge
python_abi                3.11                    3_cp311    conda-forge
pytz                      2023.3             pyhd8ed1ab_0    conda-forge
pywavelets                1.4.1           py311h59ca53f_0    conda-forge
pywin32                   304             py311h12c1d0e_2    conda-forge
pywin32-ctypes            0.2.2           py311h1ea47a8_0    conda-forge
pywinpty                  2.0.11          py311h12c1d0e_0    conda-forge
pyyaml                    5.4.1           py311ha68e1ae_4    conda-forge
pyzmq                     25.1.0          py311h7b3f143_0    conda-forge
qt-main                   5.15.8              h2c8576c_12    conda-forge
qtconsole                 5.4.3              pyhd8ed1ab_0    conda-forge
qtconsole-base            5.4.3              pyha770c72_0    conda-forge
qtpy                      2.3.1              pyhd8ed1ab_0    conda-forge
rasterio                  1.3.8           py311h58bba51_0    conda-forge
re2                       2023.02.02           h63175ca_0    conda-forge
readme_renderer           40.0               pyhd8ed1ab_0    conda-forge
referencing               0.30.0             pyhd8ed1ab_0    conda-forge
reproc                    14.2.4               hcfcfb64_0    conda-forge
reproc-cpp                14.2.4               h63175ca_0    conda-forge
requests                  2.31.0             pyhd8ed1ab_0    conda-forge
requests-toolbelt         1.0.0              pyhd8ed1ab_0    conda-forge
rfc3339-validator         0.1.4              pyhd8ed1ab_0    conda-forge
rfc3986                   2.0.0              pyhd8ed1ab_0    conda-forge
rfc3986-validator         0.1.1              pyh9f0ad1d_0    conda-forge
rich                      13.4.2             pyhd8ed1ab_0    conda-forge
rio-cogeo                 3.5.1                    pypi_0    pypi
rio-stac                  0.6.1                    pypi_0    pypi
rio-tiler                 5.0.3              pyhd8ed1ab_0    conda-forge
rioxarray                 0.14.1             pyhd8ed1ab_0    conda-forge
ripgrep                   13.0.0               h7f3b576_2    conda-forge
rpds-py                   0.9.2           py311hc37eb10_0    conda-forge
rsa                       4.7.2              pyh44b312d_0    conda-forge
rtree                     1.0.1           py311hcacb13a_1    conda-forge
ruamel.yaml               0.17.32         py311ha68e1ae_0    conda-forge
ruamel.yaml.clib          0.2.7           py311ha68e1ae_1    conda-forge
s3fs                      2023.6.0           pyhd8ed1ab_0    conda-forge
s3transfer                0.6.1              pyhd8ed1ab_0    conda-forge
satpy                     0.42.3.dev248+g5c09f8d87.d20230710          pypi_0    pypi
scikit-image              0.21.0          py311h12c1d0e_0    conda-forge
scikit-learn              1.3.0           py311h142b183_0    conda-forge
scipy                     1.11.1          py311h37ff6ca_0    conda-forge
segment-anything          1.0                       dev_0    <develop>
semantic_version          2.10.0             pyhd8ed1ab_0    conda-forge
send2trash                1.8.2              pyh08f2357_0    conda-forge
setuptools                68.0.0             pyhd8ed1ab_0    conda-forge
sgp4                      2.22            py311h12feb9d_0    conda-forge
shapely                   2.0.1           py311h343093d_1    conda-forge
simplejson                3.19.1          py311ha68e1ae_0    conda-forge
sip                       6.7.9           py311h12c1d0e_0    conda-forge
six                       1.16.0             pyh6c4a22f_0    conda-forge
skyfield                  1.45               pyh1a96a4e_0    conda-forge
snappy                    1.1.10               hfb803bf_0    conda-forge
sniffio                   1.3.0              pyhd8ed1ab_0    conda-forge
snowballstemmer           2.2.0              pyhd8ed1ab_0    conda-forge
snuggs                    1.4.7                      py_0    conda-forge
sortedcontainers          2.4.0              pyhd8ed1ab_0    conda-forge
soupsieve                 2.3.2.post1        pyhd8ed1ab_0    conda-forge
sphinx                    5.1.1              pyhd8ed1ab_1    conda-forge
sphinx_rtd_theme          1.2.2              pyha770c72_0    conda-forge
sphinxcontrib-apidoc      0.3.0                      py_1    conda-forge
sphinxcontrib-applehelp   1.0.4              pyhd8ed1ab_0    conda-forge
sphinxcontrib-devhelp     1.0.2                      py_0    conda-forge
sphinxcontrib-htmlhelp    2.0.1              pyhd8ed1ab_0    conda-forge
sphinxcontrib-jquery      4.1                pyhd8ed1ab_0    conda-forge
sphinxcontrib-jsmath      1.0.1                      py_0    conda-forge
sphinxcontrib-qthelp      1.0.3                      py_0    conda-forge
sphinxcontrib-serializinghtml 1.1.5              pyhd8ed1ab_2    conda-forge
sqlite                    3.42.0               hcfcfb64_0    conda-forge
stack_data                0.6.2              pyhd8ed1ab_0    conda-forge
starlette                 0.30.0             pyhd8ed1ab_0    conda-forge
starlette-cramjam         0.3.2                    pypi_0    pypi
supermercado              0.2.0                    pypi_0    pypi
svt-av1                   1.6.0                h63175ca_0    conda-forge
tbb                       2021.9.0             h91493d7_0    conda-forge
tblib                     1.7.0              pyhd8ed1ab_0    conda-forge
terminado                 0.17.0             pyh08f2357_0    conda-forge
threadpoolctl             3.2.0              pyha21a80b_0    conda-forge
tifffile                  2023.7.10          pyhd8ed1ab_0    conda-forge
tiledb                    2.13.2               h3132609_0    conda-forge
tinycss2                  1.2.1              pyhd8ed1ab_0    conda-forge
titiler-application       0.11.6                   pypi_0    pypi
titiler-core              0.11.6                   pypi_0    pypi
titiler-extensions        0.11.6                   pypi_0    pypi
titiler-mosaic            0.11.6                   pypi_0    pypi
tk                        8.6.12               h8ffe710_0    conda-forge
toml                      0.10.2             pyhd8ed1ab_0    conda-forge
tomli                     2.0.1              pyhd8ed1ab_0    conda-forge
toolz                     0.12.0             pyhd8ed1ab_0    conda-forge
tornado                   6.3.2           py311ha68e1ae_0    conda-forge
tqdm                      4.65.0             pyhd8ed1ab_1    conda-forge
traitlets                 5.9.0              pyhd8ed1ab_0    conda-forge
trollimage                1.20.1             pyhd8ed1ab_0    conda-forge
trollsift                 0.5.0              pyhd8ed1ab_0    conda-forge
twine                     4.0.2              pyhd8ed1ab_0    conda-forge
typing-extensions         4.7.1                hd8ed1ab_0    conda-forge
typing_extensions         4.7.1              pyha770c72_0    conda-forge
typing_utils              0.1.0              pyhd8ed1ab_0    conda-forge
tzdata                    2023c                h71feb2d_0    conda-forge
ucrt                      10.0.22621.0         h57928b3_0    conda-forge
ukkonen                   1.0.1           py311h005e61a_3    conda-forge
urllib3                   1.26.15            pyhd8ed1ab_0    conda-forge
uvicorn                   0.23.1          py311h1ea47a8_0    conda-forge
vc                        14.3                h64f974e_17    conda-forge
vc14_runtime              14.36.32532         hfdfe4a8_17    conda-forge
virtualenv                20.24.0            pyhd8ed1ab_0    conda-forge
vs2015_runtime            14.36.32532         h05e6639_17    conda-forge
wcwidth                   0.2.6              pyhd8ed1ab_0    conda-forge
webencodings              0.5.1                      py_1    conda-forge
websocket-client          1.6.1              pyhd8ed1ab_0    conda-forge
wget                      3.2                      pypi_0    pypi
wheel                     0.40.0             pyhd8ed1ab_1    conda-forge
widgetsnbextension        4.0.8              pyhd8ed1ab_0    conda-forge
win_inet_pton             1.1.0              pyhd8ed1ab_6    conda-forge
winpty                    0.4.3                         4    conda-forge
wrapt                     1.15.0          py311ha68e1ae_0    conda-forge
x264                      1!164.3095           h8ffe710_2    conda-forge
x265                      3.5                  h2d74725_3    conda-forge
xarray                    2023.7.0           pyhd8ed1ab_0    conda-forge
xarray-datatree           0.0.12             pyhd8ed1ab_0    conda-forge
xerces-c                  3.2.4                h63175ca_2    conda-forge
xlrd                      2.0.1              pyhd8ed1ab_3    conda-forge
xorg-libxau               1.0.11               hcd874cb_0    conda-forge
xorg-libxdmcp             1.1.3                hcd874cb_0    conda-forge
xyzservices               2023.7.0           pyhd8ed1ab_0    conda-forge
xz                        5.2.6                h8d14728_0    conda-forge
yaml                      0.2.5                h8ffe710_2    conda-forge
yaml-cpp                  0.7.0                h63175ca_2    conda-forge
yarl                      1.9.2           py311ha68e1ae_0    conda-forge
zarr                      2.15.0             pyhd8ed1ab_0    conda-forge
zeromq                    4.3.4                h0e60522_1    conda-forge
zfp                       1.0.0                h63175ca_3    conda-forge
zict                      3.0.0              pyhd8ed1ab_0    conda-forge
zipp                      3.16.2             pyhd8ed1ab_0    conda-forge
zlib                      1.2.13               hcfcfb64_5    conda-forge
zlib-ng                   2.0.7                hcfcfb64_0    conda-forge
zstandard                 0.19.0          py311he5d195f_2    conda-forge
zstd                      1.5.2                h12be248_7    conda-forge

Environment info

active environment : base
    active env location : C:\Users\Simon\miniconda3
            shell level : 1
       user config file : C:\Users\Simon\.condarc
 populated config files : C:\Users\Simon\miniconda3\.condarc
                          C:\Users\Simon\.condarc
          conda version : 23.5.2
    conda-build version : 3.24.0
         python version : 3.11.4.final.0
       virtual packages : __archspec=1=x86_64
                          __cuda=12.2=0
                          __win=0=0
       base environment : C:\Users\Simon\miniconda3  (writable)
      conda av data dir : C:\Users\Simon\miniconda3\etc\conda
  conda av metadata url : None
           channel URLs : https://conda.anaconda.org/conda-forge/win-64
                          https://conda.anaconda.org/conda-forge/noarch
                          https://repo.anaconda.com/pkgs/main/win-64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/r/win-64
                          https://repo.anaconda.com/pkgs/r/noarch
                          https://repo.anaconda.com/pkgs/msys2/win-64
                          https://repo.anaconda.com/pkgs/msys2/noarch
          package cache : C:\Users\Simon\miniconda3\pkgs
                          C:\Users\Simon\.conda\pkgs
                          C:\Users\Simon\AppData\Local\conda\conda\pkgs
       envs directories : C:\Users\Simon\miniconda3\envs
                          C:\Users\Simon\.conda\envs
                          C:\Users\Simon\AppData\Local\conda\conda\envs
               platform : win-64
             user-agent : conda/23.5.2 requests/2.31.0 CPython/3.11.4 Windows/10 Windows/10.0.22000
          administrator : False
             netrc file : None
           offline mode : False
djhoese commented 1 year ago

I'm still trying to make a smaller reproducible example beyond running all of Satpy's tests. However, Satpy's tests are very complicated as far as dependencies go. They include GDAL, netcdf4-python, xarray, dask, cython extensions, etc. So there could be a lot of things conflicting with libnetcdf beyond the changes to the builds.

djhoese commented 1 year ago

Ah @simonrp84 just noted that these errors show up when his pytest command hangs:

Exception ignored in: <function File.close at 0x000002B262A5CFE0>
Traceback (most recent call last):
  File "C:\Users\Simon\miniconda3\Lib\site-packages\h5netcdf\core.py", line 1200, in close
  File "C:\Users\Simon\miniconda3\Lib\site-packages\h5py\_hl\files.py", line 578, in close
TypeError: 'NoneType' object does not support the context manager protocol
Exception ignored in: <function File.close at 0x000002B262A5CFE0>
Traceback (most recent call last):
  File "C:\Users\Simon\miniconda3\Lib\site-packages\h5netcdf\core.py", line 1200, in close
  File "C:\Users\Simon\miniconda3\Lib\site-packages\h5py\_hl\files.py", line 578, in close
TypeError: 'NoneType' object does not support the context manager protocol
Exception ignored in: <function File.close at 0x000002B262A5CFE0>
Traceback (most recent call last):
  File "C:\Users\Simon\miniconda3\Lib\site-packages\h5netcdf\core.py", line 1200, in close
  File "C:\Users\Simon\miniconda3\Lib\site-packages\h5py\_hl\files.py", line 578, in close
TypeError: 'NoneType' object does not support the context manager protocol
Exception ignored in: <function File.close at 0x000002B262A5CFE0>
Traceback (most recent call last):
  File "C:\Users\Simon\miniconda3\Lib\site-packages\h5netcdf\core.py", line 1200, in close
  File "C:\Users\Simon\miniconda3\Lib\site-packages\h5py\_hl\files.py", line 578, in close
TypeError: 'NoneType' object does not support the context manager protocol
Exception ignored in: <function File.close at 0x000002B262A5CFE0>
Traceback (most recent call last):
  File "C:\Users\Simon\miniconda3\Lib\site-packages\h5netcdf\core.py", line 1200, in close
  File "C:\Users\Simon\miniconda3\Lib\site-packages\h5py\_hl\files.py", line 578, in close
TypeError: 'NoneType' object does not support the context manager protocol
Exception ignored in: <function File.close at 0x000002B262A5CFE0>
Traceback (most recent call last):
  File "C:\Users\Simon\miniconda3\Lib\site-packages\h5netcdf\core.py", line 1200, in close
  File "C:\Users\Simon\miniconda3\Lib\site-packages\h5py\_hl\files.py", line 578, in close
TypeError: 'NoneType' object does not support the context manager protocol
djhoese commented 1 year ago

Ok I've got a reproducible example without Satpy:

import xarray as xr

def test_netcdf():
    fk = "test.nc"
    ds = xr.Dataset(
        coords={"nx": [0], "ny": [0]},
        attrs={
            "source": "satpy unit test",
            "time_coverage_start": "0001-01-01T00:00:00Z",
            "time_coverage_end": "0001-01-01T01:00:00Z",
        }
    )
    ds.to_netcdf(fk)

Run with python -c "import test_netcdf; test_netcdf.test_netcdf()" and it will just hang when run on Windows.

rouault commented 1 year ago

This also affects GDAL CI on Windows whose tests involving netcdf hang: https://github.com/OSGeo/gdal/actions/runs/5589991097/jobs/10222968884 e.g the following hangs after the 100% completion:

gdal_translate autotest\gcore\data\byte.tif out.nc
Input file size is 20, 20
0...10...20...30...40...50...60...70...80...90...100 - done.

And I also traced it to the nompi_h5902ca5_107 --> nompi_h624ddae_109 upgrade

djhoese commented 1 year ago

@rouault I haven't tested it yet, but I'm wondering if the 108 build is the actual issue. The 108 build should be the result of #180 being merged.

djhoese commented 1 year ago

A quick test on my CI shows 108 as the problem. Might have to revert the S3 support. CC @zklaus @dennisheimbigner @dopplershift

zklaus commented 1 year ago

Just to confirm, you are saying 107 works as expected?

djhoese commented 1 year ago

@zklaus As far as I can tell, yes 107 works fine. 107 was released almost 2 weeks earlier and I never noticed any issues. Based on @rouault's gdal_translate example, my guess is opening a NetCDF file for writing is the case that causes it to hang.

zklaus commented 1 year ago

It is a bit strange because the test you propose doesn't seem to have anything to do with S3, so I am wondering if it's a random upgrade in the environment that is causing this. To test, I'll add the test as a test to the recipe and see if de-/activating makes a difference. If the trace given above is any indication, h5netcdf or h5py might be involved.

djhoese commented 1 year ago

I also thought h5netcdf or h5py could be the issue, but when I narrowed it down to my simple Python example it seems less likely. I can try doing one with only importing the lower-level netcdf4-python library. If @rouault knows the exact part of GDAL that does the NetCDF writing, or if there is a test function that writes a NetCDF file, maybe that would also trigger it and remove Python from the equation entirely.

The exception I posted earlier is very strange, but may be a conflict between h5py and netcdf-python talking to HDF5/NetCDF-C internals. As far as runtime environment, it is exactly the same except for that libnetcdf version. Build environment...might be a different story. I suppose the logs for those are long gone though.

rouault commented 1 year ago

so I am wondering if it's a random upgrade in the environment that is causing this.

From my manual testing, it is clearly the nompi_h5902ca5_107 --> nompi_h624ddae_108 upgrade. Manual installation of 107 results in OK behaviour. Manual installation in 108 results in hangs, both when reading or writing with GDAL utilities. Interstingly the ncdump and ncgen utilities don't seem to be affected

djhoese commented 1 year ago

@zklaus Got my python script down to this:

def test_netcdf4_python():
    from netCDF4 import Dataset
    nc = Dataset("test_netcdf4_python.nc", mode="w")
    nc.close()

I threw the .close() conditionally in my own tests expected a closed file to not hang, but 3 minutes of running this script in my CI and I think it is safe to say it is hanging. I'll try removing some dependencies from the environment to triple check that it isn't some weird conflict with some other library. I'm hoping the above netcdf4-python code translates easily to C/C++.

zklaus commented 1 year ago

Thanks, @djhoese, that's a nice and compact test! I have plugged your earlier test into the recipe in #183, but curiously, the tests seem not to be run on Windows?! Does anyone know what's up with that? I note that there is a run_test.sh script, but no run_test.bat, but the tests are in the meta.yaml anyways.

ocefpaf commented 1 year ago

@zklaus should we mark the Windows builds >=107 as broken until we figure this out? I can do that if you all agree.

rouault commented 1 year ago

should we mark the Windows builds >=107 as broken

should be: >= 108 . 107 is fine

dopplershift commented 1 year ago

Heads up @WardF

DennisHeimbigner commented 1 year ago

Is there any chance someone can do the following:

  1. rebuild netcdf-c with logging enabled.
  2. export NETCDF_LOG_LEVEL=15
  3. run the python test program.

Warning, the trace output may be voluminous.

djhoese commented 1 year ago

If someone can tell me how to compile my little C program above with conda-forge's preferred compilers and just the command line (something I can put into CI) we may be able to reduce the amount of output by a lot assuming the test C program triggers the same hanging issue.

zklaus commented 1 year ago

Is there any chance someone can do the following:

I tried to do this now in #185. Let me know what you think!

zklaus commented 1 year ago

Just to let everyone know, I will be on vacation from tomorrow until 23. August. Feel free to take over my branches and to play around.

xylar commented 1 year ago

I'm afraid I don't have the skills needed to make headway on this. But it seems to be jamming up our ability to migrate to new hdf5, so it would be great if we can make some progress on it. Since @zklaus is still on vacation, is there anyone else with the necessary skills available?

WardF commented 1 year ago

I'm taking a look at this so that we can hopefully figure out why simply enabling the ncZarr S3 support would cause any hangs, particularly on Windows. Thanks all for the diagnostic work put in and, more importantly, your patience. I'll try to convert the python script above to a C program I can work with in Windows.

WardF commented 1 year ago

As somebody who doesn't use Python for their day-to-day work 😅, is there any chance I might be able to get an environments.yml file for the environment you use to replicate this issue, @djhoese? This will bootstrap my efforts to replicate this in Python, before I start trying to replicate it in C. Thanks :).

dopplershift commented 1 year ago

I think you could replicate with:

conda create -n bad python=3.11 netcdf4
conda install -n bad -c conda-forge/label/broken libnetcdf=4.9.2=nompi_h624ddae_109
djhoese commented 1 year ago

@WardF Note the smaller example code in this comment:

https://github.com/conda-forge/libnetcdf-feedstock/issues/182#issuecomment-1643931549

This should mean your environment can be created with only netcdf4 as the requested package. That should pull in libnetcdf (this C library) and python itself. Actually I'll just paste the script here too:

def test_netcdf4_python():
    from netCDF4 import Dataset
    nc = Dataset("test_netcdf4_python.nc", mode="w")
    nc.close()

test_netcdf4_python()

Edit: Added the actual call of the function.

DennisHeimbigner commented 1 year ago

Is there any chance someone can do the following:

I tried to do this now in #185. Let me know what you think!

This appears to not produce anything, so it is not what I need.

WardF commented 1 year ago

@WardF Note the smaller example code in this comment:

#182 (comment)

This should mean your environment can be created with only netcdf4 as the requested package. That should pull in libnetcdf (this C library) and python itself. Actually I'll just paste the script here too:

def test_netcdf4_python():
    from netCDF4 import Dataset
    nc = Dataset("test_netcdf4_python.nc", mode="w")
    nc.close()

test_netcdf4_python()

Edit: Added the actual call of the function.

Thanks!

dopplershift commented 1 year ago

@DennisHeimbigner The log rotated off since it's been a month. I tried to get CI to re-run but failed. Might be best to see if @WardF can reproduce locally.

DennisHeimbigner commented 1 year ago

We (Ward and I) really need to see the configure options used to create libnetcdf.

xylar commented 1 year ago

I made a dummy PR: https://github.com/conda-forge/libnetcdf-feedstock/pull/187 Hopefully the CI there will tell you what you need to know?

dopplershift commented 1 year ago

@DennisHeimbigner In addition to the job that @xylar posted, the build script for that job was:

mkdir %SRC_DIR%\build
cd %SRC_DIR%\build

set BUILD_TYPE=Release
:: set BUILD_TYPE=RelWithDebInfo
:: set BUILD_TYPE=Debug

rem to be filled with mpi options
set PARALLEL=""

rem manually specify hdf5 paths to work-around https://github.com/Unidata/netcdf-c/issues/1444
cmake -LAH -G "NMake Makefiles" ^
      %CMAKE_ARGS% ^
      -DCMAKE_INSTALL_PREFIX="%LIBRARY_PREFIX%" ^
      -DCMAKE_PREFIX_PATH="%LIBRARY_PREFIX%" ^
      -DCMAKE_BUILD_TYPE=%BUILD_TYPE% ^
      -DBUILD_SHARED_LIBS=ON ^
      -DBUILD_UTILITIES=ON ^
      -DENABLE_DOXYGEN=OFF ^
      -DENABLE_TESTS=ON ^
      -DENABLE_EXTERNAL_SERVER_TESTS=OFF ^
      -DENABLE_DAP=ON ^
      -DENABLE_DAP_REMOTE_TESTS=OFF ^
      -DENABLE_HDF4=ON ^
      -DENABLE_NETCDF_4=ON ^
      -DENABLE_PLUGIN_INSTALL=ON ^
      -DPLUGIN_INSTALL_DIR=YES ^
      -DENABLE_CDF5=ON ^
      -DENABLE_BYTERANGE=ON ^
      -DENABLE_NCZARR=on ^
      -DENABLE_NCZARR_ZIP=on ^
      -DENABLE_NCZARR_S3=on ^
      -DENABLE_NCZARR_S3_TESTS=off ^
      -DENABLE_S3_SDK=on ^
      -DHDF5_C_LIBRARY="%LIBRARY_LIB:\=/%/hdf5.lib" ^
      -DHDF5_HL_LIBRARY="%LIBRARY_LIB:\=/%/hdf5_hl.lib" ^
      -DHDF5_INCLUDE_DIR="%LIBRARY_INC:\=/%" ^
      -DCMAKE_C_FLAGS="-DH5_BUILT_AS_DYNAMIC_LIB" ^
      %PARALLEL% ^
      %SRC_DIR%
if errorlevel 1 exit \b 1

cmake --build . --config %BUILD_TYPE% --target install
if errorlevel 1 exit \b 1

:: We need to add some entries to PATH befo

I'll note that the only "relevant" (to my eye) changes in that PR were:

  1. Turning on S3 and Zarr
      -DENABLE_NCZARR_S3=on \
      -DENABLE_S3_SDK=on \
  2. Building/linking against the aws C++ sdk
  3. Building/linking against openssl 3
WardF commented 1 year ago

I'm able to replicate this in Python (thanks for the bootstrap, all), but the hang happens after nc.close() returns. At least, I infer that from adding a print("Finished") call after nc.close()

The following also hangs:

def test_netcdf4_python():
    from netCDF4 import Dataset
    print("Finished")

test_netcdf4_python()

It looks like the issue is a side-effect of the import statement; it doesn't block "Finished" from printing, but something, somewhere, has not yet returned (I infer). Interesting.

djhoese commented 1 year ago

@WardF Interesting. If you remove everything but the import (and dedent it) so it just looks like:

from netCDF4 import Dataset

does that also hang? I guess this would mean something not getting garbage collected properly in the python library (threads not being killed?).

WardF commented 1 year ago

@WardF Interesting. If you remove everything but the import (and dedent it) so it just looks like:

from netCDF4 import Dataset

does that also hang? I guess this would mean something not getting garbage collected properly in the python library (threads not being killed?).

It does, in fact, still hang.

image

Your supposition sounds right to me; I've just started digging into the AWS SDK documentation looking to see if there is something subtle happening that I can suss out, but if it's Python garbage collection, is that something we are able to do anything about?

I'll keep digging, and will see if I can replicate this in C, but the fact it's triggered by import is a bit of a wrinkle.

ocefpaf commented 1 year ago

I guess that, at this point, we should probably open an issue in netcdf4-python. Or at least loop them in here. I don't think the tests upstream covers those options we just enabled.

rouault commented 1 year ago

I'll keep digging, and will see if I can replicate this in C, but the fact it's triggered by import is a bit of a wrinkle.

It has likely nothing to do with python. It's definitely reproducible in C/C++ since GDAL C++ command line utilities stall on exit when opening a netcdf file

WardF commented 1 year ago

I'll keep digging, and will see if I can replicate this in C, but the fact it's triggered by import is a bit of a wrinkle.

It has likely nothing to do with python. It's definitely reproducible in C/C++ since GDAL C++ command line utilities stall on exit when opening a netcdf file

That's what makes it an interesting wrinkle; not sure what's happening in terms of the import under the hood but it isn't immediately obvious what, if anything, is happening here. I'll keep poking around at it in the meantime, but it's not as straightforward as I'd have hoped :)

DennisHeimbigner commented 1 year ago

Ward- There is an experiment you can try to see if it is aws-sdk-cpp. You will need to do the following:

  1. use the current libnetcdf master branch.
  2. use the -DENABLE_S3_INTERNAL=on (cmake) or the --enable-s3-internal (automake) option when building the the netcdf library.
  3. Run the python program to see if it still hangs.
WardF commented 1 year ago

Ward- There is an experiment you can try to see if it is aws-sdk-cpp. You will need to do the following:

  1. use the current libnetcdf master branch.
  2. use the -DENABLE_S3_INTERNAL=on (cmake) or the --enable-s3-internal (automake) option when building the the netcdf library.
  3. Run the python program to see if it still hangs.

Thanks for the tip; I'll give it a try when I replicate the python script in C. Or, if I get to the point where I need to figure out how to get Python to invoke the netcdf.dll I'm compiling :). Thanks!

WardF commented 1 year ago

I'm able to recreate a hang now in the netCDF-C tests. Interesting; it gives me a good place to start.

ocefpaf commented 1 year ago

I'm able to recreate a hang now in the netCDF-C tests. Interesting; it gives me a good place to start.

Thanks @WardF for digging into this! It is not an easy debugging for sure! (Hoping for an easy fix though ;-p)

WardF commented 1 year ago

@DennisHeimbigner I'm going to open an issue over on the Unidata/netcdf-c page. I'm seeing a hang in the first test run (tst_create_files), that turns into a thrown Exception when running under Visual Studio. Screenshot here for reference, but it appears there is an issue with what's being passed to Aws::InitAPI(ncs3options). It is strange this is only manifesting under Windows, and I haven't stepped through the entire test yet, but I wanted to make a note of things while I had it in front of me.

This obviates the Python connection (much to my relief, I'm much more at home with C/C++ XD). Thanks all for your help and patience, we'll get this sorted out.

image

WardF commented 1 year ago

I'm able to recreate a hang now in the netCDF-C tests. Interesting; it gives me a good place to start.

Thanks @WardF for digging into this! It is not an easy debugging for sure! (Hoping for an easy fix though ;-p)

Hoping it's one of those cases like the other 99%, where the difficulty is in diagnosing, but the issue is straightforward. I have to shift context for a little bit, but immediately I see that a NULL pointer is being passed as part of ncs3options. I have no reason to think that this is the issue, other than NULL pointers are a great place to start looking when you are seeing access violations. But at least we've wrestled this into a debugging environment I'm able to wring some information out of. Thanks for your patience!

xylar commented 1 year ago

Hi folks, I'm wondering at what point we decide that an easy fix is not in the cards and roll back the changes so conda-forge can move on with various migrations that are stuck because of this issue. Is there any sign that a fix is imminent?

xylar commented 1 year ago

I certainly don't mean to imply that I don't appreciate the work being done to debug this issue. Far from it! But I appreciate that it can be hard to find these issues and that we all have other demands on our time as well.

DennisHeimbigner commented 1 year ago

> I see that a NULL pointer is being passed as part of ncs3options Where are you seeing this? It should not happen. The declaration of ncs3options is: > static Aws::SDKOptions ncs3options; which is a static object (i.e. not a pointer). But if it is, then this could be the problem.

dopplershift commented 1 year ago

@xylar IMO, it's perfectly reasonable to revert and move on until this is properly fixed upstream. But I'll leave it to those who are willing to do the work of reverting (and possibly un-reverting...).

WardF commented 1 year ago

Hello all. Having popped back up the stack, I believe we may have a fix for this at the underlying C library. This was an interesting issue to try to diagnose and fix. As usual, the fix on our end (for the short term) was far easier than the effort put into figuring out what was going on in the first place.

I'm not sure immediately how to test our fix against the libnetcdf-feedstock, but it boils down thusly. On Non-Linux platforms, -DENABLE_S3=TRUE needs to be paired with -DENABLE_S3_INTERNAL=TRUE. This is true for MacOS as well as Windows. For whatever reason, we are observing hangs when linking against the AWS C++ SDK on these platforms. I've been able to confirm, at least, that these issues are not specific to netCDF. But they are also not universal. Maddening, and we will get it sorted out. In the meantime, @DennisHeimbigner showed foresight in his implementation of an internal S3 interface layer.

Other PR's and issues have cropped up while I was focused on this, but I will be triaging and patching ASAP so that we might get a v4.9.3 release out.

zklaus commented 1 year ago

Thanks @WardF, that's exciting :). I am trying it out in #185. Just to confirm, that means we should have -DENABLE_S3_SDK=FALSE as well, right?

zklaus commented 1 year ago

Hm. Unfortunately, it does not seem to work.