NetBSD Problem Report #54549

From www@netbsd.org  Mon Sep 16 10:11:52 2019
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id B24487A149
	for <gnats-bugs@gnats.NetBSD.org>; Mon, 16 Sep 2019 10:11:52 +0000 (UTC)
Message-Id: <20190916101151.665B07A1D6@mollari.NetBSD.org>
Date: Mon, 16 Sep 2019 10:11:51 +0000 (UTC)
From: ng0@n0.is
Reply-To: ng0@n0.is
To: gnats-bugs@NetBSD.org
Subject: sys/modules/exec_elf32 from 10 hours ago fails to build with clang
X-Send-Pr-Version: www-1.0

>Number:         54549
>Category:       misc
>Synopsis:       sys/modules/exec_elf32 from 10 hours ago fails to build with clang
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    misc-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Sep 16 10:15:01 +0000 2019
>Closed-Date:    Tue Sep 24 16:52:26 +0000 2019
>Last-Modified:  Tue Sep 24 16:52:26 +0000 2019
>Originator:     ng0
>Release:        current, ~1 AM CET
>Organization:
>Environment:
NetBSD uptimegirl 9.99.10 NetBSD 9.99.10 (GENERIC) amd64

>Description:
In file included from /usr/src/sys/kern/exec_elf32.c:39:
/usr/src/sys/kern/exec_elf.c:229:7: error: variable 'execname' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized]
                if (path[0] == '/' && path[1] != '\0') {
                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/src/sys/kern/exec_elf.c:248:6: note: uninitialized use occurs here
        if (execname) {
            ^~~~~~~~
/usr/src/sys/kern/exec_elf.c:229:3: note: remove the 'if' if its condition is always true
                if (path[0] == '/' && path[1] != '\0') {
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/src/sys/kern/exec_elf.c:229:7: error: variable 'execname' is used uninitialized whenever '&&' condition is false [-Werror,-Wsometimes-uninitialized]
                if (path[0] == '/' && path[1] != '\0') {
                    ^~~~~~~~~~~~~~
/usr/src/sys/kern/exec_elf.c:248:6: note: uninitialized use occurs here
        if (execname) {
            ^~~~~~~~
/usr/src/sys/kern/exec_elf.c:229:7: note: remove the '&&' if its condition is always true
                if (path[0] == '/' && path[1] != '\0') {
                    ^~~~~~~~~~~~~~~~~
/usr/src/sys/kern/exec_elf.c:158:44: note: initialize the variable 'execname' to silence this warning
        AuxInfo ai[ELF_AUX_ENTRIES], *a, *execname;
                                                  ^
                                                   = NULL
2 errors generated.

*** Failed target:  exec_elf32.o
*** Failed command: /usr/src/../tools/bin/x86_64--netbsd-clang -O2 -g -std=gnu99 -Wno-sign-compare -Wno-pointer-sign -Wall -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wno-sign-compare -Wreturn-type -Wswitch -Wshadow -Wcast-qual -Wwrite-strings -Wextra -Wno-unused-parameter -Wno-sign-compare -Werror -Wno-error=address-of-packed-member -Wno-error=constant-conversion -ffreestanding -fno-strict-aliasing -Wno-pointer-sign -mno-red-zone -mno-mmx -mno-sse -mno-avx -msoft-float -mcmodel=kernel -fno-omit-frame-pointer -I/usr/src/common/include -DDIAGNOSTIC --sysroot=/usr/src/../obj/destdir.amd64 -DEXEC_ELF32 -DCOREDUMP -DPAX_ASLR -I/usr/src/common/include -DDIAGNOSTIC -nostdinc -I. -I/usr/src/sys/modules/exec_elf32 -isystem /usr/src/sys -isystem /usr/src/sys/arch -isystem /usr/src/sys/../common/include -D_KERNEL -D_LKM -D_MODULE -DSYSCTL_INCLUDE_DESCR -c /usr/src/sys/kern/exec_elf32.c
*** Error code 1

Stop.
nbmake[7]: stopped in /usr/src/sys/modules/exec_elf32

*** Failed target:  dependall
*** Failed command: cd "/usr/src/sys/modules/exec_elf32"; /usr/src/../tools/bin/nbmake realall
*** Error code 1

Stop.
nbmake[6]: stopped in /usr/src/sys/modules/exec_elf32

*** Failed target:  dependall-exec_elf32
*** Failed command: _makedirtarget() { dir="$1"; shift; target="$1"; shift; case "${dir}" in /*) this="${dir}/"; real="${dir}" ;; .) this="sys/modules/"; real="/usr/src/sys/modules" ;; *) this="sys/modules/${dir}/"; real="/usr/src/sys/modules/${dir}" ;; esac; show=${this:-.}; echo "${target} ===> ${show%/}${1:+ (with: $@)}"; cd "${real}" && /usr/src/../tools/bin/nbmake _THISDIR_="${this}" "$@" ${target}; }; _makedirtarget exec_elf32 dependall
*** Error code 1

Stop.
nbmake[5]: stopped in /usr/src/sys/modules

*** Failed target:  dependall-modules
*** Failed command: _makedirtarget() { dir="$1"; shift; target="$1"; shift; case "${dir}" in /*) this="${dir}/"; real="${dir}" ;; .) this="sys/"; real="/usr/src/sys" ;; *) this="sys/${dir}/"; real="/usr/src/sys/${dir}" ;; esac; show=${this:-.}; echo "${target} ===> ${show%/}${1:+ (with: $@)}"; cd "${real}" && /usr/src/../tools/bin/nbmake _THISDIR_="${this}" "$@" ${target}; }; _makedirtarget modules dependall
*** Error code 1

Stop.
nbmake[4]: stopped in /usr/src/sys

*** Failed target:  dependall-sys
*** Failed command: _makedirtarget() { dir="$1"; shift; target="$1"; shift; case "${dir}" in /*) this="${dir}/"; real="${dir}" ;; .) this=""; real="/usr/src" ;; *) this="${dir}/"; real="/usr/src/${dir}" ;; esac; show=${this:-.}; echo "${target} ===> ${show%/}${1:+ (with: $@)}"; cd "${real}" && /usr/src/../tools/bin/nbmake _THISDIR_="${this}" "$@" ${target}; }; _makedirtarget sys dependall
*** Error code 1

Stop.
nbmake[3]: stopped in /usr/src

*** Failed target:  do-build
*** Failed command: _makedirtarget() { dir="$1"; shift; target="$1"; shift; case "${dir}" in /*) this="${dir}/"; real="${dir}" ;; .) this=""; real="/usr/src" ;; *) this="${dir}/"; real="/usr/src/${dir}" ;; esac; show=${this:-.}; echo "${target} ===> ${show%/}${1:+ (with: $@)}"; cd "${real}" && /usr/src/../tools/bin/nbmake _THISDIR_="${this}" "$@" ${target}; }; _makedirtarget . dependall BUILD_tools=no BUILD_lib=no
*** Error code 1

Stop.
nbmake[2]: stopped in /usr/src

*** Failed target:  build
*** Failed command: _makedirtarget() { dir="$1"; shift; target="$1"; shift; case "${dir}" in /*) this="${dir}/"; real="${dir}" ;; .) this=""; real="/usr/src" ;; *) this="${dir}/"; real="/usr/src/${dir}" ;; esac; show=${this:-.}; echo "${target} ===> ${show%/}${1:+ (with: $@)}"; cd "${real}" && /usr/src/../tools/bin/nbmake _THISDIR_="${this}" "$@" ${target}; }; _makedirtarget . do-build
*** Error code 1

Stop.
nbmake[1]: stopped in /usr/src

*** Failed target:  distribution
*** Failed command: _makedirtarget() { dir="$1"; shift; target="$1"; shift; case "${dir}" in /*) this="${dir}/"; real="${dir}" ;; .) this=""; real="/usr/src" ;; *) this="${dir}/"; real="/usr/src/${dir}" ;; esac; show=${this:-.}; echo "${target} ===> ${show%/}${1:+ (with: $@)}"; cd "${real}" && /usr/src/../tools/bin/nbmake _THISDIR_="${this}" "$@" ${target}; }; _makedirtarget . build NOPOSTINSTALL=1
*** Error code 1

Stop.
nbmake: stopped in /usr/src

ERROR: Failed to make distribution
*** BUILD ABORTED ***

>How-To-Repeat:

>Fix:

>Release-Note:

>Audit-Trail:
From: "Christos Zoulas" <christos@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/54549 CVS commit: src/sys/kern
Date: Mon, 16 Sep 2019 07:11:34 -0400

 Module Name:	src
 Committed By:	christos
 Date:		Mon Sep 16 11:11:34 UTC 2019

 Modified Files:
 	src/sys/kern: exec_elf.c

 Log Message:
 PR/54549: ng0: always initialize execname.


 To generate a diff of this commit:
 cvs rdiff -u -r1.99 -r1.100 src/sys/kern/exec_elf.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->closed
State-Changed-By: snj@NetBSD.org
State-Changed-When: Tue, 24 Sep 2019 16:52:26 +0000
State-Changed-Why:
xtos fixed this


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.43 2018/01/16 07:36:43 maya Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2017 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.