netcdf-c: nc_test fails when optimization greater than -O0 is invoked.

A failure in nc_test/nc_test was initially reported on the ppc64le platform as part of the tests for conda-forge/libnetcdf-feedstock release of 4.8.0. Subsequent testing has revealed an issue with some, but not all, compilers. More details to follow, opening an issue to capture this.

Update 1

Issue has been observed on M1 hardware, both in OSX, and emulated ppc64le (via qemu). Issue does not manifest on M1 hardware in virtualized ubuntu, or on intel-based OSX. I’ll update with compiler versions (which is a big piece of the puzzle).

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 17 (14 by maintainers)

Commits related to this issue

Most upvoted comments

Thanks to the renewed interest, some additional info/reading provided by @dopplershift, and an expanded knowledge of -fsanitize, I think we have a fix for this. It also looks like we have a lot of additional work to do cleaning up some operations that are undefined, but consistent. But first things first. I’ll be testing the potential fix for this shortly.

Some relevant build env information from over there. Host env:

    _libgcc_mutex:   0.1-conda_forge                conda-forge
    _openmp_mutex:   4.5-1_gnu                      conda-forge
    bzip2:           1.0.8-h4e0d66e_4               conda-forge
    c-ares:          1.17.1-h4e0d66e_1              conda-forge
    ca-certificates: 2020.12.5-h1084571_0           conda-forge
    curl:            7.76.0-h86bdb50_0              conda-forge
    hdf4:            4.2.13-h9a582f1_3              defaults   
    hdf5:            1.10.6-mpi_mpich_h588be55_1014 conda-forge
    jpeg:            9d-h339bb43_0                  conda-forge
    krb5:            1.17.2-h2004cfc_0              conda-forge
    libcurl:         7.76.0-hf726fd8_0              conda-forge
    libedit:         3.1.20191231-h41a240f_2        conda-forge
    libev:           4.33-h6eb9509_1                conda-forge
    libgcc-ng:       9.3.0-hc7a5eb4_18              conda-forge
    libgfortran-ng:  9.3.0-hb3da1e1_18              conda-forge
    libgfortran5:    9.3.0-hb3da1e1_18              conda-forge
    libgomp:         9.3.0-hc7a5eb4_18              conda-forge
    libnghttp2:      1.43.0-h42039ad_0              conda-forge
    libssh2:         1.9.0-ha5a9321_6               conda-forge
    libstdcxx-ng:    9.3.0-h22bc1b8_18              conda-forge
    mpi:             1.0-mpich                      conda-forge
    mpich:           3.4.1-hb1f5ef7_104             conda-forge
    ncurses:         6.2-hea85c5d_4                 conda-forge
    openssl:         1.1.1k-h4e0d66e_0              conda-forge
    tk:              8.6.10-h38e1d09_1              conda-forge
    zlib:            1.2.11-h6eb9509_1010           conda-forge

Build env:

    _libgcc_mutex:                 0.1-conda_forge         conda-forge
    _openmp_mutex:                 4.5-1_gnu               conda-forge
    binutils_impl_linux-ppc64le:   2.35.1-h5836da8_2       conda-forge
    binutils_linux-ppc64le:        2.35-hcfcb53e_30        conda-forge
    bzip2:                         1.0.8-h4e0d66e_4        conda-forge
    c-ares:                        1.17.1-h4e0d66e_1       conda-forge
    ca-certificates:               2020.12.5-h1084571_0    conda-forge
    cmake:                         3.20.1-hf140c13_0       conda-forge
    expat:                         2.3.0-h3b9df90_0        conda-forge
    gcc_impl_linux-ppc64le:        9.3.0-ha8fcf76_18       conda-forge
    gcc_linux-ppc64le:             9.3.0-h2662597_30       conda-forge
    gxx_impl_linux-ppc64le:        9.3.0-h6db6fac_18       conda-forge
    gxx_linux-ppc64le:             9.3.0-hdc9eec7_30       conda-forge
    kernel-headers_linux-ppc64le:  3.10.0-hbe0c576_10      conda-forge
    krb5:                          1.17.2-h2004cfc_0       conda-forge
    ld_impl_linux-ppc64le:         2.35.1-ha35d02b_2       conda-forge
    libcurl:                       7.76.0-hf726fd8_0       conda-forge
    libedit:                       3.1.20191231-h41a240f_2 conda-forge
    libev:                         4.33-h6eb9509_1         conda-forge
    libgcc-devel_linux-ppc64le:    9.3.0-h9f60fdd_18       conda-forge
    libgcc-ng:                     9.3.0-hc7a5eb4_18       conda-forge
    libgomp:                       9.3.0-hc7a5eb4_18       conda-forge
    libnghttp2:                    1.43.0-h42039ad_0       conda-forge
    libssh2:                       1.9.0-ha5a9321_6        conda-forge
    libstdcxx-devel_linux-ppc64le: 9.3.0-h7901c9a_18       conda-forge
    libstdcxx-ng:                  9.3.0-h22bc1b8_18       conda-forge
    libuv:                         1.41.0-h4e0d66e_0       conda-forge
    lz4-c:                         1.9.3-h3b9df90_0        conda-forge
    make:                          4.3-hf817498_1          conda-forge
    ncurses:                       6.2-hea85c5d_4          conda-forge
    openssl:                       1.1.1k-h4e0d66e_0       conda-forge
    pkg-config:                    0.29.2-h339bb43_1008    conda-forge
    rhash:                         1.4.1-h4e0d66e_0        conda-forge
    sysroot_linux-ppc64le:         2.17-h8b29623_10        conda-forge
    tk:                            8.6.10-h38e1d09_1       conda-forge
    xz:                            5.2.5-h6eb9509_1        conda-forge
    zlib:                          1.2.11-h6eb9509_1010    conda-forge
    zstd:                          1.4.9-h65c4b1a_0        conda-forge

I can confirm that replacing -O3 with -O0 over in conda-forge/libnetcdf-feedstock#119 allowed the failing test to pass.