Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
1c73df5
Suppress OpenTelemetry warning on recent Clang
zanmato1984 May 20, 2025
87f52a9
Fix lint
zanmato1984 May 20, 2025
e7c1339
Use latest opentelemetry-cpp and opentelemetry-proto
zanmato1984 May 20, 2025
16d4330
Comment useless argument name
zanmato1984 May 20, 2025
6c04aaa
Revert the original compiler option tweaks
zanmato1984 May 20, 2025
c400d72
Suppress lsan error for otel
zanmato1984 May 21, 2025
1e59a79
Add asan suppressions for opentelemetry
zanmato1984 May 23, 2025
5c8f259
Fix asan suppression parsing
zanmato1984 May 23, 2025
cfc8e99
Try another way to suppress asan error
zanmato1984 May 23, 2025
adb3a94
Try another way to suppress NoopTracer
zanmato1984 May 23, 2025
b8a3f6c
Hack to not flush, see tsan behaves how
zanmato1984 May 27, 2025
79e459f
Hack to not use MessageToJsonString, see tsan behaves how
zanmato1984 May 27, 2025
029549c
Another way to eliminate tsan error
zanmato1984 May 28, 2025
5421240
Revert previous hack
zanmato1984 May 28, 2025
4f6be34
Hack to instrument otel for asan
zanmato1984 May 28, 2025
ad237e4
Use suppression for tsan
zanmato1984 May 29, 2025
4e56e48
Remove asan hack
zanmato1984 May 29, 2025
5400492
Fix asan suppression
zanmato1984 May 29, 2025
f87904b
Format
zanmato1984 May 29, 2025
120f822
Try suppress the entire asan error test
zanmato1984 May 30, 2025
01e0b95
Try suppress the entire asan error test
zanmato1984 May 30, 2025
a81c208
Resolve
zanmato1984 May 30, 2025
fc588ac
Disable false-postive tests under asan
zanmato1984 Jun 1, 2025
6d9f60c
Revert useless changes
zanmato1984 Jun 2, 2025
5908118
Comment about the reason disabling the tests
zanmato1984 Jun 2, 2025
f453cbf
Empty line
zanmato1984 Jun 2, 2025
3b3e9de
Use latest otel-cpp 1.21.0 and otel-proto 1.7.0
zanmato1984 Jun 2, 2025
61dae9a
Address comments
zanmato1984 Jun 2, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions cpp/build-support/asan-suppressions.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

# Note this file is merely a placeholder that contains no suppressions for now.
# But it may become useful in the future.
1 change: 1 addition & 0 deletions cpp/build-support/lsan-suppressions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,4 @@ leak:CRYPTO_zalloc
# without LSAN_OPTIONS=fast_unwind_on_malloc=0:malloc_context_size=100
leak:opentelemetry::v1::context::ThreadLocalContextStorage::GetStack
leak:opentelemetry::v1::context::ThreadLocalContextStorage::Stack::Resize
leak:std::make_shared<opentelemetry::v1::trace::NoopTracer>
Comment thread
kou marked this conversation as resolved.
Outdated
7 changes: 3 additions & 4 deletions cpp/build-support/run-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,9 @@ function setup_sanitizers() {
UBSAN_OPTIONS="$UBSAN_OPTIONS suppressions=$ROOT/build-support/ubsan-suppressions.txt"
export UBSAN_OPTIONS

# Enable leak detection even under LLVM 3.4, where it was disabled by default.
# This flag only takes effect when running an ASAN build.
# ASAN_OPTIONS="$ASAN_OPTIONS detect_leaks=1"
# export ASAN_OPTIONS
# Set up suppressions for AddressSanitizer
ASAN_OPTIONS="$ASAN_OPTIONS suppressions=$ROOT/build-support/asan-suppressions.txt"
export ASAN_OPTIONS
Comment on lines 78 to 80
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you revert ASAN related changes for now?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry I forgot to mention. This is not necessary for this change but I think we might need it in the future. What do you think?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK. Could you add a comment to asan-suppressions.txt that this is an empty for now but it's expected?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.


# Set up suppressions for LeakSanitizer
LSAN_OPTIONS="$LSAN_OPTIONS suppressions=$ROOT/build-support/lsan-suppressions.txt"
Expand Down
3 changes: 3 additions & 0 deletions cpp/build-support/tsan-suppressions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,6 @@

# Thread leak in CUDA
thread:libcuda.so

# False-positives in OpenTelemetry because of non-instrumented code.
race:^opentelemetry
Comment thread
kou marked this conversation as resolved.
Outdated
16 changes: 12 additions & 4 deletions cpp/src/arrow/flight/flight_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,9 @@
// > other API headers. This approach efficiently avoids the conflict
// > between the two different versions of Abseil.
#include "arrow/util/tracing_internal.h"
#ifdef ARROW_WITH_OPENTELEMETRY
// When running with OTel, ASAN reports false-positives that can't be easily suppressed.
// Disable OTel for ASAN. See GH-46509.
#if defined(ARROW_WITH_OPENTELEMETRY) && !defined(ADDRESS_SANITIZER)
# include <opentelemetry/context/propagation/global_propagator.h>
# include <opentelemetry/context/propagation/text_map_propagator.h>
# include <opentelemetry/sdk/trace/processor.h>
Expand All @@ -95,7 +97,9 @@ const char kAuthHeader[] = "authorization";
class OtelEnvironment : public ::testing::Environment {
public:
void SetUp() override {
#ifdef ARROW_WITH_OPENTELEMETRY
// When running with OTel, ASAN reports false-positives that can't be easily suppressed.
// Disable OTel for ASAN. See GH-46509.
#if defined(ARROW_WITH_OPENTELEMETRY) && !defined(ADDRESS_SANITIZER)
// The default tracer always generates no-op spans which have no
// span/trace ID. Set up a different tracer. Note, this needs to be run
// before Arrow uses OTel as GetTracer() gets a tracer once and keeps it
Expand Down Expand Up @@ -1682,7 +1686,9 @@ class TracingTestServer : public FlightServerBase {
auto* middleware =
reinterpret_cast<TracingServerMiddleware*>(call_context.GetMiddleware("tracing"));
if (!middleware) return Status::Invalid("Could not find middleware");
#ifdef ARROW_WITH_OPENTELEMETRY
// When running with OTel, ASAN reports false-positives that can't be easily suppressed.
// Disable OTel for ASAN. See GH-46509.
#if defined(ARROW_WITH_OPENTELEMETRY) && !defined(ADDRESS_SANITIZER)
// Ensure the trace context is present (but the value is random so
// we cannot assert any particular value)
EXPECT_FALSE(middleware->GetTraceContext().empty());
Expand Down Expand Up @@ -1731,7 +1737,9 @@ class TestTracing : public ::testing::Test {
std::unique_ptr<FlightServerBase> server_;
};

#ifdef ARROW_WITH_OPENTELEMETRY
// When running with OTel, ASAN reports false-positives that can't be easily suppressed.
// Disable OTel for ASAN. See GH-46509.
#if defined(ARROW_WITH_OPENTELEMETRY) && !defined(ADDRESS_SANITIZER)
// Must define it ourselves to avoid a linker error
constexpr size_t kSpanIdSize = opentelemetry::trace::SpanId::kSize;
constexpr size_t kTraceIdSize = opentelemetry::trace::TraceId::kSize;
Expand Down
8 changes: 4 additions & 4 deletions cpp/thirdparty/versions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,10 @@ ARROW_MIMALLOC_BUILD_VERSION=v2.0.6
ARROW_MIMALLOC_BUILD_SHA256_CHECKSUM=9f05c94cc2b017ed13698834ac2a3567b6339a8bde27640df5a1581d49d05ce5
ARROW_NLOHMANN_JSON_BUILD_VERSION=v3.12.0
ARROW_NLOHMANN_JSON_BUILD_SHA256_CHECKSUM=4b92eb0c06d10683f7447ce9406cb97cd4b453be18d7279320f7b2f025c10187
ARROW_OPENTELEMETRY_BUILD_VERSION=v1.13.0
ARROW_OPENTELEMETRY_BUILD_SHA256_CHECKSUM=7735cc56507149686e6019e06f588317099d4522480be5f38a2a09ec69af1706
ARROW_OPENTELEMETRY_PROTO_BUILD_VERSION=v0.17.0
ARROW_OPENTELEMETRY_PROTO_BUILD_SHA256_CHECKSUM=f269fbcb30e17b03caa1decd231ce826e59d7651c0f71c3b28eb5140b4bb5412
ARROW_OPENTELEMETRY_BUILD_VERSION=v1.21.0
ARROW_OPENTELEMETRY_BUILD_SHA256_CHECKSUM=98e5546f577a11b52a57faed1f4cc60d8c1daa44760eba393f43eab5a8ec46a2
ARROW_OPENTELEMETRY_PROTO_BUILD_VERSION=v1.7.0
ARROW_OPENTELEMETRY_PROTO_BUILD_SHA256_CHECKSUM=11330d850f5e24d34c4246bc8cb21fcd311e7565d219195713455a576bb11bed
ARROW_ORC_BUILD_VERSION=2.1.2
ARROW_ORC_BUILD_SHA256_CHECKSUM=55451e65dea6ed42afb39fe33a88f9dcea8928dca0a0c9c23ef5545587810b4c
ARROW_PROTOBUF_BUILD_VERSION=v21.3
Expand Down
Loading