Description of problem: We build our package (nss) with -Werror=maybe-uninitialized, but only on s390x, the warning is issued. Conceptually, the relevant code is something like: ``` int value; [...] parseNextCmdInput(extKeyUsageKeyWordArray, &value, &nextPos, &isCriticalExt); /* assign value */ [...] keyUsage |= (0x80 >> value); /* 'value' may be used uninitialized in this function [-Werror=maybe-uninitialized] */ ``` though there are some indirections with functions and macros. Version-Release number of selected component (if applicable): 10.0.1-0.7.fc32 How reproducible: 100% Steps to Reproduce: 1. fedpkg clone nss 2. cd nss 3. fedpkg scratch-build --arches s390x Actual results: build error Expected results: build succeeds Additional info: The complete log around the failure: ``` cc -o Linux5.4_s390x_cc_glibc_PTH_64_OPT.OBJ/certext.o -c -std=c99 -O2 -fPIC -pipe -ffunction-sections -fdata-sections -DHAVE_STRERROR -DLINUX -Dlinux -Wall -Wshadow -Werror -DXP_UNIX -DNSPR20 -UDEBUG -DNDEBUG -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_POSIX_SOURCE -D_REENTRANT -DUSE_UTIL_DIRECTLY -DNO_NSPR_10_SUPPORT -DSSL_DISABLE_DEPRECATED_CIPHER_SUITE_NAMES -I/usr/include/nspr4 -iquote ../../../dist/Linux5.4_s390x_cc_glibc_PTH_64_OPT.OBJ/../public/nss -iquote ../../../dist/Linux5.4_s390x_cc_glibc_PTH_64_OPT.OBJ/../private/nss -I../../../dist/Linux5.4_s390x_cc_glibc_PTH_64_OPT.OBJ/include -I../../../dist/public/nss -I../../../dist/private/nss -I../../../dist/public/dbm -I../../../dist/public/seccmd -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=zEC12 -mtune=z13 -fasynchronous-unwind-tables -fstack-clash-protection certext.c certext.c: In function 'AddExtKeyUsage': certext.c:513:9: error: 'value' may be used uninitialized in this function [-Werror=maybe-uninitialized] 513 | int value; | ^~~~~ certext.c: In function 'AddExtensions': certext.c:706:31: error: 'value' may be used uninitialized in this function [-Werror=maybe-uninitialized] 706 | keyUsage |= (0x80 >> value); | ~~~~~~^~~~~~~~~ certext.c:667:9: note: 'value' was declared here 667 | int value; | ^~~~~ certext.c:368:31: error: 'value' may be used uninitialized in this function [-Werror=maybe-uninitialized] 368 | keyUsage |= (0x80 >> value); | ~~~~~~^~~~~~~~~ certext.c:330:9: note: 'value' was declared here 330 | int value; | ^~~~~ cc1: all warnings being treated as errors ```
Created attachment 1663107 [details] preprocessed source
Umm, the preprocessed source is for pkix_list.c, but the bug complains about certext.c. Did you get the right file Dan?
Created attachment 1664703 [details] preprocessed source Aha, I see, there were multiple "maybe-uninitialized" issues. Attaching the right file now :-)
For the record, the original attachment failed with cc -o Linux5.6_s390x_cc_glibc_PTH_64_OPT.OBJ/pkix_list.o -c -std=c99 -O2 -fPIC -pipe -ffunction-sections -fdata-sections -DHAVE_STRERROR -DLINUX -Dlinux -Wall -Wshadow -Werror -DXP_UNIX -UDEBUG -DNDEBUG -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_POSIX_SOURCE -D_REENTRANT -DUSE_UTIL_DIRECTLY -DNO_NSPR_10_SUPPORT -DSSL_DISABLE_DEPRECATED_CIPHER_SUITE_NAMES -I/usr/include/nspr4 -iquote ../../../../../dist/Linux5.6_s390x_cc_glibc_PTH_64_OPT.OBJ/../public/nss -iquote ../../../../../dist/Linux5.6_s390x_cc_glibc_PTH_64_OPT.OBJ/../private/nss -I../../../../../dist/Linux5.6_s390x_cc_glibc_PTH_64_OPT.OBJ/include -I../../../../../dist/public/nss -I../../../../../dist/private/nss -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=zEC12 -mtune=z13 -fasynchronous-unwind-tables -fstack-clash-protection pkix_list.c In file included from pkix_list.h:14, from pkix_list.c:11: pkix_list.c: In function 'PKIX_List_SetItem': pkix_tools.h:255:10: error: 'element' may be used uninitialized in this function [-Werror=maybe-uninitialized] 255 | obj = NULL; \ | ^ pkix_list.c:1538:20: note: 'element' was declared here 1538 | PKIX_List *element; | ^~~~~~~ cc1: all warnings being treated as errors there was a workaround applied as a patch (https://src.fedoraproject.org/rpms/nss/blob/37c40ebd3db65bdc34bd7cdeb29181b98db18b40/f/nss-libpkix-maybe-uninitialized.patch), but later removed. Maybe this is also a false-positive.
This bug appears to have been reported against 'rawhide' during the Fedora 33 development cycle. Changing version to 33.
This message is a reminder that Fedora 33 is nearing its end of life. Fedora will stop maintaining and issuing updates for Fedora 33 on 2021-11-30. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as EOL if it remains open with a Fedora 'version' of '33'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version. Thank you for reporting this issue and we are sorry that we were not able to fix it before Fedora 33 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora, you are encouraged change the 'version' to a later Fedora version prior this bug is closed as described in the policy above. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete.
Fedora 33 changed to end-of-life (EOL) status on 2021-11-30. Fedora 33 is no longer maintained, which means that it will not receive any further security or bug fix updates. As a result we are closing this bug. If you can reproduce this bug against a currently maintained version of Fedora please feel free to reopen this bug against that version. If you are unable to reopen this bug, please file a new report against the current release. If you experience problems, please add a comment to this bug. Thank you for reporting this bug and we are sorry it could not be fixed.