Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Making sure HPX_WITH_THREAD_BACKTRACE_ON_SUSPENSION compiles #6285

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -225,20 +225,20 @@ jobs:
/hpx/source \
-G "Ninja" \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_CXX_CLANG_TIDY=clang-tidy \
-DCMAKE_CXX_FLAGS="-fcolor-diagnostics" \
-DCMAKE_EXPORT_COMPILE_COMMANDS=On \
-DHPX_WITH_MALLOC=system \
-DHPX_WITH_FETCH_ASIO=Off \
-DHPX_WITH_DATAPAR_BACKEND=VC \
-DHPX_WITH_GIT_COMMIT=${CIRCLE_SHA1} \
-DHPX_WITH_GIT_BRANCH="${CIRCLE_BRANCH}" \
-DHPX_WITH_GIT_TAG="${CIRCLE_TAG}" \
-DHPX_WITH_TOOLS=On \
-DCMAKE_CXX_FLAGS="-fcolor-diagnostics" \
-DHPX_WITH_TESTS_HEADERS=On \
-DHPX_WITH_COMPILER_WARNINGS=On \
-DHPX_WITH_COMPILER_WARNINGS_AS_ERRORS=On \
-DHPX_WITH_DEPRECATION_WARNINGS=On \
-DCMAKE_CXX_CLANG_TIDY=clang-tidy \
-DHPX_WITH_THREAD_LOCAL_STORAGE=On \
-DHPX_WITH_STACKTRACES_STATIC_SYMBOLS=On \
-DHPX_WITH_STACKTRACES_DEMANGLE_SYMBOLS=Off \
-DHPX_WITH_TESTS_DEBUG_LOG=On \
Expand All @@ -247,9 +247,9 @@ jobs:
-DHPX_WITH_CHECK_MODULE_DEPENDENCIES=On \
-DHPX_LOGGING_WITH_SEPARATE_DESTINATIONS=Off \
-DHPX_WITH_THREAD_DEBUG_INFO=On \
-DHPX_WITH_THREAD_LOCAL_STORAGE=On \
-DHPX_COMMAND_LINE_HANDLING_WITH_JSON_CONFIGURATION_FILES=On \
-DHPX_WITH_FETCH_JSON=On \
-DCMAKE_EXPORT_COMPILE_COMMANDS=On \
-DHPX_WITH_DOCUMENTATION=On \
-DHPX_WITH_DOCUMENTATION_OUTPUT_FORMATS="${DOCUMENTATION_OUTPUT_FORMATS}" \
-DHPX_WITH_TESTS_COMMAND_LINE=--hpx:queuing=local-workrequesting-fifo
Expand Down
3 changes: 3 additions & 0 deletions .jenkins/lsu/env-clang-14.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,6 @@ configure_extra_options+=" -DHPX_WITH_FETCH_EVE=ON"
# Make sure HWLOC does not report 'cores'. This is purely an option to enable
# testing the topology code under conditions close to those on FreeBSD.
configure_extra_options+=" -DHPX_TOPOLOGY_WITH_ADDITIONAL_HWLOC_TESTING=ON"

configure_extra_options+=" -DHPX_WITH_THREAD_BACKTRACE_ON_SUSPENSION=ON"
configure_extra_options+=" -DHPX_WITH_THREAD_FULLBACKTRACE_ON_SUSPENSION=ON"
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@
#include <hpx/threading_base/threading_base_fwd.hpp>

#include <memory>
#ifdef HPX_HAVE_THREAD_FULLBACKTRACE_ON_SUSPENSION
#include <string>
#endif

#include <hpx/config/warnings_prefix.hpp>

namespace hpx::threads::detail {

Expand All @@ -40,4 +44,6 @@ namespace hpx::threads::detail {
};
} // namespace hpx::threads::detail

#include <hpx/config/warnings_suffix.hpp>

#endif // HPX_HAVE_THREAD_BACKTRACE_ON_SUSPENSION
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ namespace hpx::threads {
spinlock_pool::spinlock_for(this));

std::string bt;
if (0 != backtrace_)
if (nullptr != backtrace_)
{
#ifdef HPX_HAVE_THREAD_FULLBACKTRACE_ON_SUSPENSION
bt = *backtrace_;
Expand Down
4 changes: 2 additions & 2 deletions libs/core/threading_base/src/detail/reset_backtrace.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2020-2022 Hartmut Kaiser
// Copyright (c) 2020-2023 Hartmut Kaiser
//
// SPDX-License-Identifier: BSL-1.0
// Distributed under the Boost Software License, Version 1.0. (See accompanying
Expand Down Expand Up @@ -36,7 +36,7 @@ namespace hpx::threads::detail {

reset_backtrace::~reset_backtrace()
{
threads::set_thread_backtrace(id_, 0, ec_);
threads::set_thread_backtrace(id_, nullptr, ec_);
}
} // namespace hpx::threads::detail

Expand Down
3 changes: 2 additions & 1 deletion libs/core/threading_base/src/execution_agent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,8 @@ namespace hpx::threads {
id.noref(), threads::thread_description(desc));
#endif
#if defined(HPX_HAVE_THREAD_BACKTRACE_ON_SUSPENSION)
[[maybe_unused]] threads::detail::reset_backtrace reset_bt(id);
[[maybe_unused]] threads::detail::reset_backtrace reset_bt(
id.noref());
#endif
#if defined(HPX_HAVE_VERIFY_LOCKS)
[[maybe_unused]] auto held_locks = hpx::experimental::scope_exit(
Expand Down
10 changes: 5 additions & 5 deletions libs/core/threading_base/src/thread_helpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ namespace hpx::this_thread {
threads::thread_self& self = threads::get_self();

// keep alive
threads::thread_id_ref_type id = self.get_outer_thread_id();
threads::thread_id_ref_type const id = self.get_outer_thread_id();

// handle interruption, if needed
threads::interruption_point(id.noref(), ec);
Expand All @@ -451,16 +451,16 @@ namespace hpx::this_thread {
threads::thread_restart_state statex;

{
// verify that there are no more registered locks for this OS-thread
#ifdef HPX_HAVE_VERIFY_LOCKS
// verify that there are no more registered locks for this OS-thread
util::verify_no_locks();
#endif
#ifdef HPX_HAVE_THREAD_DESCRIPTION
threads::detail::reset_lco_description desc(
id.noref(), description, ec);
#endif
#ifdef HPX_HAVE_THREAD_BACKTRACE_ON_SUSPENSION
threads::detail::reset_backtrace bt(id, ec);
threads::detail::reset_backtrace bt(id.noref(), ec);
#endif
// We might need to dispatch 'nextid' to it's correct scheduler only
// if our current scheduler is the same, we should yield to the id
Expand Down Expand Up @@ -512,7 +512,7 @@ namespace hpx::this_thread {
threads::thread_self& self = threads::get_self();

// keep alive
threads::thread_id_ref_type id = self.get_outer_thread_id();
threads::thread_id_ref_type const id = self.get_outer_thread_id();

// handle interruption, if needed
threads::interruption_point(id.noref(), ec);
Expand All @@ -532,7 +532,7 @@ namespace hpx::this_thread {
id.noref(), description, ec);
#endif
#ifdef HPX_HAVE_THREAD_BACKTRACE_ON_SUSPENSION
threads::detail::reset_backtrace bt(id, ec);
threads::detail::reset_backtrace bt(id.noref(), ec);
#endif
std::atomic<bool> timer_started(false);
threads::thread_id_ref_type const timer_id =
Expand Down