Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#10365] YSQL: TestYsqlUpgrade#upgradeIsIdempotent broken in ASAN
Summary: When running `org.yb.pgsql.TestYsqlUpgrade#upgradeIsIdempotent` in ASAN, the following (slightly groomed) error is produced: ``` ==10620==ERROR: AddressSanitizer: stack-use-after-scope on address 0x7efff21dd790 at pc 0x7f0012f16eaa bp 0x7efff21dcd30 sp 0x7efff21dcd28 READ of size 1 at 0x7efff21dd790 thread T30 (rpc_tp_TabletSe) #0 0x7f0012f16ea9 in std::__1::basic_string<...>::__is_long() ... #1 0x7f0012f16ea9 in std::__1::basic_string<...>::__get_pointer() ... #2 0x7f0012f16ea9 in std::__1::basic_string<...>::data() ... #3 0x7f0012f16ea9 in std::__1::basic_string<...>::c_str() ... #4 0x7f0012f16ea9 in yb::PgDeriveSocketDir(std::__1::basic_string<...> const&) yb/util/pg_util.cc:29 #5 0x7f002863cf14 in yb::pgwrapper::YsqlUpgradeHelper::Connect(std::__1::basic_string<...> const&) yb/yql/pgwrapper/ysql_upgrade.cc:233:7 #6 0x7f002863d6aa in yb::pgwrapper::YsqlUpgradeHelper::Upgrade() yb/yql/pgwrapper/ysql_upgrade.cc:251:24 #7 0x7f0029043b61 in yb::tserver::TabletServiceAdminImpl::UpgradeYsql(...) yb/tserver/tablet_service.cc:1558:38 #8 0x7f001d74316e in yb::tserver::TabletServerAdminServiceIf::Handle(...) yb/tserver/tserver_admin.service.cc:490:7 #9 0x7f001427742d in yb::rpc::ServicePoolImpl::Handle(...) yb/rpc/service_pool.cc:260:19 #10 0x7f00141283f0 in yb::rpc::InboundCall::InboundCallTask::Run() yb/rpc/inbound_call.cc:218:13 #11 0x7f00142a4c2b in yb::rpc::(anonymous namespace)::Worker::Execute() yb/rpc/thread_pool.cc:105:15 #12 0x7f0012fbcdd0 in yb::Thread::SuperviseThread(void*) yb/util/thread.cc:771:3 #13 0x7f0007547ea4 in start_thread (/lib64/libpthread.so.0+0x7ea4) #14 0x7f00072709fc in __clone (/lib64/libc.so.6+0xfe9fc) ``` Apparently, `server_->pgsql_proxy_bind_address()` passed to `YsqlUpgradeHelper` constructor by reference from `TabletServiceAdminImpl::UpgradeYsql` somehow goes out of scope. To fix this, it's now passed by value. Test Plan: ybd asan --java-test org.yb.pgsql.TestYsqlUpgrade#upgradeIsIdempotent Reviewers: sergei, mihnea, jason, dmitry Reviewed By: dmitry Subscribers: bogdan, yql Differential Revision: https://phabricator.dev.yugabyte.com/D13557
- Loading branch information