MantisBT - Community
View Issue Details
0025896Community[OCCT] OCCT:Modeling Algorithmspublic2015-03-05 16:222019-09-04 12:24
Istvan Csanady 
abv 
normalminor 
assignedopen 
 
[OCCT] 7.5.0* 
0025896: Modeling Algorithms - UserBreak raising uncatchable exception in boolean operations
When the parallel flag is true in BOPAlgo_PaveFiller, and the BOPAlgo_Algo::UserBreak() calls are raising Standard_NotImplemented exceptions and the exceptions can not be catched, since they are running from a new thread, and not embedded in try/catch blocks. This prevents the cancellation of boolean operations when running the pave filler parallel.
No tags attached.
related to 0025748assigned msv Open CASCADE Foundation Classes - Parallel version of progress indicator 
related to 0030842closed denix56 Community C++11 support 
related to 0029935verified bugmaster Open CASCADE Foundation Classes - introduce OSD_ThreadPool class defining a thread pool 
diff patch_parallel.diff (1,041) 2015-12-09 18:05
https://tracker.dev.opencascade.org/
diff parallel.diff (4,199) 2019-08-02 12:43
https://tracker.dev.opencascade.org/
Issue History
2015-03-05 16:22Istvan CsanadyNew Issue
2015-03-05 16:22Istvan CsanadyAssigned To => msv
2015-03-10 10:28msvAssigned Tomsv => azn
2015-03-10 10:28msvStatusnew => assigned
2015-04-09 16:49msvNote Added: 0039512
2015-04-09 16:49msvAssigned Toazn => Istvan Csanady
2015-04-09 16:49msvStatusassigned => feedback
2015-04-09 16:49msvTarget Version6.9.0 => 7.1.0
2015-04-09 16:51Istvan CsanadyNote Added: 0039513
2015-04-09 16:54abvNote Added: 0039514
2015-04-09 23:40msvAssigned ToIstvan Csanady => msv
2015-04-09 23:40msvStatusfeedback => assigned
2015-12-09 17:32Istvan CsanadyFile Added: patch.diff
2015-12-09 17:32Istvan CsanadyNote Added: 0048916
2015-12-09 17:54msvNote Added: 0048917
2015-12-09 17:54msvAssigned Tomsv => Istvan Csanady
2015-12-09 17:54msvStatusassigned => feedback
2015-12-09 18:05Istvan CsanadyFile Added: patch_parallel.diff
2015-12-09 18:05Istvan CsanadyNote Added: 0048918
2015-12-09 18:33msvFile Deleted: patch.diff
2015-12-11 10:42msvNote Added: 0049008
2016-10-26 11:56msvTarget Version7.1.0 => 7.2.0
2017-07-20 17:13msvTarget Version7.2.0 => 7.3.0
2018-02-25 21:09abvTarget Version7.3.0 => 7.4.0
2018-02-25 21:10abvAssigned ToIstvan Csanady => abv
2018-02-25 21:10abvStatusfeedback => assigned
2018-07-07 23:09abvRelationship addedrelated to 0029935
2019-08-02 12:43denix56File Added: parallel.diff
2019-08-02 12:45denix56Note Added: 0085983
2019-08-12 17:48msvTarget Version7.4.0 => 7.5.0*
2019-09-04 12:22kgvSummaryUserBreak raising uncatchable exception in boolean operations => Modeling Algorithms - UserBreak raising uncatchable exception in boolean operations
2019-09-04 12:22kgvRelationship addedrelated to 0025748
2019-09-04 12:24kgvRelationship addedrelated to 0030775
2019-09-04 12:24kgvRelationship addedrelated to 0030842

Notes
(0039512)
msv   
2015-04-09 16:49   
Dear Istvan, do you work with OCCT compiled with TBB (HAVE_TBB is defined)? I think you do not, because in HAVE_TBB branch the code has try/catch block (see OSD_Parallel.hxx:268). It is just a question, anyway.
(0039513)
Istvan Csanady   
2015-04-09 16:51   
No, I am not using TBB.
(0039514)
abv   
2015-04-09 16:54   
Not sure whether it is relevant for this issue, but note that if you use custom signal handlers (e.g. OSD::SetSignal()), on some platforms this works on per-thread basis, thus handlers should be armed separately for each thread.
(0048916)
Istvan Csanady   
2015-12-09 17:32   
Patch is attached
(0048917)
msv   
2015-12-09 17:54   
Dear Istvan, the attached patch is relevant not to this bug, but rather to "Do not copy plane if Alt is 0.0 in BRepFill_OffsetWire".
(0048918)
Istvan Csanady   
2015-12-09 18:05   
corrected, sorry.
(0049008)
msv   
2015-12-11 10:42   
The proposed patch is not perfect.

1. It catches exception in the loop by tasks. It means that if user break event takes place the repetitive try/catch will hit on each iteration and the loop will continue till end. It is better to surround the whole loop into try block.

2. It hides all exceptions. I.e. if some exception not connected with user break takes place then the algorithm will continue working with some task left incomplete. This can lead to unpredictable results.

The right way is to implement mechanism that will allow catching exceptions in parallel tasks (i.e. in other threads), stop all other parallel executions (or simply stop scheduling new tasks) and re-throw exception when main thread takes control again. This way is implemented in TBB scheduler.
(0085983)
denix56   
2019-08-02 12:45   
I ve uploaded patch that allows to rethrow exceptions from threads. However, it requires C++11