From 0e1235475f5b398b9b66a1edfade6bd3e7d96c88 Mon Sep 17 00:00:00 2001 From: kgv Date: Mon, 17 Jun 2019 18:42:36 +0300 Subject: [PATCH] 0030775: Foundation Classes - Preserve application-defined top-level exception filter OSD::SetSignal() method now accepts argument resetting handler to default. Added new method OSD::SetThreadLocalSignal() intended to setup thread-specific handlers (e.g. _set_se_translator() on Windows) and FPE settings. OSD_ThreadPool now uses new method instead of OSD::SetSignal(). dsetsignal syntax has been changed so that the first argument now defines of signals should be catched by OCCT or not; new parameter -fpe defines if FPE signals should be catched. --- src/Draw/Draw_BasicCommands.cxx | 70 ++++++++++-- src/OSD/OSD.hxx | 27 ++++- src/OSD/OSD_ThreadPool.cxx | 4 +- src/OSD/OSD_signal.cxx | 191 +++++++++++++++++++++----------- src/QABugs/QABugs_11.cxx | 66 ++++++++++- tests/bugs/fclasses/bug28829 | 6 +- tests/bugs/fclasses/bug30775 | 23 ++++ tests/bugs/fclasses/bug6143 | 4 +- tests/bugs/modalg_6/bug28054_1 | 2 +- tests/bugs/modalg_6/bug28054_2 | 2 +- tests/bugs/modalg_6/bug28706 | 2 +- tests/bugs/modalg_7/bug28085_1 | 2 +- tests/bugs/modalg_7/bug29698 | 4 +- tests/bugs/moddata_3/bug28175_1 | 2 +- tests/bugs/vis/bug29127 | 2 +- tests/lowalgos/intss/bug27842 | 2 +- tests/lowalgos/intss/bug28085_2 | 2 +- tests/lowalgos/intss/bug28222_1 | 2 +- tests/lowalgos/intss/bug28222_2 | 2 +- tests/lowalgos/intss/bug28222_3 | 2 +- tests/perf/fclasses/strtod | 2 +- 21 files changed, 319 insertions(+), 100 deletions(-) create mode 100644 tests/bugs/fclasses/bug30775 diff --git a/src/Draw/Draw_BasicCommands.cxx b/src/Draw/Draw_BasicCommands.cxx index 638fcfdd9d..b640f1449d 100644 --- a/src/Draw/Draw_BasicCommands.cxx +++ b/src/Draw/Draw_BasicCommands.cxx @@ -908,21 +908,71 @@ static int dperf (Draw_Interpretor& theDI, Standard_Integer theArgNb, const char static int dsetsignal (Draw_Interpretor& theDI, Standard_Integer theArgNb, const char** theArgVec) { - // arm FPE handler if argument is provided and its first symbol is not '0' - // or if environment variable CSF_FPE is set and its first symbol is not '0' - bool setFPE = false; - if (theArgNb > 1) + if (theArgNb < 2) { - setFPE = (theArgVec[1][0] == '1' || theArgVec[1][0] == 't'); + theDI << "Catch signals: " << (OSD::ToCatchSignals() ? "1" : "0") << "\n" + << "Catch FPE: " << (OSD::ToCatchFloatingSignals() ? "1" : "0") << "\n"; + return 0; } - else + + Standard_Integer toSetSig = -1, toSetFpe = -1; + for (Standard_Integer anArgIter = 1; anArgIter < theArgNb; ++anArgIter) + { + TCollection_AsciiString anArg (theArgVec[anArgIter]); + anArg.LowerCase(); + if (anArg == "-fpe" + && toSetFpe == -1 + && anArgIter + 1 < theArgNb) + { + TCollection_AsciiString anArgNext (theArgVec[++anArgIter]); + if (anArgNext == "1") + { + toSetFpe = 1; + } + else if (anArgNext == "0") + { + toSetFpe = 0; + } + else + { + std::cout << "Syntax error at '" << anArg << "'\n"; + return 1; + } + } + else if (toSetSig == -1 + && (anArg == "0" || anArg == "1")) + { + toSetSig = anArg == "1" ? 1 : 0; + } + else + { + std::cout << "Syntax error at '" << anArg << "'\n"; + return 1; + } + } + if (toSetSig == -1) + { + std::cout << "Syntax error: wrong number of arguments\n"; + return 1; + } + + if (toSetSig == 1 + && toSetFpe == -1) { OSD_Environment aEnv ("CSF_FPE"); TCollection_AsciiString aEnvStr = aEnv.Value(); - setFPE = (! aEnvStr.IsEmpty() && aEnvStr.Value(1) != '0'); + toSetFpe = (!aEnvStr.IsEmpty() && aEnvStr.Value(1) != '0') ? 1 : 0; + } + + OSD::SetSignal (toSetSig == 1, toSetFpe == 1); + if (toSetSig == 1) + { + theDI << "Signal handlers are set, with FPE " << (toSetFpe == 1 ? "armed" : "disarmed"); + } + else + { + theDI << "Signal handlers are reset to defaults, with FPE " << (toSetFpe == 1 ? "armed" : "disarmed"); } - OSD::SetSignal (setFPE); - theDI << "Signal handlers are set, with FPE " << (setFPE ? "armed" : "disarmed"); return 0; } @@ -1052,7 +1102,7 @@ void Draw::BasicCommands(Draw_Interpretor& theCommands) __FILE__, dmeminfo, g); theCommands.Add("dperf","dperf [reset] -- show performance counters, reset if argument is provided", __FILE__,dperf,g); - theCommands.Add("dsetsignal","dsetsignal [fpe=0] -- set OSD signal handler, with FPE option if argument is given", + theCommands.Add("dsetsignal","dsetsignal {0|1} [-fpe {0|1}] -- set OSD signal handler, with FPE option if argument is given", __FILE__,dsetsignal,g); theCommands.Add("dparallel", diff --git a/src/OSD/OSD.hxx b/src/OSD/OSD.hxx index dd80e028b0..586998b257 100644 --- a/src/OSD/OSD.hxx +++ b/src/OSD/OSD.hxx @@ -50,7 +50,9 @@ public: DEFINE_STANDARD_ALLOC - + //! Return signal catching value previously set by SetSignal(). + Standard_EXPORT static Standard_Boolean ToCatchSignals(); + //! Sets signal and exception handlers. //! //! ### Windows-specific notes @@ -102,12 +104,31 @@ public: //! ::throw() will be called) is regulated by the //! OCC_CONVERT_SIGNALS macro used during compilation of Open CASCADE and //! user's code. Refer to Foundation Classes User's Guide for further details. - //! - Standard_EXPORT static void SetSignal (const Standard_Boolean theFloatingSignal = Standard_True); + Standard_EXPORT static void SetSignal (Standard_Boolean theToCatch, + Standard_Boolean theFloatingSignal); + + //! Sets signal and exception handlers. + static void SetSignal (const Standard_Boolean theFloatingSignal = Standard_True) + { + SetSignal (Standard_True, theFloatingSignal); + } + + //! Initializes thread-local signal handlers. + //! This method sets up extra handlers which are not inherited on creation of new thread. + //! This includes _set_se_translator() on Windows platform and SetFloatingSignals(). + //! The main purpose of this method is initializing handlers for newly created threads + //! without overriding global handlers (set by application or by OSD::SetSignal()). + //! In most cases OSD::SetSignal() should be called instead. + Standard_EXPORT static void SetThreadLocalSignal (Standard_Boolean theToCatch, + Standard_Boolean theFloatingSignal); //! Return floating signal catching value previously set by SetSignal(). Standard_EXPORT static Standard_Boolean ToCatchFloatingSignals(); + //! Enables/disables floating signal (FPE) catching for current thread. + //! This call does NOT actually register any exception handler - SetSignal() should be called beforehand for complete setup. + Standard_EXPORT static void SetFloatingSignals (Standard_Boolean theFloatingSignal); + //! Commands the process to sleep for a number of seconds. Standard_EXPORT static void SecSleep (const Standard_Integer aDelay); diff --git a/src/OSD/OSD_ThreadPool.cxx b/src/OSD/OSD_ThreadPool.cxx index 17c5370cf1..83be9b7df8 100644 --- a/src/OSD/OSD_ThreadPool.cxx +++ b/src/OSD/OSD_ThreadPool.cxx @@ -310,7 +310,7 @@ void OSD_ThreadPool::performJob (Handle(Standard_Failure)& theFailure, // ======================================================================= void OSD_ThreadPool::EnumeratedThread::performThread() { - OSD::SetSignal (false); + OSD::SetThreadLocalSignal (OSD::ToCatchSignals(), false); for (;;) { myWakeEvent.Wait(); @@ -323,7 +323,7 @@ void OSD_ThreadPool::EnumeratedThread::performThread() myFailure.Nullify(); if (myJob != NULL) { - OSD::SetSignal (myToCatchFpe); + OSD::SetThreadLocalSignal (OSD::ToCatchSignals(), myToCatchFpe); OSD_ThreadPool::performJob (myFailure, myJob, myThreadIndex); myJob = NULL; } diff --git a/src/OSD/OSD_signal.cxx b/src/OSD/OSD_signal.cxx index 79031e6287..39532f4560 100644 --- a/src/OSD/OSD_signal.cxx +++ b/src/OSD/OSD_signal.cxx @@ -17,8 +17,18 @@ #include #include +static Standard_Boolean OSD_WasSetSignal = Standard_False; static Standard_THREADLOCAL Standard_Boolean fFltExceptions = Standard_False; +//======================================================================= +//function : ToCatchSignals +//purpose : +//======================================================================= +Standard_Boolean OSD::ToCatchSignals() +{ + return OSD_WasSetSignal; +} + //======================================================================= //function : ToCatchFloatingSignals //purpose : @@ -367,13 +377,40 @@ static LONG WINAPI WntHandler (EXCEPTION_POINTERS *lpXP) lpXP->ExceptionRecord->ExceptionInformation[0]); } +//======================================================================= +//function : SetFloatingSignals +//purpose : +//======================================================================= +void OSD::SetFloatingSignals (Standard_Boolean theFloatingSignal) +{ + fFltExceptions = theFloatingSignal; + _controlfp (theFloatingSignal ? 0 : _OSD_FPX, _OSD_FPX); +} + +//======================================================================= +//function : SetThreadLocalSignal +//purpose : +//======================================================================= +void OSD::SetThreadLocalSignal (Standard_Boolean theToCatch, + Standard_Boolean theFloatingSignal) +{ +#ifdef _MSC_VER + _set_se_translator (theToCatch ? TranslateSE : NULL); +#else + (void )theToCatch; +#endif + SetFloatingSignals (theFloatingSignal); +} + //======================================================================= //function : SetSignal //purpose : //======================================================================= -void OSD::SetSignal (const Standard_Boolean theFloatingSignal) +void OSD::SetSignal (Standard_Boolean theToCatch, + Standard_Boolean theFloatingSignal) { Standard_Mutex::Sentry aSentry (THE_SIGNAL_MUTEX); // lock the mutex to prevent simultaneous handling + OSD_WasSetSignal = theToCatch; #if !defined(OCCT_UWP) || defined(NTDDI_WIN10_TH2) OSD_Environment env ("CSF_DEBUG_MODE"); TCollection_AsciiString val = env.Value(); @@ -391,37 +428,34 @@ void OSD::SetSignal (const Standard_Boolean theFloatingSignal) // when user's code is compiled with /EHs // Replaces the existing top-level exception filter for all existing and all future threads // in the calling process - ::SetUnhandledExceptionFilter (/*(LPTOP_LEVEL_EXCEPTION_FILTER)*/ WntHandler); + ::SetUnhandledExceptionFilter (theToCatch ? WntHandler : NULL); #endif // NTDDI_WIN10_TH2 // Signal handlers will only be used when the method ::raise() will be used // Handlers must be set for every thread - if (signal (SIGSEGV, (void(*)(int))SIGWntHandler) == SIG_ERR) + void(*aHandler)(int) = theToCatch ? (void(*)(int))SIGWntHandler : (void(*)(int))SIG_DFL; + if (signal (SIGSEGV, aHandler) == SIG_ERR) cout << "signal(OSD::SetSignal) error\n"; - if (signal (SIGFPE, (void(*)(int))SIGWntHandler) == SIG_ERR) + if (signal (SIGFPE, aHandler) == SIG_ERR) cout << "signal(OSD::SetSignal) error\n"; - if (signal (SIGILL, (void(*)(int))SIGWntHandler) == SIG_ERR) + if (signal (SIGILL, aHandler) == SIG_ERR) cout << "signal(OSD::SetSignal) error\n"; // Set Ctrl-C and Ctrl-Break handler fCtrlBrk = Standard_False; #ifndef OCCT_UWP - SetConsoleCtrlHandler (&_osd_ctrl_break_handler, TRUE); -#endif -#ifdef _MSC_VER -// _se_translator_function pOldSeFunc = - _set_se_translator (TranslateSE); -#endif - - fFltExceptions = theFloatingSignal; - if (theFloatingSignal) + if (theToCatch) { - _controlfp (0, _OSD_FPX); // JR add : + SetConsoleCtrlHandler (&_osd_ctrl_break_handler, TRUE); } - else { - _controlfp (_OSD_FPX, _OSD_FPX); // JR add : + else + { + SetConsoleCtrlHandler (NULL, FALSE); } -} // end OSD :: SetSignal +#endif + + SetThreadLocalSignal (theToCatch, theFloatingSignal); +} //============================================================================ //==== ControlBreak @@ -874,55 +908,73 @@ static void SegvHandler(const int theSignal, #endif +//======================================================================= +//function : SetFloatingSignals +//purpose : +//======================================================================= +void OSD::SetFloatingSignals (Standard_Boolean theFloatingSignal) +{ + fFltExceptions = theFloatingSignal; +#if defined (__linux__) + if (theFloatingSignal) + { + feenableexcept (FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW); + } + else + { + fedisableexcept (FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW); + } +#elif defined (sgi) || defined (IRIX) + char* aTrapFpeEnv = getenv ("TRAP_FPE"); + if (aTrapFpeEnv == NULL) + { + #ifdef OCCT_DEBUG + std::cout << "On SGI you must set TRAP_FPE environment variable :\n" + "set env(TRAP_FPE) \"UNDERFL=FLUSH_ZERO;OVERFL=DEFAULT;DIVZERO=DEFAULT;INT_OVERFL=DEFAULT\" or\n" + "setenv TRAP_FPE \"UNDERFL=FLUSH_ZERO;OVERFL=DEFAULT;DIVZERO=DEFAULT;INT_OVERFL=DEFAULT\"\n"; + #endif + } +#endif +} + +//======================================================================= +//function : SetThreadLocalSignal +//purpose : +//======================================================================= +void OSD::SetThreadLocalSignal (Standard_Boolean theToCatch, + Standard_Boolean theFloatingSignal) +{ + (void )theToCatch; + SetFloatingSignals (theFloatingSignal); +} + //============================================================================ //==== SetSignal //==== Set the differents signals: //============================================================================ -void OSD::SetSignal(const Standard_Boolean aFloatingSignal) +void OSD::SetSignal (Standard_Boolean theToCatch, + Standard_Boolean theFloatingSignal) { - struct sigaction act, oact; - int stat = 0; - - if( aFloatingSignal ) { - //==== Enable the floating point exceptions =============== + OSD_WasSetSignal = theToCatch; + SetFloatingSignals (theFloatingSignal); #if defined (__sun) || defined (SOLARIS) - sigfpe_handler_type PHandler = (sigfpe_handler_type) Handler ; - stat = ieee_handler("set", "invalid", PHandler); - stat = ieee_handler("set", "division", PHandler) || stat; - stat = ieee_handler("set", "overflow", PHandler) || stat; - - //stat = ieee_handler("set", "underflow", PHandler) || stat; - //stat = ieee_handler("set", "inexact", PHandler) || stat; - - if (stat) { + int aSunStat = 0; + sigfpe_handler_type anFpeHandler = (theToCatch && theFloatingSignal) ? (sigfpe_handler_type )Handler : NULL; + aSunStat = ieee_handler ("set", "invalid", anFpeHandler); + aSunStat = ieee_handler ("set", "division", anFpeHandler) || aSunStat; + aSunStat = ieee_handler ("set", "overflow", anFpeHandler) || aSunStat; + //aSunStat = ieee_handler ("set", "underflow", anFpeHandler) || aSunStat; + //aSunStat = ieee_handler ("set", "inexact", anFpeHandler) || aSunStat; + if (aSunStat) + { #ifdef OCCT_DEBUG - cerr << "ieee_handler does not work !!! KO " << endl; -#endif - } -#elif defined (__linux__) - feenableexcept (FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW); - fFltExceptions = Standard_True; + std::cerr << "ieee_handler does not work !!! KO\n"; #endif } - else - { -#if defined (__linux__) - fedisableexcept (FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW); - fFltExceptions = Standard_False; #endif - } -#if defined (sgi) || defined (IRIX ) - char *TRAP_FPE = getenv("TRAP_FPE") ; - if ( TRAP_FPE == NULL ) { -#ifdef OCCT_DEBUG - cout << "On SGI you must set TRAP_FPE environment variable : " << endl ; - cout << "set env(TRAP_FPE) \"UNDERFL=FLUSH_ZERO;OVERFL=DEFAULT;DIVZERO=DEFAULT;INT_OVERFL=DEFAULT\" or" << endl ; - cout << "setenv TRAP_FPE \"UNDERFL=FLUSH_ZERO;OVERFL=DEFAULT;DIVZERO=DEFAULT;INT_OVERFL=DEFAULT\"" << endl ; -#endif - } -#endif + struct sigaction act, oact; //==== Save the old Signal Handler, and set the new one =================== @@ -934,14 +986,21 @@ void OSD::SetSignal(const Standard_Boolean aFloatingSignal) act.sa_flags = 0 ; #endif #ifdef SA_SIGINFO - act.sa_flags = act.sa_flags | SA_SIGINFO ; - act.sa_sigaction = /*(void(*)(int, siginfo_t *, void*))*/ Handler; + if (theToCatch) + { + act.sa_flags = act.sa_flags | SA_SIGINFO; + act.sa_sigaction = Handler; + } + else + { + act.sa_handler = SIG_DFL; + } #else - act.sa_handler = /*(SIG_PFV)*/ Handler; + act.sa_handler = theToCatch ? Handler : SIG_DFL; #endif //==== Always detected the signal "SIGFPE" ================================= - stat = sigaction(SIGFPE,&act,&oact); // ...... floating point exception + int stat = sigaction(SIGFPE,&act,&oact); // ...... floating point exception if (stat) { #ifdef OCCT_DEBUG cerr << "sigaction does not work !!! KO " << endl; @@ -1003,11 +1062,14 @@ void OSD::SetSignal(const Standard_Boolean aFloatingSignal) # endif #endif -#ifdef SA_SIGINFO - act.sa_sigaction = /*(void(*)(int, siginfo_t *, void*))*/ SegvHandler; -#else - act.sa_handler = /*(SIG_PFV)*/ SegvHandler; -#endif + if (theToCatch) + { + #ifdef SA_SIGINFO + act.sa_sigaction = /*(void(*)(int, siginfo_t *, void*))*/ SegvHandler; + #else + act.sa_handler = /*(SIG_PFV)*/ SegvHandler; + #endif + } if ( sigaction( SIGSEGV , &act , &oact ) ) // ...... segmentation violation perror("OSD::SetSignal sigaction( SIGSEGV , &act , &oact ) ") ; @@ -1027,7 +1089,6 @@ void OSD::SetSignal(const Standard_Boolean aFloatingSignal) exit (1); } #endif - } //============================================================================ diff --git a/src/QABugs/QABugs_11.cxx b/src/QABugs/QABugs_11.cxx index 3b44114f09..238374e3f1 100644 --- a/src/QABugs/QABugs_11.cxx +++ b/src/QABugs/QABugs_11.cxx @@ -55,6 +55,7 @@ #include #include #include +#include #include #include #include @@ -2458,6 +2459,68 @@ static Standard_Integer OCC6143 (Draw_Interpretor& di, Standard_Integer argc, co return 0; } + +//! Auxiliary functor. +struct TestParallelFunctor +{ + TestParallelFunctor() : myNbNotRaised (0), myNbSigSegv (0), myNbUnknown (0) {} + + Standard_Integer NbNotRaised() const { return myNbNotRaised; } + Standard_Integer NbSigSegv() const { return myNbSigSegv; } + Standard_Integer NbUnknown() const { return myNbUnknown; } + + void operator() (int theThreadId, int theTaskId) const + { + (void )theThreadId; + (void )theTaskId; + + // Test Access Violation + { + try { + OCC_CATCH_SIGNALS + int* pint = NULL; + *pint = 4; + Standard_Atomic_Increment (&myNbNotRaised); + } + #ifdef _WIN32 + catch (OSD_Exception_ACCESS_VIOLATION const&) + #else + catch (OSD_SIGSEGV const&) + #endif + { + Standard_Atomic_Increment (&myNbSigSegv); + } + catch (Standard_Failure const& ) + { + Standard_Atomic_Increment (&myNbUnknown); + } + } + } +private: + mutable volatile Standard_Integer myNbNotRaised; + mutable volatile Standard_Integer myNbSigSegv; + mutable volatile Standard_Integer myNbUnknown; +}; + +static Standard_Integer OCC30775 (Draw_Interpretor& theDI, Standard_Integer theNbArgs, const char** ) +{ + if (theNbArgs != 1) + { + std::cout << "Syntax error: wrong number of arguments\n"; + return 1; + } + + Handle(OSD_ThreadPool) aPool = new OSD_ThreadPool (4); + OSD_ThreadPool::Launcher aLauncher (*aPool, 4); + TestParallelFunctor aFunctor; + aLauncher.Perform (0, 100, aFunctor); + theDI << "NbRaised: " << (aFunctor.NbSigSegv() + aFunctor.NbUnknown()) << "\n" + << "NbNotRaised: " << aFunctor.NbNotRaised() << "\n" + << "NbSigSeg: " << aFunctor.NbSigSegv() << "\n" + << "NbUnknown: " << aFunctor.NbUnknown() << "\n"; + return 0; +} + #if defined(_MSC_VER) #pragma optimize( "", on ) #endif @@ -4816,7 +4879,8 @@ void QABugs::Commands_11(Draw_Interpretor& theCommands) { theCommands.Add("OCC5739", "OCC5739 name shape step", __FILE__, OCC5739_UniAbs, group); theCommands.Add("OCC6046", "OCC6046 nb_of_vectors size", __FILE__, OCC6046, group); theCommands.Add("OCC5698", "OCC5698 wire", __FILE__, OCC5698, group); - theCommands.Add("OCC6143", "OCC6143", __FILE__, OCC6143, group); + theCommands.Add("OCC6143", "OCC6143 catching signals", __FILE__, OCC6143, group); + theCommands.Add("OCC30775", "OCC30775 catching signals in threads", __FILE__, OCC30775, group); theCommands.Add("OCC7141", "OCC7141 [nCount] aPath", __FILE__, OCC7141, group); theCommands.Add("OCC7372", "OCC7372", __FILE__, OCC7372, group); theCommands.Add("OCC8169", "OCC8169 edge1 edge2 plane", __FILE__, OCC8169, group); diff --git a/tests/bugs/fclasses/bug28829 b/tests/bugs/fclasses/bug28829 index 74b2a60d5a..6ffa1e5460 100644 --- a/tests/bugs/fclasses/bug28829 +++ b/tests/bugs/fclasses/bug28829 @@ -3,13 +3,13 @@ pload QAcommands # start with enabled signals -dsetsignal 1 +dsetsignal 1 -fpe 1 # first, disable -dsetsignal 0 +dsetsignal 1 -fpe 0 OCC28829 # then, enable puts "REQUIRED OCC28829 All: Standard_NumericError" -dsetsignal 1 +dsetsignal 1 -fpe 1 catch {OCC28829} diff --git a/tests/bugs/fclasses/bug30775 b/tests/bugs/fclasses/bug30775 new file mode 100644 index 0000000000..e5027ceaa9 --- /dev/null +++ b/tests/bugs/fclasses/bug30775 @@ -0,0 +1,23 @@ +puts "================" +puts "0030775: OSD::SetSignal() within OSD_ThreadPool should not override global handlers" +puts "================" +puts "" + +pload QAcommands + +dsetsignal 1 -fpe 1 +set IsDone [catch {set aResult [OCC30775]} result] + +if { ${IsDone} != 0 } { + puts "result = ${result}" + puts "Faulty test case" +} else { + if { [string first "NbRaised: 100" $aResult] != -1 } { + puts "OK test case" + } else { + puts "Faulty test case" + } +} + +#dsetsignal 0 -fpe 0 +#set IsDone [catch {set aResult [OCC30775]} result] diff --git a/tests/bugs/fclasses/bug6143 b/tests/bugs/fclasses/bug6143 index 0fa01f923d..91aac0c760 100644 --- a/tests/bugs/fclasses/bug6143 +++ b/tests/bugs/fclasses/bug6143 @@ -15,9 +15,9 @@ pload QAcommands set BugNumber OCC6143 -dsetsignal 1 +dsetsignal 1 -fpe 1 set IsDone [catch {set aResult [OCC6143]} result] -dsetsignal +dsetsignal 1 -fpe 0 if { ${IsDone} != 0 } { puts "result = ${result}" diff --git a/tests/bugs/modalg_6/bug28054_1 b/tests/bugs/modalg_6/bug28054_1 index e024183e83..73febd734d 100644 --- a/tests/bugs/modalg_6/bug28054_1 +++ b/tests/bugs/modalg_6/bug28054_1 @@ -8,7 +8,7 @@ puts "" set Tol 1.0e-7 -dsetsignal 1 +dsetsignal 1 -fpe 1 restore [locate_data_file bug28054_FaceProj.brep] f1 restore [locate_data_file bug28054_EdgeProj.brep] e1 diff --git a/tests/bugs/modalg_6/bug28054_2 b/tests/bugs/modalg_6/bug28054_2 index 89958f9bb9..f7b016fc03 100644 --- a/tests/bugs/modalg_6/bug28054_2 +++ b/tests/bugs/modalg_6/bug28054_2 @@ -9,7 +9,7 @@ puts "" set Tol 1.0e-7 -dsetsignal 1 +dsetsignal 1 -fpe 1 cone c 0 0 0 45 0 trimv c1 c 5 10 diff --git a/tests/bugs/modalg_6/bug28706 b/tests/bugs/modalg_6/bug28706 index 6c8fdf1008..50b145ed4f 100644 --- a/tests/bugs/modalg_6/bug28706 +++ b/tests/bugs/modalg_6/bug28706 @@ -6,7 +6,7 @@ puts "" # Incomplete result of section operation between attached shapes ####################################################################### -dsetsignal 1 +dsetsignal 1 -fpe 1 # Before the fix, section curve was incomplete diff --git a/tests/bugs/modalg_7/bug28085_1 b/tests/bugs/modalg_7/bug28085_1 index 40eb2a8fa2..16bac220d4 100644 --- a/tests/bugs/modalg_7/bug28085_1 +++ b/tests/bugs/modalg_7/bug28085_1 @@ -4,7 +4,7 @@ puts "============" puts "" # enable FPE signals -dsetsignal 1 +dsetsignal 1 -fpe 1 restore [locate_data_file bug28085_object.brep] b1 restore [locate_data_file bug28085_tool.brep] b2 diff --git a/tests/bugs/modalg_7/bug29698 b/tests/bugs/modalg_7/bug29698 index 04deaadc2c..6e4b9d03f9 100644 --- a/tests/bugs/modalg_7/bug29698 +++ b/tests/bugs/modalg_7/bug29698 @@ -15,7 +15,7 @@ restore [locate_data_file bug26952_B41.brep] b1 restore [locate_data_file bug26952_Tank41_1.brep] b2 # enable FPE signals -dsetsignal 1 +dsetsignal 1 -fpe 1 bclearobjects bcleartools @@ -25,7 +25,7 @@ bfillds bbop result 0 # disable FPE signals -dsetsignal 0 +dsetsignal 1 -fpe 0 checkprops result -s 424.666 checknbshapes result -wire 2 -face 1 diff --git a/tests/bugs/moddata_3/bug28175_1 b/tests/bugs/moddata_3/bug28175_1 index 48ffa1b23d..73ff9c1032 100644 --- a/tests/bugs/moddata_3/bug28175_1 +++ b/tests/bugs/moddata_3/bug28175_1 @@ -8,7 +8,7 @@ puts "" # Set signals on. pload MODELING -dsetsignal 1 +dsetsignal 1 -fpe 1 # Prepare input data. restore [locate_data_file bug28175_2.brep] c diff --git a/tests/bugs/vis/bug29127 b/tests/bugs/vis/bug29127 index ebb94b043f..29a4bc0674 100644 --- a/tests/bugs/vis/bug29127 +++ b/tests/bugs/vis/bug29127 @@ -11,7 +11,7 @@ box b 1 2 3 vcaps -softMode 1 # disable FPE signals -- these often occur in software OpenGL drivers -dsetsignal 0 +dsetsignal 1 -fpe 0 vclear vinit View1 diff --git a/tests/lowalgos/intss/bug27842 b/tests/lowalgos/intss/bug27842 index e55c77dcff..b586fab983 100644 --- a/tests/lowalgos/intss/bug27842 +++ b/tests/lowalgos/intss/bug27842 @@ -6,7 +6,7 @@ puts "" # Exception in intersection algorithm if FPE is switched on ###################################################### -dsetsignal 1 +dsetsignal 1 -fpe 1 restore [locate_data_file bug27842_shape1_fix.brep] b1 restore [locate_data_file bug27842_shape2_fix.brep] b2 diff --git a/tests/lowalgos/intss/bug28085_2 b/tests/lowalgos/intss/bug28085_2 index a4ef28b2db..606f604e2a 100644 --- a/tests/lowalgos/intss/bug28085_2 +++ b/tests/lowalgos/intss/bug28085_2 @@ -6,7 +6,7 @@ puts "" foreach a [directory c_*] {unset $a} # enable FPE signals -dsetsignal 1 +dsetsignal 1 -fpe 1 restore [locate_data_file bug28883_Prism.brep] b1 restore [locate_data_file bug28883_LES_2d_shell.brep] b2 diff --git a/tests/lowalgos/intss/bug28222_1 b/tests/lowalgos/intss/bug28222_1 index d6bf565cb7..104ce8968f 100644 --- a/tests/lowalgos/intss/bug28222_1 +++ b/tests/lowalgos/intss/bug28222_1 @@ -6,7 +6,7 @@ puts "" # Intersection of two cylinders fails ####################################################################### -dsetsignal 1 +dsetsignal 1 -fpe 1 set GoodNbCurv 4 diff --git a/tests/lowalgos/intss/bug28222_2 b/tests/lowalgos/intss/bug28222_2 index 3fd838d958..c8e536dfe6 100644 --- a/tests/lowalgos/intss/bug28222_2 +++ b/tests/lowalgos/intss/bug28222_2 @@ -6,7 +6,7 @@ puts "" # Intersection of two cylinders fails ####################################################################### -dsetsignal 1 +dsetsignal 1 -fpe 1 set GoodNbCurv 4 diff --git a/tests/lowalgos/intss/bug28222_3 b/tests/lowalgos/intss/bug28222_3 index 3e1f0ac0f4..0541479753 100644 --- a/tests/lowalgos/intss/bug28222_3 +++ b/tests/lowalgos/intss/bug28222_3 @@ -6,7 +6,7 @@ puts "" # Intersection of two cylinders fails ####################################################################### -dsetsignal 1 +dsetsignal 1 -fpe 1 set GoodNbCurv 2 diff --git a/tests/perf/fclasses/strtod b/tests/perf/fclasses/strtod index 50a7369a71..9722a0ae74 100644 --- a/tests/perf/fclasses/strtod +++ b/tests/perf/fclasses/strtod @@ -39,7 +39,7 @@ puts "1M random values, 18 significant digits, in range (-1e305, 1e305)" CheckAtof 1000000 16 -1e305 1e305 # Disarm FPE signals - otherwise they will be raised if signaling NAN appears -dsetsignal 0 +dsetsignal 1 -fpe 0 puts "Special values + 1M values defined by random binary data, 10 digits" CheckAtof 1000000 10 0 0 -- 2.39.5