aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/restricted
diff options
context:
space:
mode:
authoryuryalekseev <yuryalekseev@yandex-team.com>2022-12-29 15:07:10 +0300
committeryuryalekseev <yuryalekseev@yandex-team.com>2022-12-29 15:07:10 +0300
commit758fd297e68f550d2943cc0b9a8bd209f7738339 (patch)
treed728aa1868529766cf48b9fb6a0e1abd18d194d9 /contrib/restricted
parenta7d00deaf0df4bb46e4d7b8412b4ef3525e530b6 (diff)
downloadydb-758fd297e68f550d2943cc0b9a8bd209f7738339.tar.gz
Add description for groups.
Diffstat (limited to 'contrib/restricted')
-rw-r--r--contrib/restricted/boost/stacktrace/include/boost/stacktrace/detail/frame_msvc.ipp50
-rw-r--r--contrib/restricted/boost/stacktrace/include/boost/stacktrace/detail/libbacktrace_impls.hpp6
2 files changed, 16 insertions, 40 deletions
diff --git a/contrib/restricted/boost/stacktrace/include/boost/stacktrace/detail/frame_msvc.ipp b/contrib/restricted/boost/stacktrace/include/boost/stacktrace/detail/frame_msvc.ipp
index 9b743396ea..6f2b61552a 100644
--- a/contrib/restricted/boost/stacktrace/include/boost/stacktrace/detail/frame_msvc.ipp
+++ b/contrib/restricted/boost/stacktrace/include/boost/stacktrace/detail/frame_msvc.ipp
@@ -44,37 +44,12 @@
namespace boost { namespace stacktrace { namespace detail {
-class com_global_initer: boost::noncopyable {
- bool ok_;
-
-public:
- com_global_initer() BOOST_NOEXCEPT
- : ok_(false)
- {
- // COINIT_MULTITHREADED means that we must serialize access to the objects manually.
- // This is the fastest way to work. If user calls CoInitializeEx before us - we
- // can end up with other mode (which is OK for us).
- //
- // If we call CoInitializeEx befire user - user may end up with different mode, which is a problem.
- // So we need to call that initialization function as late as possible.
- const DWORD res = ::CoInitializeEx(0, COINIT_MULTITHREADED);
- ok_ = (res == S_OK || res == S_FALSE);
- }
-
- ~com_global_initer() BOOST_NOEXCEPT {
- if (ok_) {
- ::CoUninitialize();
- }
- }
-};
-
-
template <class T>
class com_holder: boost::noncopyable {
T* holder_;
public:
- com_holder(const com_global_initer&) BOOST_NOEXCEPT
+ com_holder() BOOST_NOEXCEPT
: holder_(0)
{}
@@ -126,13 +101,13 @@ inline void trim_right_zeroes(std::string& s) {
}
class debugging_symbols: boost::noncopyable {
- static void try_init_com(com_holder< ::IDebugSymbols>& idebug, const com_global_initer& com) BOOST_NOEXCEPT {
- com_holder< ::IDebugClient> iclient(com);
+ static void try_init_com(com_holder< ::IDebugSymbols>& idebug) BOOST_NOEXCEPT {
+ com_holder< ::IDebugClient> iclient;
if (S_OK != ::DebugCreate(__uuidof(IDebugClient), iclient.to_void_ptr_ptr())) {
return;
}
- com_holder< ::IDebugControl> icontrol(com);
+ com_holder< ::IDebugControl> icontrol;
const bool res0 = (S_OK == iclient->QueryInterface(
__uuidof(IDebugControl),
icontrol.to_void_ptr_ptr()
@@ -160,14 +135,11 @@ class debugging_symbols: boost::noncopyable {
#ifndef BOOST_STACKTRACE_USE_WINDBG_CACHED
- boost::stacktrace::detail::com_global_initer com_;
com_holder< ::IDebugSymbols> idebug_;
public:
debugging_symbols() BOOST_NOEXCEPT
- : com_()
- , idebug_(com_)
{
- try_init_com(idebug_, com_);
+ try_init_com(idebug_);
}
#else
@@ -179,11 +151,10 @@ public:
static com_holder< ::IDebugSymbols>& get_thread_local_debug_inst() BOOST_NOEXCEPT {
// [class.mfct]: A static local variable or local type in a member function always refers to the same entity, whether
// or not the member function is inline.
- static thread_local boost::stacktrace::detail::com_global_initer com;
- static thread_local com_holder< ::IDebugSymbols> idebug(com);
+ static thread_local com_holder< ::IDebugSymbols> idebug;
if (!idebug.is_inited()) {
- try_init_com(idebug, com);
+ try_init_com(idebug);
}
return idebug;
@@ -228,9 +199,12 @@ public:
&size,
0
));
- trim_right_zeroes(result);
+
+ // According to https://docs.microsoft.com/en-us/windows-hardware/drivers/ddi/dbgeng/nf-dbgeng-idebugsymbols-getnamebyoffset
+ // "This size includes the space for the '\0' terminating character."
+ result.resize(size - 1);
} else if (res) {
- result = name;
+ result.assign(name, size - 1);
}
if (!res) {
diff --git a/contrib/restricted/boost/stacktrace/include/boost/stacktrace/detail/libbacktrace_impls.hpp b/contrib/restricted/boost/stacktrace/include/boost/stacktrace/detail/libbacktrace_impls.hpp
index bf967cd91a..bd31c51bf7 100644
--- a/contrib/restricted/boost/stacktrace/include/boost/stacktrace/detail/libbacktrace_impls.hpp
+++ b/contrib/restricted/boost/stacktrace/include/boost/stacktrace/detail/libbacktrace_impls.hpp
@@ -82,10 +82,12 @@ BOOST_SYMBOL_VISIBLE inline ::backtrace_state* construct_state(const program_loc
//
//
// Unfortunately, that solution segfaults when `construct_state()` function is in .so file
- // and multiple threads concurrently work with state.
+ // and multiple threads concurrently work with state. I failed to localize the root cause:
+ // https://gcc.gnu.org/bugzilla//show_bug.cgi?id=87653
+
#if 0
-#ifndef BOOST_HAS_THREADS
+#if !defined(BOOST_HAS_THREADS) || defined(BOOST_STACKTRACE_BACKTRACE_FORCE_STATIC)
static
#else