Skip to content

Build is broken with clang 3.8 #4699

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
karkhaz opened this issue May 23, 2019 · 8 comments
Closed

Build is broken with clang 3.8 #4699

karkhaz opened this issue May 23, 2019 · 8 comments

Comments

@karkhaz
Copy link
Collaborator

karkhaz commented May 23, 2019

I'm assigning @smowton because git blame told me to, but I doubt it's actually your fault. I'll bisect this later today and update the ticket.

> CXX=/usr/bin/clang++ cmake -GNinja -H. -Bbuild -DCMAKE_BUILD_TYPE=Debug
> cmake --build build
cbmc/src/pointer-analysis/value_set.h:227:19: error: 
      invalid operands to binary expression ('const object_mapt' (aka 'const
      reference_counting<map<unsigned long,
      nonstd::optional_lite::optional<BigInt> >, empty_object_map>') and
      'const object_mapt')
        object_map==other.object_map;
        ~~~~~~~~~~^ ~~~~~~~~~~~~~~~~
ws> /usr/bin/clang++ --version
clang version 3.8.0-2ubuntu4 (tags/RELEASE_380/final)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
ws> cat /etc/os-release
NAME="Ubuntu"
VERSION="16.04.6 LTS (Xenial Xerus)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 16.04.6 LTS"
VERSION_ID="16.04"
HOME_URL="http://www.ubuntu.com/"
SUPPORT_URL="http://help.ubuntu.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"
VERSION_CODENAME=xenial
UBUNTU_CODENAME=xenial
ws> git show
commit e7944411a13177dfaccfc8667908f8fbe5c94a78
Merge: 0888187 e739fbb
Author: Michael Tautschnig <[email protected]>
Date:   Thu May 23 12:10:40 2019 +0100

    Merge pull request #4697 from tautschnig/fix-value-set-filtering
    
    Value-set filtering: gracefully handle pointer arithmetic
> git blame -L227,227 src/pointer-analysis/value_set.h
d4f1b294 (Chris Smowton 2017-10-11 11:35:04 +0100 227)         object_map==other.object_map;
@tautschnig
Copy link
Collaborator

@karkhaz My suspicion is that this is caused by #4694.

@smowton
Copy link
Contributor

smowton commented May 23, 2019

This (https://github.com/diffblue/cbmc/blob/develop/src/util/reference_counting.h#L184) should be providing the relevant operator==, any hints why Clang 3.8 uniquely thinks it doesn't?

@karkhaz
Copy link
Collaborator Author

karkhaz commented May 23, 2019

@tautschnig: git-bisect was fast, but tautschnig-bisect was faster.

@smowton I've been scratching my head over this all afternoon. I finally tried building with clang 9, and it does not complain. I can only conclude that clang 3.8 is miscompiling. (I know saying that "the compiler is wrong" is a cop-out, and this is the second time I've found a clang bug while building CBMC)...

Not sure what course of action to take. Close as WONTFIX? But Ubuntu 16.04 is still very common in the wild, it's a long-term support distro.

@karkhaz
Copy link
Collaborator Author

karkhaz commented May 23, 2019

I suppose we could at least modify the CMake and Makefile builds to require a non-ancient Clang, and maybe make the build tools print the URL for the official LLVM Ubuntu packages if the build is being run on Ubuntu...

@smowton
Copy link
Contributor

smowton commented May 23, 2019

I'm happy enough if we can find a workaround -- perhaps an explicit template instantiation to nudge clang in the right direction?

@karkhaz karkhaz removed their assignment May 23, 2019
@karkhaz
Copy link
Collaborator Author

karkhaz commented May 23, 2019

I spent some time on trying to add a template instantiation this afternoon without success. I agree that this solution would be good, but I'm unable to spend more time on this, sorry. I'm going to leave the issue open, up to Diffblue to decide how to close it; I'm just going to install a recent Clang on my machine or use GCC.

romainbrenguier added a commit to romainbrenguier/cbmc that referenced this issue May 24, 2019
The explicit definition of object_mapt equality was removed recently in
pull request diffblue#4694 but it seems necessary when compiling
with clang which would complain about it not being defined.

Should fix diffblue#4699
@allredj
Copy link
Contributor

allredj commented May 24, 2019

We stumbled upon this problem on TG as well. Do we want to keep support for clang 3.8? If so we should add a build on Travis.

@allredj
Copy link
Contributor

allredj commented May 24, 2019

^ @peterschrammel ?

romainbrenguier added a commit to romainbrenguier/cbmc that referenced this issue May 24, 2019
The explicit definition of object_mapt equality was removed recently in
pull request diffblue#4694 but it seems necessary when compiling
with clang which would complain about it not being defined.

Should fix diffblue#4699
romainbrenguier added a commit to romainbrenguier/cbmc that referenced this issue May 24, 2019
The explicit definition of object_mapt equality was removed recently in
pull request diffblue#4694 but it seems necessary when compiling
with clang which would complain about it not being defined.

Should fix diffblue#4699
romainbrenguier added a commit to romainbrenguier/cbmc that referenced this issue May 24, 2019
The explicit definition of object_mapt equality was removed recently in
pull request diffblue#4694 but it seems necessary when compiling
with clang which would complain about it not being defined.

Should fix diffblue#4699
romainbrenguier added a commit to romainbrenguier/cbmc that referenced this issue May 28, 2019
This is to check that changes do not break compilation using
clang++-3.8, as happened with
diffblue#4699
romainbrenguier added a commit to romainbrenguier/cbmc that referenced this issue May 28, 2019
This is to check that changes do not break compilation using
clang++-3.8, as happened with
diffblue#4699
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants