Project

General

Profile

Actions

Bug #19864

closed

src/rocksdb/db/write_thread.h:192:78: error: dereferencing type-punned pointer will break strict-aliasing rules

Added by Brad Hubbard almost 7 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Low
Assignee:
Category:
build
Target version:
-
% Done:

0%

Source:
Development
Tags:
Backport:
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):

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
Actions #1

Updated by Brad Hubbard almost 7 years ago

  • Description updated (diff)
Actions #2

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?

Actions #3

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)

https://copr-be.cloud.fedoraproject.org/results/badone/Ceph-nightlies/fedora-26-x86_64/00546644-ceph/root.log.gz

Actions #6

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.

Actions #7

Updated by Nathan Cutler almost 7 years ago

@Brad: I can also confirm that the latest GCC 7 fixes the issue for us.

Actions #8

Updated by Brad Hubbard almost 7 years ago

Thanks Nathan.

Actions #9

Updated by Brad Hubbard almost 7 years ago

Actions #10

Updated by Brad Hubbard almost 7 years ago

  • Status changed from New to In Progress
Actions #11

Updated by Brad Hubbard over 6 years ago

  • Status changed from In Progress to Closed
Actions

Also available in: Atom PDF