diff --git a/cpp/build-support/asan-suppressions.txt b/cpp/build-support/asan-suppressions.txt new file mode 100644 index 000000000000..553706e045f4 --- /dev/null +++ b/cpp/build-support/asan-suppressions.txt @@ -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. \ No newline at end of file diff --git a/cpp/build-support/lsan-suppressions.txt b/cpp/build-support/lsan-suppressions.txt index a8918e10d947..dbcddb291103 100644 --- a/cpp/build-support/lsan-suppressions.txt +++ b/cpp/build-support/lsan-suppressions.txt @@ -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 diff --git a/cpp/build-support/run-test.sh b/cpp/build-support/run-test.sh index 55e3fe098074..f176586a0fd9 100755 --- a/cpp/build-support/run-test.sh +++ b/cpp/build-support/run-test.sh @@ -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 # Set up suppressions for LeakSanitizer LSAN_OPTIONS="$LSAN_OPTIONS suppressions=$ROOT/build-support/lsan-suppressions.txt" diff --git a/cpp/build-support/tsan-suppressions.txt b/cpp/build-support/tsan-suppressions.txt index ce897c859118..fc4a2f6ee1db 100644 --- a/cpp/build-support/tsan-suppressions.txt +++ b/cpp/build-support/tsan-suppressions.txt @@ -17,3 +17,6 @@ # Thread leak in CUDA thread:libcuda.so + +# False-positives in OpenTelemetry because of non-instrumented code. +race:^opentelemetry \ No newline at end of file diff --git a/cpp/src/arrow/flight/flight_test.cc b/cpp/src/arrow/flight/flight_test.cc index 863f21f8db5e..16a4909828b0 100644 --- a/cpp/src/arrow/flight/flight_test.cc +++ b/cpp/src/arrow/flight/flight_test.cc @@ -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 # include # include @@ -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 @@ -1682,7 +1686,9 @@ class TracingTestServer : public FlightServerBase { auto* middleware = reinterpret_cast(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()); @@ -1731,7 +1737,9 @@ class TestTracing : public ::testing::Test { std::unique_ptr 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; diff --git a/cpp/thirdparty/versions.txt b/cpp/thirdparty/versions.txt index bb8dca4a78e3..3a8ad73e1371 100644 --- a/cpp/thirdparty/versions.txt +++ b/cpp/thirdparty/versions.txt @@ -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