Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
emper
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Florian Schmaus
emper
Commits
e05fcbe9
Commit
e05fcbe9
authored
3 years ago
by
Florian Schmaus
Browse files
Options
Downloads
Patches
Plain Diff
wip
parent
d3899d86
No related branches found
No related tags found
No related merge requests found
Pipeline
#75594
failed
3 years ago
Stage: smoke-test
Stage: test
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
emper/log/log.cpp
+4
-2
4 additions, 2 deletions
emper/log/log.cpp
msan
+55
-0
55 additions, 0 deletions
msan
with
59 additions
and
2 deletions
emper/log/log.cpp
+
4
−
2
View file @
e05fcbe9
...
...
@@ -21,11 +21,12 @@
using
emper
::
io
::
GlobalIoContext
;
static
const
long
NanosInAMinute
=
60L
*
1000
*
1000
*
1000
;
//
static const long NanosInAMinute = 60L * 1000 * 1000 * 1000;
namespace
emper
::
log
{
static
void
add_timestamp_to
(
std
::
ostringstream
&
logMessage
)
{
static
void
add_timestamp_to
(
UNUSED_ARG
std
::
ostringstream
&
logMessage
)
{
#if 0
auto now = std::chrono::high_resolution_clock::now();
auto now_time_t = std::chrono::high_resolution_clock::to_time_t(now);
...
...
@@ -53,6 +54,7 @@ static void add_timestamp_to(std::ostringstream& logMessage) {
long remaining_nanos = time_since_epoch_long % NanosInAMinute;
logMessage << remaining_nanos;
#endif
}
static
std
::
mutex
log_mutex
;
...
...
This diff is collapsed.
Click to expand it.
msan
0 → 100644
+
55
−
0
View file @
e05fcbe9
#!/usr/bin/env bash
set
-euo
pipefail
readonly
INSTRUMENTED_LIBCXX_DIR
=
"/home/flo/repos/llvm-13.0.0/build"
readonly
INSTRUMENTED_LIBCXX_LIB_DIR
=
"
${
INSTRUMENTED_LIBCXX_DIR
}
/lib"
readonly
INSTRUMENTED_LIBCXX_INC_DIR
=
"
${
INSTRUMENTED_LIBCXX_DIR
}
/include"
# export CC="clang -stdlib=libc++ -L${INSTRUMENTED_LIBCXX_LIB_DIR} -I${INSTRUMENTED_LIBCXX_INC_DIR} -I${INSTRUMENTED_LIBCXX_INC_DIR}c++/v1"
# export CXX="clang++ -stdlib=libc++ -lc++abi -L${INSTRUMENTED_LIBCXX_LIB_DIR} -I${INSTRUMENTED_LIBCXX_INC_DIR} -I${INSTRUMENTED_LIBCXX_INC_DIR}/c++/v1"
export
CC
=
"clang"
export
CXX
=
"clang++"
# source: https://github.com/google/sanitizers/wiki/MemorySanitizerLibcxxHowTo
# MSAN_CFLAGS="-fsanitize=memory -stdlib=libc++ -L/path/to/libcxx_msan/lib -lc++abi -I/path/to/libcxx_msan/include -I/path/to/libcxx_msan/include/c++/v1"
# Note that meson automatically passes -stblib=libc++ if clang is used
# TODO: why -lc++abi ?
MSAN_FLAGS
=(
# -stdlib=libc++
-L
${
INSTRUMENTED_LIBCXX_LIB_DIR
}
# -lc++abi
-I
${
INSTRUMENTED_LIBCXX_INC_DIR
}
/include
-I
${
INSTRUMENTED_LIBCXX_INC_DIR
}
/include/c++/v1
)
printf
-v
MESON_MSAN_CPP_ARGS
"%s,"
"
${
MSAN_FLAGS
[@]
}
"
# Meson's c_stdlib flag may only work for cross builds "--native-file foo.ini"
# -Dcpp_args="${MESON_MSAN_CPP_ARGS}" \
meson
\
--buildtype
=
debug
\
--fatal-meson-warnings
\
-Db_sanitize
=
memory
\
-Db_lundef
=
false
\
-Dcpp_args
=
'-stdlib=libc++'
\
-Dcpp_args
=
-I
${
INSTRUMENTED_LIBCXX_INC_DIR
}
\
-Dcpp_args
=
-I
${
INSTRUMENTED_LIBCXX_INC_DIR
}
/c++/v1
\
-Dcpp_link_args
=
-L
${
INSTRUMENTED_LIBCXX_LIB_DIR
}
\
build-msan
# It appears that meson is filtering -stdlib=libc++ and always selects
# the compilers default. Which is for clang often libstdc++, i.e., GCC
# C++ standard library.
# NOTE: We could potentially place a complete LLVM/Clang toolchain in
# the CI container, that has the sanitizers enabled.
sed
--in-place
\
s/clang++/clang++
-stdlib
=
libc++/
\
build-msan/build.ninja
ninja
export
LD_LIBRARY_PATH
=
"
${
INSTRUMENTED_LIBCXX_LIB_DIR
}
"
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment