[SERVER-24362] Support ASAN builds on Ubuntu 14.04 Created: 02/Jun/16  Updated: 22/Jun/16  Resolved: 22/Jun/16

Status: Closed
Project: Core Server
Component/s: Portability
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Misha Tyulenev Assignee: Andrew Morrow (Inactive)
Resolution: Cannot Reproduce Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Sprint: Platforms 16 (06/24/16)
Participants:

 Description   

Unable to build on Mint 17 workstation (its based on ubuntu 14.04 distribution)

here is the script I use

export CC="/usr/bin/clang"
export CXX="/usr/bin/clang++"
scons -j$2 --dbg=on --opt=off --config=force --ssl --libc++ --allocator=system --sanitize=address CC=$CC CXX=$CXX VARIANT_DIR=$VARIANT_DIR $1

Failed for clang 3.4 and 3.6.



 Comments   
Comment by Andrew Morrow (Inactive) [ 22/Jun/16 ]

misha.tyulenev - I cannot reproduce this. I made an Ubuntu 14.04 spawn host, and cloned master at 15eb12fd253141a1106de95688e17524f1e5f4b9. I built that .o first with the system clang, which is 3.4:

$ clang --version
Ubuntu clang version 3.4-1ubuntu3 (tags/RELEASE_34/final) (based on LLVM 3.4)
Target: x86_64-pc-linux-gnu
Thread model: posix
$ scons -j6 --dbg=on --opt=off --ssl --libc++ --allocator=system --sanitize=address CC=/usr/bin/clang CXX=/usr/bin/clang++ \$BUILD_DIR/mongo/client/replica_set_monitor_read_preference_test.o
scons: Reading SConscript files ...
Mkdir("build/scons")
scons version: 2.4.1
python version: 2 7 6 'final' 0
Checking whether the C compiler works... yes
...
Checking for C header file x86intrin.h... yes
scons: done reading SConscript files.
scons: Building targets ...
Creating 'build/debug/mongo/config.h'
/usr/bin/python src/mongo/base/generate_error_codes.py cpp src/mongo/base/error_codes.err --cpp-header=build/debug/mongo/base/error_codes.h --cpp-source=build/debug/mongo/base/error_codes.cpp
Compiling build/debug/mongo/client/replica_set_monitor_read_preference_test.o
scons: done building targets.

And then with clang-3.6:

$ clang-3.6 --version
Ubuntu clang version 3.6.0-2ubuntu1~trusty1 (tags/RELEASE_360/final) (based on LLVM 3.6.0)
Target: x86_64-pc-linux-gnu
Thread model: posix
$ scons -j6 --dbg=on --opt=off --ssl --libc++ --allocator=system --sanitize=address CC=/usr/bin/clang-3.6 CXX=/usr/bin/clang++-3.6 \$BUILD_DIR/mongo/client/replica_set_monitor_read_preference_test.o
scons: Reading SConscript files ...
Mkdir("build/scons")
scons version: 2.4.1
python version: 2 7 6 'final' 0
Checking whether the C compiler works... yes
...
Checking for C header file x86intrin.h... yes
scons: done reading SConscript files.
scons: Building targets ...
Creating 'build/debug/mongo/config.h'
/usr/bin/python src/mongo/base/generate_error_codes.py cpp src/mongo/base/error_codes.err --cpp-header=build/debug/mongo/base/error_codes.h --cpp-source=build/debug/mongo/base/error_codes.cpp
Compiling build/debug/mongo/client/replica_set_monitor_read_preference_test.o
scons: done building targets.

Please feel free to re-open this issue if you are able to reproduced this on an Ubuntu 14.04 host.

Comment by Misha Tyulenev [ 02/Jun/16 ]

with clang-3.6:

Compiling build/debug/mongo/client/replica_set_monitor_read_preference_test.o
In file included from src/mongo/db/modules/enterprise/src/audit/audit_metadata.cpp:7:
In file included from src/mongo/rpc/metadata/audit_metadata.h:37:
In file included from src/mongo/db/operation_context.h:33:
In file included from src/mongo/db/client.h:39:
In file included from src/mongo/db/client_basic.h:35:
In file included from src/mongo/util/net/abstract_message_port.h:35:
src/mongo/util/net/message.h:213:60: error: 'Layout' does not refer to a value
return data().read<LittleEndian<int32_t>>(offsetof(Layout, messageLength));
^
src/mongo/util/net/message.h:193:8: note: declared here
struct Layout {
^
src/mongo/util/net/message.h:213:68: error: use of undeclared identifier 'messageLength'
return data().read<LittleEndian<int32_t>>(offsetof(Layout, messageLength));
^
src/mongo/util/net/message.h:217:60: error: 'Layout' does not refer to a value
return data().read<LittleEndian<int32_t>>(offsetof(Layout, requestID));
^
src/mongo/util/net/message.h:193:8: note: declared here
struct Layout {
^
src/mongo/util/net/message.h:217:68: error: use of undeclared identifier 'requestID'
return data().read<LittleEndian<int32_t>>(offsetof(Layout, requestID));
^
src/mongo/util/net/message.h:221:60: error: 'Layout' does not refer to a value
return data().read<LittleEndian<int32_t>>(offsetof(Layout, responseTo));
^
src/mongo/util/net/message.h:193:8: note: declared here
struct Layout {
^
src/mongo/util/net/message.h:221:68: error: use of undeclared identifier 'responseTo'
return data().read<LittleEndian<int32_t>>(offsetof(Layout, responseTo));
^
src/mongo/util/net/message.h:225:60: error: 'Layout' does not refer to a value
return data().read<LittleEndian<int32_t>>(offsetof(Layout, opCode));
^
src/mongo/util/net/message.h:193:8: note: declared here
struct Layout {
^
src/mongo/util/net/message.h:225:68: error: use of undeclared identifier 'opCode'
return data().read<LittleEndian<int32_t>>(offsetof(Layout, opCode));
^
src/mongo/util/net/message.h:249:55: error: 'Layout' does not refer to a value
data().write(tagLittleEndian(value), offsetof(Layout, messageLength));
^
src/mongo/util/net/message.h:193:8: note: declared here
struct Layout {
^
src/mongo/util/net/message.h:249:63: error: use of undeclared identifier 'messageLength'; did you mean
'getMessageLength'?
data().write(tagLittleEndian(value), offsetof(Layout, messageLength));
^~~~~~~~~~~~~
getMessageLength
src/mongo/util/net/message.h:212:13: note: 'getMessageLength' declared here
int32_t getMessageLength() const {
^
src/mongo/util/net/message.h:253:55: error: 'Layout' does not refer to a value
data().write(tagLittleEndian(value), offsetof(Layout, requestID));
^
src/mongo/util/net/message.h:193:8: note: declared here
struct Layout {
^
src/mongo/util/net/message.h:253:63: error: use of undeclared identifier 'requestID'
data().write(tagLittleEndian(value), offsetof(Layout, requestID));
^
src/mongo/util/net/message.h:257:55: error: 'Layout' does not refer to a value
data().write(tagLittleEndian(value), offsetof(Layout, responseTo));
^
src/mongo/util/net/message.h:193:8: note: declared here
struct Layout {
^
src/mongo/util/net/message.h:257:63: error: use of undeclared identifier 'responseTo'
data().write(tagLittleEndian(value), offsetof(Layout, responseTo));
^
src/mongo/util/net/message.h:261:55: error: 'Layout' does not refer to a value
data().write(tagLittleEndian(value), offsetof(Layout, opCode));
^
src/mongo/util/net/message.h:193:8: note: declared here
struct Layout {
^
src/mongo/util/net/message.h:261:63: error: use of undeclared identifier 'opCode'
data().write(tagLittleEndian(value), offsetof(Layout, opCode));
^
src/mongo/util/net/message.h:314:40: error: 'Layout' does not refer to a value
return storage().view(offsetof(Layout, data));
^
src/mongo/util/net/message.h:283:8: note: declared here
struct Layout {
^
src/mongo/util/net/message.h:339:40: error: 'Layout' does not refer to a value
return storage().view(offsetof(Layout, header));
^
src/mongo/util/net/message.h:283:8: note: declared here
struct Layout {
^
src/mongo/util/net/message.h:373:40: error: 'Layout' does not refer to a value
return storage().view(offsetof(Layout, data));
^
src/mongo/util/net/message.h:283:8: note: declared here
struct Layout {
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
In file included from src/mongo/executor/network_interface_asio_auth.cpp:33:
In file included from src/mongo/executor/network_interface_asio.h:31:
In file included from src/third_party/asio-asio-1-11-0/asio/include/asio.hpp:89:
In file included from src/third_party/asio-asio-1-11-0/asio/include/asio/local/basic_endpoint.hpp:24:

In file included from src/mongo/executor/network_interface_asio_auth.cpp:33:
In file included from src/mongo/executor/network_interface_asio.h:31:
In file included from src/third_party/asio-asio-1-11-0/asio/include/asio.hpp:89:
In file included from src/third_party/asio-asio-1-11-0/asio/include/asio/local/basic_endpoint.hpp:24:
src/third_party/asio-asio-1-11-0/asio/include/asio/local/detail/endpoint.hpp:77:48: error: expected '(' for
function-style cast or type construction
+ offsetof(asio::detail::sockaddr_un_type, sun_path);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
src/third_party/asio-asio-1-11-0/asio/include/asio/local/detail/endpoint.hpp:77:50: error: use of undeclared
identifier 'sun_path'
+ offsetof(asio::detail::sockaddr_un_type, sun_path);

Comment by Andrew Morrow (Inactive) [ 02/Jun/16 ]

What is the error?

Generated at Thu Feb 08 04:06:09 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.