Bug #19864
closedsrc/rocksdb/db/write_thread.h:192:78: error: dereferencing type-punned pointer will break strict-aliasing rules
0%
Description
This is probably https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80593 so just putting it here as a placeholder.
The CXX compiler identification is GNU 7.0.1
[ 3%] Building CXX object CMakeFiles/rocksdb.dir/db/builder.cc.o In file included from /builddir/build/BUILD/ceph-12.0.1-1912-gc124b05/src/rocksdb/db/write_batch_internal.h:12:0, from /builddir/build/BUILD/ceph-12.0.1-1912-gc124b05/src/rocksdb/db/column_family.h:20, from /builddir/build/BUILD/ceph-12.0.1-1912-gc124b05/src/rocksdb/db/version_set.h:31, from /builddir/build/BUILD/ceph-12.0.1-1912-gc124b05/src/rocksdb/db/compaction.h:11, from /builddir/build/BUILD/ceph-12.0.1-1912-gc124b05/src/rocksdb/db/compaction_iterator.h:14, from /builddir/build/BUILD/ceph-12.0.1-1912-gc124b05/src/rocksdb/db/builder.cc:16: /builddir/build/BUILD/ceph-12.0.1-1912-gc124b05/src/rocksdb/db/write_thread.h: In member function 'std::mutex& rocksdb::WriteThread::Writer::StateMutex()': /builddir/build/BUILD/ceph-12.0.1-1912-gc124b05/src/rocksdb/db/write_thread.h:192:78: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing] return *static_cast<std::mutex*>(static_cast<void*>(&state_mutex_bytes)); ^ cc1plus: all warnings being treated as errors
Updated by Nathan Cutler almost 7 years ago
Noting that ceph-12.0.1-1912-gc124b05 includes https://github.com/ceph/ceph/pull/14818
Don't know if it's relevant in this particular case, but we've found that not only the gcc version, but also the glibc version is relevant to whether the build succeeds or fails. @Brad: what glibc version are you using here?
Updated by Brad Hubbard almost 7 years ago
Hey Nathan,
My money says this is compiler specific but who knows right?
The error is from the failed copr build here.
https://copr.fedorainfracloud.org/coprs/badone/Ceph-nightlies/build/546644/
This should give you a good idea of the environment for the build (glibc-2.25-4.fc26.x86_64)
Updated by Brad Hubbard almost 7 years ago
Updated by Brad Hubbard almost 7 years ago
Updated by Brad Hubbard almost 7 years ago
I created a test package here https://copr-be.cloud.fedoraproject.org/results/badone/misc/fedora-26-x86_64/00557857-gcc/ which includes the patch for pr80593 and can confirm it allows both the test case and the original ceph (rocksdb) code to build successfully without this warning.
Updated by Nathan Cutler almost 7 years ago
@Brad: I can also confirm that the latest GCC 7 fixes the issue for us.
Updated by Brad Hubbard almost 7 years ago
Should be fixed in Fedora rawhide.
Updated by Brad Hubbard almost 7 years ago
- Status changed from New to In Progress
Updated by Brad Hubbard over 6 years ago
- Status changed from In Progress to Closed