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

Bug 639116

Summary: dev-db/cpp-driver-2.7.1 : /.../buffer.hpp:199:16: error: *((void*)(&<anonymous>)+8).cass::Buffer::data_.cass::Buffer::<unnamed union>::buffer may be used uninitialized in this function [-Werror=maybe-uninitialized]
Product: Gentoo Linux Reporter: Toralf Förster <toralf>
Component: Current packagesAssignee: Geaaru <geaaru>
Status: RESOLVED FIXED    
Severity: normal CC: proxy-maint
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: emerge-info.txt
dev-db:cpp-driver-2.7.1:20171128-213453.log
emerge-history.txt
environment
etc.portage.tbz2
logs.tbz2
temp.tbz2

Description Toralf Förster gentoo-dev 2017-11-28 21:46:02 UTC
                 from /var/tmp/portage/dev-db/cpp-driver-2.7.1/work/cpp-driver-2.7.1/src/abstract_data.cpp:17:
/var/tmp/portage/dev-db/cpp-driver-2.7.1/work/cpp-driver-2.7.1/src/buffer.hpp: In member function ‘CassError cass::AbstractData::set(size_t, const cass::Tuple*)’:
/var/tmp/portage/dev-db/cpp-driver-2.7.1/work/cpp-driver-2.7.1/src/buffer.hpp:199:16: error: ‘*((void*)(&<anonymous>)+8).cass::Buffer::data_.cass::Buffer::<unnamed union>::buffer’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
     RefBuffer* temp = data_.buffer;
                ^~~~
/var/tmp/portage/dev-db/cpp-driver-2.7.1/work/cpp-driver-2.7.1/src/buffer.hpp: In member function ‘CassError cass::AbstractData::set(size_t, const cass::UserTypeValue*)’:

  -------------------------------------------------------------------

  This is an unstable amd64 chroot image at a tinderbox (==build bot)
  name: 17.0-desktop-plasma-systemd_libressl_20171126-113239

  -------------------------------------------------------------------

gcc-config -l:
 [1] x86_64-pc-linux-gnu-7.2.0 *

Available Python interpreters, in order of preference:
  [1]   python3.4
  [2]   python3.5 (fallback)
  [3]   python2.7 (fallback)
Available Ruby profiles:
  [1]   ruby22 (with Rubygems) *
java-config:
The following VMs are available for generation-2:
*)	IcedTea JDK 3.6.0 [icedtea-bin-8]
Available Java Virtual Machines:
  [1]   icedtea-bin-8  system-vm

emerge -qpv dev-db/cpp-driver
[ebuild  N    ] dev-db/cpp-driver-2.7.1  USE="libressl ssl"
Comment 1 Toralf Förster gentoo-dev 2017-11-28 21:46:04 UTC
Created attachment 507026 [details]
emerge-info.txt
Comment 2 Toralf Förster gentoo-dev 2017-11-28 21:46:07 UTC
Created attachment 507028 [details]
dev-db:cpp-driver-2.7.1:20171128-213453.log
Comment 3 Toralf Förster gentoo-dev 2017-11-28 21:46:10 UTC
Created attachment 507030 [details]
emerge-history.txt
Comment 4 Toralf Förster gentoo-dev 2017-11-28 21:46:13 UTC
Created attachment 507032 [details]
environment
Comment 5 Toralf Förster gentoo-dev 2017-11-28 21:46:16 UTC
Created attachment 507034 [details]
etc.portage.tbz2
Comment 6 Toralf Förster gentoo-dev 2017-11-28 21:46:19 UTC
Created attachment 507036 [details]
logs.tbz2
Comment 7 Toralf Förster gentoo-dev 2017-11-28 21:46:22 UTC
Created attachment 507038 [details]
temp.tbz2
Comment 8 Geaaru 2017-11-29 08:28:35 UTC
Can you check if there is same problem with gcc6 ?

FWIS you use gcc7.

I will try to investigate in the next days.

Thanks
G.
Comment 9 Geaaru 2017-12-02 17:28:22 UTC
With gcc-6.4.0 from a clean stage3 rootfs I can't reproduce this issue.
I think that related with gcc-7. I continue to investigate.

G.
Comment 10 Geaaru 2017-12-03 02:01:20 UTC
I confirm that is related with gcc7 compilation but I'm not sure that is not a false positive on gcc preprocessor.

This could be a workaround, until I don't found a clear fix:

# cat  /etc/portage/patches/dev-db/cpp-driver-2.7.1/01-gcc7_warnings.patch 
--- a/src/buffer.hpp	2017-09-19 19:18:10.000000000 +0000
+++ b/src/buffer.hpp	2017-12-03 01:37:06.076256644 +0000
@@ -196,6 +196,9 @@
 
 private:
   void copy(const Buffer& buf) {
+
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
     RefBuffer* temp = data_.buffer;
 
     if (buf.size_ > FIXED_BUFFER_SIZE) {
@@ -210,6 +213,7 @@
     }
 
     size_ = buf.size_;
+#pragma GCC diagnostic pop
   }
 
   union {
Comment 11 Geaaru 2017-12-05 09:47:30 UTC
Hi,

dev-db/cpp-driver-2.8.0 fix this.

I will push pr to portage soon.

Thanks for reporting.

G.
Comment 12 Larry the Git Cow gentoo-dev 2017-12-07 09:19:43 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5084338185ba601335cbc09166677c9b203b5933

commit 5084338185ba601335cbc09166677c9b203b5933
Author:     Geaaru <geaaru@gmail.com>
AuthorDate: 2017-12-07 08:54:30 +0000
Commit:     Andreas Sturmlechner <asturm@gentoo.org>
CommitDate: 2017-12-07 09:12:26 +0000

    dev-db/cpp-driver: 2.8.0 version bump, bug #639116
    
    Package-Manager: Portage-2.3.13, Repoman-2.3.4
    Closes: https://bugs.gentoo.org/639116
    Closes: https://github.com/gentoo/gentoo/pull/6446

 dev-db/cpp-driver/Manifest                |  3 ++-
 dev-db/cpp-driver/cpp-driver-2.8.0.ebuild | 28 ++++++++++++++++++++++++++++
 2 files changed, 30 insertions(+), 1 deletion(-)