OpenVINO™ is an open source toolkit for optimizing and deploying AI inference
C++ aicomputer-visiondeep-learningdeploy-aidiffusion-modelsgenerative-aigood-first-issueinferencellm-inferencenatural-language-processingnlpopenvinooptimize-aiperformance-boostrecommendation-systemspeech-recognitionstable-diffusiontransformersyolo
[ARM] Hide bundled libprotobuf symbols to fix TensorFlow "Bus error" in TF layer tests (#39571)
Aleksandr Vorond902227e1bfc
diff --git a/.github/workflows/job_tensorflow_layer_tests.yml b/.github/workflows/job_tensorflow_layer_tests.ymlindex 7854c84b8a4..7d3da04bcb6 100644--- a/.github/workflows/job_tensorflow_layer_tests.yml+++ b/.github/workflows/job_tensorflow_layer_tests.yml@@ -127,6 +127,23 @@ jobs:find "$tf_dir" -maxdepth 3 \( -name '_pywrap_cpu_feature_guard*.so' -o -name 'libtensorflow_framework*' \) -exec ls -l {} +python3 -c "import tensorflow as tf; print(tf.__version__)"+ # Diagnostics for "Fatal Python error: Bus error" (CVS-192737)+ # dyld coalesces exported weak symbols across all loaded images, so Protobuf symbols+ # exported by OpenVINO can be bound to by TensorFlow's own (different version) Protobuf.+ - name: Check exported Protobuf symbols of OpenVINO libraries (macOS)+ if: ${{ runner.os == 'macOS' && fromJSON(inputs.affected-components).TF_FE.test }}+ continue-on-error: true+ run: |+ libs_dir=$(python3 -c "import openvino, os; print(os.path.join(os.path.dirname(openvino.__file__), 'libs'))")+ for lib in "$libs_dir"/*.dylib; do+ count=$(nm -gUj "$lib" | grep -c -E '^__ZN(6google8protobuf|4absl)' || true)+ echo "$count exported google::protobuf/absl symbols: $(basename "$lib")"+ if [ "$count" -gt 0 ]; then+ echo "::warning::$(basename "$lib") exports $count google::protobuf/absl symbols"+ nm -gUj "$lib" | grep -E '^__ZN(6google8protobuf|4absl)' | head -n 20+ fi+ done+- name: Check TensorFlow import order (macOS)id: tensorflow_import_orderif: ${{ runner.os == 'macOS' && fromJSON(inputs.affected-components).TF_FE.test }}@@ -146,16 +163,6 @@ jobs:status=$?failed=1echo "::warning::Import probe failed with exit code $status: $probe"- if command -v lldb >/dev/null 2>&1; then- if lldb --batch -o run -k "thread backtrace all" -- "$python_executable" -X faulthandler -u -c "$probe"; then- echo "LLDB retry completed; inspect its output to see whether the crash reproduced."- else- status=$?- echo "::warning::LLDB retry exited with code $status."- fi- else- echo "::warning::LLDB is unavailable; native backtrace could not be collected."- fifiecho "::endgroup::"donediff --git a/thirdparty/protobuf/CMakeLists.txt b/thirdparty/protobuf/CMakeLists.txtindex 200fe01874d..7eb3bcf0ce6 100644--- a/thirdparty/protobuf/CMakeLists.txt+++ b/thirdparty/protobuf/CMakeLists.txt@@ -102,10 +102,13 @@ if(CMAKE_COMPILER_IS_GNUCXX OR OV_COMPILER_IS_CLANG OR OV_COMPILER_IS_INTEL_LLVMif(protobuf_BUILD_PROTOC_BINARIES)list(APPEND _protoc_libs protoc libprotoc libprotobuf)set_target_properties(${_protoc_libs} PROPERTIES- CXX_VISIBILITY_PRESET default- C_VISIBILITY_PRESET default- VISIBILITY_INLINES_HIDDEN OFFINTERPROCEDURAL_OPTIMIZATION_RELEASE OFF)+ if(NOT APPLE)+ set_target_properties(${_protoc_libs} PROPERTIES+ CXX_VISIBILITY_PRESET default+ C_VISIBILITY_PRESET default+ VISIBILITY_INLINES_HIDDEN OFF)+ endif()endif()# protobuf is incompatible with thread sanitizersif(ENABLE_THREAD_SANITIZER)