From 5382ca4bbbee8305df901dfa79862320dbfa4a52 Mon Sep 17 00:00:00 2001 From: Chris Date: Wed, 26 Nov 2025 08:43:47 -0600 Subject: [PATCH] PartDesign: Use c++ exception to prevent crash (#25671) * part design: fix issue #25639 use c++ exception to prevent crash * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- src/Mod/PartDesign/App/FeatureFillet.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/Mod/PartDesign/App/FeatureFillet.cpp b/src/Mod/PartDesign/App/FeatureFillet.cpp index 3b2ab043ef..ade436be37 100644 --- a/src/Mod/PartDesign/App/FeatureFillet.cpp +++ b/src/Mod/PartDesign/App/FeatureFillet.cpp @@ -24,8 +24,11 @@ #include #include +#include +#include #include #include +#include #include #include #include @@ -105,6 +108,12 @@ App::DocumentObjectExecReturn* Fillet::execute() try { TopoShape shape(0); //,getDocument()->getStringHasher()); + + // Add signal handler for segfault protection +#if defined(__GNUC__) && defined(FC_OS_LINUX) + Base::SignalException se; +#endif + shape.makeElementFillet(baseShape, edges, Radius.getValue(), Radius.getValue()); if (shape.isNull()) { return new App::DocumentObjectExecReturn( @@ -138,9 +147,20 @@ App::DocumentObjectExecReturn* Fillet::execute() this->Shape.setValue(shape); return App::DocumentObject::StdReturn; } + catch (Base::Exception& e) { + return new App::DocumentObjectExecReturn(e.what()); + } catch (Standard_Failure& e) { return new App::DocumentObjectExecReturn(e.GetMessageString()); } + catch (...) { + return new App::DocumentObjectExecReturn(QT_TRANSLATE_NOOP( + "Exception", + "Fillet operation failed. The selected edges may contain geometry that cannot be " + "filleted together. " + "Try filleting edges individually or with a smaller radius." + )); + } } void Fillet::Restore(Base::XMLReader& reader)