From 6dfc999bc7f51952f62930f6c796525cd53528c2 Mon Sep 17 00:00:00 2001 From: Johnny Willemsen Date: Fri, 20 Feb 2026 15:58:17 +0100 Subject: [PATCH 1/4] Add new unit test for runtime exceptions * ACE/tests/Compiler_Features_43_Test.cpp: Added. * ACE/tests/run_test.lst: * ACE/tests/tests.mpc: --- ACE/tests/Compiler_Features_43_Test.cpp | 102 ++++++++++++++++++++++++ ACE/tests/run_test.lst | 1 + ACE/tests/tests.mpc | 7 ++ 3 files changed, 110 insertions(+) create mode 100644 ACE/tests/Compiler_Features_43_Test.cpp diff --git a/ACE/tests/Compiler_Features_43_Test.cpp b/ACE/tests/Compiler_Features_43_Test.cpp new file mode 100644 index 0000000000000..1977fa88d3da2 --- /dev/null +++ b/ACE/tests/Compiler_Features_43_Test.cpp @@ -0,0 +1,102 @@ +/** + * Test runtime behavior when throwing a plain C++ pointer in recursion + */ + +#include "test_config.h" +#include +#include +#include + +namespace DynamicAny { + struct DynAny { virtual ~DynAny() = default; }; + struct DynValue : virtual DynAny {}; + struct DynValueCommon : virtual DynAny {}; +} + +struct TAO_DynCommon : virtual DynamicAny::DynAny { + virtual ~TAO_DynCommon() + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT("~TAO_DynCommon %@\n"), this)); + } +}; +struct TAO_DynAny_i : virtual TAO_DynCommon, virtual DynamicAny::DynAny { + virtual ~TAO_DynAny_i() { ACE_DEBUG ((LM_DEBUG, ACE_TEXT("~TAO_DynAny_i %@\n"), this)); } +}; +struct TAO_DynValueCommon_i : virtual TAO_DynAny_i, virtual DynamicAny::DynValueCommon { + virtual ~TAO_DynValueCommon_i() { ACE_DEBUG ((LM_DEBUG, ACE_TEXT("~TAO_DynValueCommon_i %@\n"), this)); } +}; +// ============================================================ +// CreateDynAnyUtils +// ============================================================ +template +struct CreateDynAnyUtils { + static DA_IMPL* create(bool trigger, int depth = 0) { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT("[Create depth=%d] new DA_IMPL\n"), depth)); + DA_IMPL* p = new DA_IMPL(); + std::unique_ptr guard(p); + try { + p->from_inputCDR(trigger, depth); + } + catch (DA_IMPL* original) { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT("!!! CAUGHT pointer %@ at depth %d (destroying blank %@) !!!\n"), + original, depth, p)); + return original; + } + return guard.release(); + } +}; +// ============================================================ +// TAO_DynValue_i +// ============================================================ +struct TAO_DynValue_i : virtual DynamicAny::DynValue, virtual TAO_DynValueCommon_i { + TAO_DynValue_i() { ACE_DEBUG ((LM_DEBUG, ACE_TEXT("TAO_DynValue_i ctor %@\n"), this)); } + ~TAO_DynValue_i() override { ACE_DEBUG ((LM_DEBUG, ACE_TEXT("~TAO_DynValue_i dtor %@\n"), this)); } + static TAO_DynValue_i* cached ; + std::vector da_members_; + void from_inputCDR(bool trigger_indirection, int depth) { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT(" from_inputCDR depth=%d this=%@\n"), depth, this)); + // Simulates deep recursion of ACE_TAO (exactly like in the real DynValue_i) + if (depth < 3) { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT(" Creating nested member at depth %d\n"), depth + 1)); + try { + auto* member = CreateDynAnyUtils::create(trigger_indirection, depth + 1); + da_members_.push_back(member); + } + catch (TAO_DynValue_i* orig) { + ACE_DEBUG ((LM_DEBUG,ACE_TEXT(" Nested member threw indirection %@\n"), orig)); + da_members_.push_back(orig); + } + } + if (trigger_indirection && cached && depth >= 2) { + ACE_DEBUG ((LM_DEBUG,ACE_TEXT("*** INDIRECTION - THROWING CACHED POINTER %@ ***\n"), cached)); + cached->_add_ref(); + throw cached; // throw of the raw pointer + } + if (!cached) cached = this; + } + void _add_ref() { ACE_DEBUG ((LM_DEBUG, ACE_TEXT(" _add_ref on %@\n"), this)); } +}; +TAO_DynValue_i* TAO_DynValue_i::cached = nullptr; + +int run_main (int, ACE_TCHAR*[]) +{ + ACE_START_TEST (ACE_TEXT ("Compiler_Features_43_Test")); + + int res = {}; + + TAO_DynValue_i::cached = nullptr; + try + { + auto* result = CreateDynAnyUtils::create(true, 0); + ACE_DEBUG ((LM_DEBUG, ACE_TEXT("Success - returned %@\n"), result)); + delete result; + } + catch (...) { + ACE_DEBUG ((LM_ERROR, ACE_TEXT("In outer catch\n"))); + res = -1; + } + + ACE_END_TEST; + + return res; +} diff --git a/ACE/tests/run_test.lst b/ACE/tests/run_test.lst index c867ef9abcfbd..475c9b630b52d 100644 --- a/ACE/tests/run_test.lst +++ b/ACE/tests/run_test.lst @@ -113,6 +113,7 @@ Compiler_Features_39_Test Compiler_Features_40_Test Compiler_Features_41_Test Compiler_Features_42_Test +Compiler_Features_43_Test Config_Test: !LynxOS !VxWorks !ACE_FOR_TAO Conn_Test: !ACE_FOR_TAO DLL_Test: !STATIC diff --git a/ACE/tests/tests.mpc b/ACE/tests/tests.mpc index 987a591664ed5..c212a16a72616 100644 --- a/ACE/tests/tests.mpc +++ b/ACE/tests/tests.mpc @@ -874,6 +874,13 @@ project(Compiler_Features_42_Test) : acetest { } } +project(Compiler_Features_43_Test) : acetest { + exename = Compiler_Features_43_Test + Source_Files { + Compiler_Features_43_Test.cpp + } +} + project(Config Test) : acetest { avoids += ace_for_tao exename = Config_Test From 2d4595463d6aaf20fdf3b21c227f91dcf852c38c Mon Sep 17 00:00:00 2001 From: Johnny Willemsen Date: Fri, 20 Feb 2026 16:12:03 +0100 Subject: [PATCH 2/4] Upgrade to vcpkg 2026.01.16 * .github/workflows/windows.yml: --- .github/workflows/windows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index f13bb5dd256d0..6f0c9a1d008a1 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -114,7 +114,7 @@ jobs: - name: Install vcpkg uses: lukka/run-vcpkg@v11 with: - vcpkgGitCommitId: c82f74667287d3dc386bce81e44964370c91a289 + vcpkgGitCommitId: 66c0373dc7fca549e5803087b9487edfe3aca0a1 runVcpkgInstall: true - name: create $ACE_ROOT/ace/config.h run: | From f28c00bfd9691900cba0faee11348bfcd3c8b765 Mon Sep 17 00:00:00 2001 From: Johnny Willemsen Date: Fri, 20 Feb 2026 16:19:17 +0100 Subject: [PATCH 3/4] Use ACE_ERROR * ACE/tests/Compiler_Features_43_Test.cpp: --- ACE/tests/Compiler_Features_43_Test.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ACE/tests/Compiler_Features_43_Test.cpp b/ACE/tests/Compiler_Features_43_Test.cpp index 1977fa88d3da2..a977ef159bf91 100644 --- a/ACE/tests/Compiler_Features_43_Test.cpp +++ b/ACE/tests/Compiler_Features_43_Test.cpp @@ -92,7 +92,7 @@ int run_main (int, ACE_TCHAR*[]) delete result; } catch (...) { - ACE_DEBUG ((LM_ERROR, ACE_TEXT("In outer catch\n"))); + ACE_ERROR ((LM_ERROR, ACE_TEXT("In outer catch\n"))); res = -1; } From 351ccfcb41a9d1bd8f26481ab21c9483a4b31dd2 Mon Sep 17 00:00:00 2001 From: Johnny Willemsen Date: Fri, 20 Feb 2026 16:35:46 +0100 Subject: [PATCH 4/4] Add missing append * .github/workflows/windows.yml: --- .github/workflows/windows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 6f0c9a1d008a1..4fd4cb59e7811 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -123,7 +123,7 @@ jobs: - name: create $ACE_ROOT/bin/MakeProjectCreator/config/default.features run: | echo "ipv6=1" | out-file -encoding ASCII ${env:ACE_ROOT}/bin/MakeProjectCreator/config/default.features - echo "xerces3=1" | out-file -encoding ASCII ${env:ACE_ROOT}/bin/MakeProjectCreator/config/default.features + echo "xerces3=1" | out-file -append -encoding ASCII ${env:ACE_ROOT}/bin/MakeProjectCreator/config/default.features echo "ssl=1" | out-file -append -encoding ASCII ${env:ACE_ROOT}/bin/MakeProjectCreator/config/default.features echo "openssl11=1" | out-file -append -encoding ASCII ${env:ACE_ROOT}/bin/MakeProjectCreator/config/default.features echo "versioned_namespace=1" | out-file -append -encoding ASCII ${env:ACE_ROOT}/bin/MakeProjectCreator/config/default.features