Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 827042

Summary: sci-libs/netcdf-4.7.4: nc_test fails when optimization level is -O2
Product: Gentoo Linux Reporter: Alex Fan <alex.fan.q>
Component: Current packagesAssignee: Gentoo Science Related Packages <sci>
Status: CONFIRMED ---    
Severity: normal CC: jstein, sam
Priority: Normal Keywords: TESTFAILURE
Version: unspecified   
Hardware: riscv   
OS: Linux   
URL: https://github.com/Unidata/netcdf-c/issues/1983
See Also: https://github.com/Unidata/netcdf-c/pull/2050
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 807721    
Attachments: emerge --info
LastTest.log
build log

Description Alex Fan archtester 2021-11-24 07:52:42 UTC
happens on Sifive Unmatched (riscv64 lp64d). This seems only due to strict aliasing in gcc11. Aarch64 and ppc64le also have report of this issue from other distros, but I was not able to test them on Gentoo.

Appending -fno-strict-aliasing can fix the problem.

...
*** testing nc_get_var_uchar ... 
	FAILURE at line 1485 of /var/tmp/portage/sci-libs/netcdf-4.7.4/work/netcdf-c-4.7.4/nc_test/test_get.c: expecting NC_ERANGE but got NC_NOERR
	FAILURE at line 1485 of /var/tmp/portage/sci-libs/netcdf-4.7.4/work/netcdf-c-4.7.4/nc_test/test_get.c: expecting NC_ERANGE but got NC_NOERR
	FAILURE at line 1485 of /var/tmp/portage/sci-libs/netcdf-4.7.4/work/netcdf-c-4.7.4/nc_test/test_get.c: expecting NC_ERANGE but got NC_NOERR
	FAILURE at line 1485 of /var/tmp/portage/sci-libs/netcdf-4.7.4/work/netcdf-c-4.7.4/nc_test/test_get.c: expecting NC_ERANGE but got NC_NOERR
	FAILURE at line 1485 of /var/tmp/portage/sci-libs/netcdf-4.7.4/work/netcdf-c-4.7.4/nc_test/test_get.c: expecting NC_ERANGE but got NC_NOERR
	FAILURE at line 1485 of /var/tmp/portage/sci-libs/netcdf-4.7.4/work/netcdf-c-4.7.4/nc_test/test_get.c: expecting NC_ERANGE but got NC_NOERR
	FAILURE at line 1485 of /var/tmp/portage/sci-libs/netcdf-4.7.4/work/netcdf-c-4.7.4/nc_test/test_get.c: expecting NC_ERANGE but got NC_NOERR
	FAILURE at line 1485 of /var/tmp/portage/sci-libs/netcdf-4.7.4/work/netcdf-c-4.7.4/nc_test/test_get.c: expecting NC_ERANGE but got NC_NOERR
	### 20 FAILURES TESTING nc_get_var_uchar! ###
*** testing nc_get_var_schar ... 
	FAILURE at line 1612 of /var/tmp/portage/sci-libs/netcdf-4.7.4/work/netcdf-c-4.7.4/nc_test/test_get.c: value read not that expected
	FAILURE at line 1599 of /var/tmp/portage/sci-libs/netcdf-4.7.4/work/netcdf-c-4.7.4/nc_test/test_get.c: expecting NC_ERANGE but got NC_NOERR
	FAILURE at line 1599 of /var/tmp/portage/sci-libs/netcdf-4.7.4/work/netcdf-c-4.7.4/nc_test/test_get.c: expecting NC_ERANGE but got NC_NOERR
	FAILURE at line 1599 of /var/tmp/portage/sci-libs/netcdf-4.7.4/work/netcdf-c-4.7.4/nc_test/test_get.c: expecting NC_ERANGE but got NC_NOERR
	FAILURE at line 1599 of /var/tmp/portage/sci-libs/netcdf-4.7.4/work/netcdf-c-4.7.4/nc_test/test_get.c: expecting NC_ERANGE but got NC_NOERR
	FAILURE at line 1599 of /var/tmp/portage/sci-libs/netcdf-4.7.4/work/netcdf-c-4.7.4/nc_test/test_get.c: expecting NC_ERANGE but got NC_NOERR
	FAILURE at line 1599 of /var/tmp/portage/sci-libs/netcdf-4.7.4/work/netcdf-c-4.7.4/nc_test/test_get.c: expecting NC_ERANGE but got NC_NOERR
	FAILURE at line 1599 of /var/tmp/portage/sci-libs/netcdf-4.7.4/work/netcdf-c-4.7.4/nc_test/test_get.c: expecting NC_ERANGE but got NC_NOERR
...
Comment 1 Alex Fan archtester 2021-11-24 07:53:07 UTC
Created attachment 755798 [details]
emerge --info
Comment 2 Alex Fan archtester 2021-11-24 07:53:33 UTC
Created attachment 755802 [details]
LastTest.log
Comment 3 Alex Fan archtester 2021-11-24 07:53:51 UTC
Created attachment 755806 [details]
build log
Comment 4 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-11-25 00:30:32 UTC
Let's build it without strict aliasing for now.
Comment 5 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-11-25 00:33:25 UTC
(In reply to Sam James from comment #4)
> Let's build it without strict aliasing for now.

From a63978b50b3fd36bf8198a9823cbe1f1a9e467b6 Mon Sep 17 00:00:00 2001
From: Sam James <sam@gentoo.org>
Date: Thu, 25 Nov 2021 00:31:31 +0000
Subject: [PATCH] sci-libs/netcdf: disable strict aliasing for now

Causes test failures.

Bug: https://bugs.gentoo.org/827042
Signed-off-by: Sam James <sam@gentoo.org>
---
 sci-libs/netcdf/netcdf-4.7.4.ebuild | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)