Bug 1279945 - Errors when rebuilding with address sanitizer (-fsanitize=address)
Errors when rebuilding with address sanitizer (-fsanitize=address)
Status: CLOSED CANTFIX
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: qemu-kvm (Show other bugs)
7.2
Unspecified Unspecified
unspecified Severity unspecified
: pre-dev-freeze
: ---
Assigned To: Miroslav Rezanina
Virtualization Bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-11-10 09:50 EST by David Jaša
Modified: 2016-08-22 18:52 EDT (History)
8 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-08-22 18:52:47 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description David Jaša 2015-11-10 09:50:37 EST
Description of problem:
When trying to rebuild with address sanitizer, this warnings stops the build:
----
$HOME/rpmbuild/BUILD/qemu-2.3.0/hw/i386/acpi-build.c: In function 'build_append_pci_bus_devices':
$HOME/rpmbuild/BUILD/qemu-2.3.0/hw/i386/acpi-build.c:571:48: error: 'notify_method' may be used uninitialized in this function [-Werror=maybe-uninitialized]
                 build_append_pcihp_notify_entry(notify_method, slot);
                                                ^
cc1: all warnings being treated as errors
----

so I added -Wno-error=maybe-uninitialized to %optflags and I got one more warning that does not interrupt the build anymore (the build subsequently fails in "make check" phase)

----
----
x86/vmx_tests.c: In function 'dbgctls_main':
x86/vmx_tests.c:1335:11: warning: variable 'debugctl' set but not used [-Wunused-but-set-variable]
  u64 dr7, debugctl;
           ^
----


Version-Release number of selected component (if applicable):
qemu-kvm-rhev-2.3.0-31.el7_2.1
libasan-4.8.5-4.el7.x86_64


How reproducible:
always

Steps to Reproduce:
1. grab qemu-kvm-rhev SRPM, modify its .spec file by adding these lines to %build section, rebuild:
# sanitizer, disable -debug pkg
%global optflags %(echo %{optflags} | sed 's/ -g / -ggdb -fno-omit-frame-pointer -fsanitize=address /')
%global __global_ldflags %(echo "%{__global_ldflags} -fsanitize=address")
%global debug_package %{nil}

Actual results:
build fails with error specified in Description

Expected results:
if the notify_method is indeed uninitialized, the problem should be fixed

Additional info:
Comment 4 Miroslav Rezanina 2016-06-29 04:55:05 EDT
(In reply to David Jaša from comment #0)
> Description of problem:
> When trying to rebuild with address sanitizer, this warnings stops the build:
> ----
> $HOME/rpmbuild/BUILD/qemu-2.3.0/hw/i386/acpi-build.c: In function
> 'build_append_pci_bus_devices':
> $HOME/rpmbuild/BUILD/qemu-2.3.0/hw/i386/acpi-build.c:571:48: error:
> 'notify_method' may be used uninitialized in this function
> [-Werror=maybe-uninitialized]
>                  build_append_pcihp_notify_entry(notify_method, slot);
>                                                 ^
> cc1: all warnings being treated as errors
> ----

notify_method is initialized in case build_append_pcihp_notify_entry is called. This is false positive. 

> 
> so I added -Wno-error=maybe-uninitialized to %optflags and I got one more
> warning that does not interrupt the build anymore (the build subsequently
> fails in "make check" phase)
> 
> ----
> ----
> x86/vmx_tests.c: In function 'dbgctls_main':
> x86/vmx_tests.c:1335:11: warning: variable 'debugctl' set but not used
> [-Wunused-but-set-variable]
>   u64 dr7, debugctl;
>            ^
> ----

Strange, I can't see this file/function in repository.
Comment 6 Miroslav Rezanina 2016-08-22 18:52:47 EDT
As first error is false positive and second can't be located in latest code closing the BZ.

Note You need to log in before you can comment on or make changes to this bug.