From 1a8af1503f10540c4db229ea95a72a32340a965f Mon Sep 17 00:00:00 2001 From: albanD Date: Tue, 27 Jun 2023 20:22:36 +0000 Subject: [PATCH] Upgrade Pybind submodule to 2.10.4 (#103989) This is not ready for review, this is to make sure asan is fixed. Not sure what is the most effective way to track down the bad dec_ref within deploy yet. The asan silencing is done to match this comment: https://github.com/pytorch/pytorch/blob/1c79003b3c13c7bc47e5796e4451d6565121f3a0/test/test_cpp_extensions_jit.py#L749-L752 EDIT: since the final failing function is in libtorch_python.so, we would need to skip that whole lib (not ok). So now we're skipping based on the function name which should be restrictive enough to not hide any real bug. Pull Request resolved: https://github.com/pytorch/pytorch/pull/103989 Approved by: https://github.com/malfet --- .ci/pytorch/test.sh | 2 +- third_party/pybind11 | 2 +- torch/csrc/distributed/rpc/py_rref.cpp | 1 + ubsan.supp | 1 + 4 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 ubsan.supp diff --git a/.ci/pytorch/test.sh b/.ci/pytorch/test.sh index 39c2c353f841c..ff1558a8312c6 100755 --- a/.ci/pytorch/test.sh +++ b/.ci/pytorch/test.sh @@ -140,7 +140,7 @@ fi # ASAN test is not working if [[ "$BUILD_ENVIRONMENT" == *asan* ]]; then export ASAN_OPTIONS=detect_leaks=0:symbolize=1:detect_stack_use_after_return=true:strict_init_order=true:detect_odr_violation=1:detect_container_overflow=0:check_initialization_order=true:debug=true - export UBSAN_OPTIONS=print_stacktrace=1 + export UBSAN_OPTIONS=print_stacktrace=1:suppressions=$PWD/ubsan.supp export PYTORCH_TEST_WITH_ASAN=1 export PYTORCH_TEST_WITH_UBSAN=1 # TODO: Figure out how to avoid hard-coding these paths diff --git a/third_party/pybind11 b/third_party/pybind11 index 80dc998efced8..5b0a6fc2017fc 160000 --- a/third_party/pybind11 +++ b/third_party/pybind11 @@ -1 +1 @@ -Subproject commit 80dc998efced8ceb2be59756668a7e90e8bef917 +Subproject commit 5b0a6fc2017fcc176545afe3e09c9f9885283242 diff --git a/torch/csrc/distributed/rpc/py_rref.cpp b/torch/csrc/distributed/rpc/py_rref.cpp index 447e04612bd74..ed7847a1f5faa 100644 --- a/torch/csrc/distributed/rpc/py_rref.cpp +++ b/torch/csrc/distributed/rpc/py_rref.cpp @@ -141,6 +141,7 @@ PyRRef::PyRRef(const py::object& value, const py::object& type_hint) PyRRef::~PyRRef() { if (type_.has_value()) { + pybind11::gil_scoped_acquire ag; (*type_).dec_ref(); // explicitly setting PyObject* to nullptr to prevent py::object's dtor to // decref on the PyObject again. diff --git a/ubsan.supp b/ubsan.supp new file mode 100644 index 0000000000000..2ffeb6cb5fe68 --- /dev/null +++ b/ubsan.supp @@ -0,0 +1 @@ +vptr:pybind11::detail::translate_exception \ No newline at end of file