DiscussionsIssue archiveOCCT:Modeling Algorithms

Archived issue #0026701

BOPAlgo_Builder::Perform crash.

CommunityOCCT:Modeling Algorithmsclosed23 public notes

Search issues

Description

The stackframe as following:

     MSVCR120D.dll![revision removed]() Unknown
     MSVCR120D.dll![revision removed]() Unknown
     MSVCR120D.dll![revision removed]() Unknown
     TKernel.dll!Standard_MMgrRaw::Free(void * theStorage) Line 56 C++
     TKernel.dll!Standard::Free(void * const theStorage) Line 235 C++
     [External Code]
     TKBRep.dll!BRep_ListOfCurveRepresentation::Remove(BRep_ListIteratorOfListOfCurveRepresentation & It) Line 257 C++
> TKBRep.dll!UpdateCurves(BRep_ListOfCurveRepresentation & lcr, const Handle_Geom2d_Curve & C, const Handle_Geom_Surface & S, const TopLoc_Location & L) Line 135 C++
     TKBRep.dll!BRep_Builder::UpdateEdge(const TopoDS_Edge & E, const Handle_Geom2d_Curve & C, const Handle_Geom_Surface & S, const TopLoc_Location & L, const double Tol) Line 632 C++
     TKBO.dll!BOPTools_AlgoTools2D::BuildPCurveForEdgeOnPlane(const TopoDS_Edge & aE, const TopoDS_Face & aF) Line 504 C++
     TKBO.dll!tbb::internal::parallel_for_body<BOPCol_Functor<BOPAlgo_BPC,BOPCol_NCVector<BOPAlgo_BPC> >,int>::operator()(const tbb::blocked_range<int> & r) Line 163 C++
     TKBO.dll!tbb::interface7::internal::partition_type_base<tbb::interface7::internal::auto_partition_type>::execute<tbb::interface7::internal::start_for<tbb::blocked_range<int>,tbb::internal::parallel_for_body<BOPCol_Functor<BOPAlgo_BPC,BOPCol_NCVector<BOPAlgo_BPC> >,int>,tbb::auto_partitioner const >,tbb::blocked_range<int> >(tbb::interface7::internal::start_for<tbb::blocked_range<int>,tbb::internal::parallel_for_body<BOPCol_Functor<BOPAlgo_BPC,BOPCol_NCVector<BOPAlgo_BPC> >,int>,tbb::auto_partitioner const > & start, tbb::blocked_range<int> & range) Line 265 C++
     TKBO.dll!tbb::interface7::internal::start_for<tbb::blocked_range<int>,tbb::internal::parallel_for_body<BOPCol_Functor<BOPAlgo_BPC,BOPCol_NCVector<BOPAlgo_BPC> >,int>,tbb::auto_partitioner const >::execute() Line 128 C++
     tbb_debug.dll!tbb::internal::custom_scheduler<tbb::internal::IntelSchedulerTraits>::local_wait_for_all(tbb::task & parent, tbb::task * child) Line 463 C++
     tbb_debug.dll!tbb::internal::generic_scheduler::local_spawn_root_and_wait(tbb::task & first, tbb::task * & next) Line 649 C++
     tbb_debug.dll!tbb::internal::generic_scheduler::spawn_root_and_wait(tbb::task & first, tbb::task * & next) Line 658 C++
     TKBO.dll!tbb::task::spawn_root_and_wait(tbb::task & root) Line 734 C++
     TKBO.dll!tbb::interface7::internal::start_for<tbb::blocked_range<int>,tbb::internal::parallel_for_body<BOPCol_Functor<BOPAlgo_BPC,BOPCol_NCVector<BOPAlgo_BPC> >,int>,tbb::auto_partitioner const >::run(const tbb::blocked_range<int> & range, const tbb::internal::parallel_for_body<BOPCol_Functor<BOPAlgo_BPC,BOPCol_NCVector<BOPAlgo_BPC> >,int> & body, const tbb::auto_partitioner & partitioner) Line 90 C++
     TKBO.dll!tbb::parallel_for<tbb::blocked_range<int>,tbb::internal::parallel_for_body<BOPCol_Functor<BOPAlgo_BPC,BOPCol_NCVector<BOPAlgo_BPC> >,int> >(const tbb::blocked_range<int> & range, const tbb::internal::parallel_for_body<BOPCol_Functor<BOPAlgo_BPC,BOPCol_NCVector<BOPAlgo_BPC> >,int> & body, const tbb::auto_partitioner & partitioner) Line 201 C++
     TKBO.dll!tbb::strict_ppl::parallel_for_impl<int,BOPCol_Functor<BOPAlgo_BPC,BOPCol_NCVector<BOPAlgo_BPC> >,tbb::auto_partitioner const >(int first, int last, int step, const BOPCol_Functor<BOPAlgo_BPC,BOPCol_NCVector<BOPAlgo_BPC> > & f, const tbb::auto_partitioner & partitioner) Line 256 C++
     TKBO.dll!tbb::strict_ppl::parallel_for<int,BOPCol_Functor<BOPAlgo_BPC,BOPCol_NCVector<BOPAlgo_BPC> > >(int first, int last, const BOPCol_Functor<BOPAlgo_BPC,BOPCol_NCVector<BOPAlgo_BPC> > & f) Line 283 C++
     TKBO.dll!OSD_Parallel::For<BOPCol_Functor<BOPAlgo_BPC,BOPCol_NCVector<BOPAlgo_BPC> > >(const int theBegin, const int theEnd, const BOPCol_Functor<BOPAlgo_BPC,BOPCol_NCVector<BOPAlgo_BPC> > & theFunctor, const unsigned int isForceSingleThreadExecution) Line 270 C++
     TKBO.dll!BOPAlgo_PaveFiller::Prepare() Line 758 C++
     TKBO.dll!BOPAlgo_PaveFiller::PerformInternal() Line 225 C++
     TKBO.dll!BOPAlgo_PaveFiller::Perform() Line 202 C++
     TKBO.dll!BOPAlgo_Builder::Perform() Line 281 C++

Steps to reproduce

brestore Attachment 1 (BREP) d
brunparallel 1
bclearobjects
eval baddobjects [explode d]
bfillds
bbuild result

Public activity

23 archived notes

Participants are labeled by their role within this record.

01Author
The additional crash is using TBB allocator, but the crash stack frame is similar.
02Commenter 2
Dear Vico, please attach input data and script to reproduce the problem.
03Author
Dear msv,

It seems a data race in parallel comutation. I'm preparing the data, but the issue can't be reprodueced steadily. Would you analysis from the crash stack frame? I'm afraid it's not easy to provide you data to reproduce the problem.
04Commenter 4
Dear Vico, the probability of finding the cause of problem by analysis of stack frame in the case of such problem is very low, because the source code that contains an error (the source of problem) can be out of current stack frame.
Therefore it is crucial to have the input data that leads to the problem, even if it is not stably reproduced. We can use the automatic checking tools like valgrind or Intel Inspector in order to catch such a bug.
05Author
Dear msv,

I have uploaded file Attachment 1 (BREP), the model is a compound.

To reproduce the issue, please get all the subshapes in the compound and then do a general fuse operation.

        TopTools_ListOfShape aShapes;
        TopoDS_Shape aShape = //load Attachment 1 (BREP)
        //
        for(TopoDS_Iterator aIter(aShape); aIter.More(); aIter.Next())
        {
             aShapes.Add(aIter.Value());
        }
        BOPAlgo_Builder aGFA;
        aGFA.SetArguments(aShapes);
        // Turn on parallel algorithm
        aGFA.SetRunParallel(Standard_True);
        aGFA.Perform();
06Commenter 6
Thank you, Vico, for the data.
07Commenter 7
Dear Ilya, please start with creating the draw script to reproduce the problem. I think we have enough commands in Draw for that.
08Commenter 2
Branch [archived branch] has been created by Participant.

[revision removed]


Detailed log of new commits:

Author: isn
Date: Mon Sep 21 20:50:26 2015 +0300

    0026701: BOPAlgo_Builder::Perform crash.
    (data race)
09Commenter 9
script to reproduce:
brestore Attachment 1 (BREP) d
explode d
brunparallel 1
bclearobjects
baddobjects d_1 d_2 d_3 d_4 d_5 d_6 d_7 d_8 d_9 d_10 d_11 d_12 d_13 d_14 d_15 d_16 d_17 d_18 d_19 d_20 d_21 d_22 d_23 d_24 d_25 d_26 d_27 d_28 d_29 d_30 d_31 d_32 d_33 d_34 d_35 d_36
bfillds
10Commenter 10
Failures:

boolean bcut_complex O7
boolean bopcommon_complex K2 K3
boolean bopcut_complex K9
boolean bsection D1 E1 M8 M9 N2 N4 N5 N6 N7
bugs modalg_1 buc60531_1 buc60531_2 buc60865 buc60880 bug1255 bug1255_1 bug17194_1 bug17194_2
bugs modalg_4 bug81 bug82 bug6289 bug6502 bug6766_1 bug6766_2 bug6766_3 bug6766_4 fra62369
bugs modalg_5 bug23958 bug25470
bugs modalg_6 bug25937_1 bug25937_2 bug25937_3
bugs moddata_2 bug6450_2
11Commenter 11
Regarding script to reproduce: please add it to commit as a test case
12Commenter 2
Branch [archived branch] has been updated by Participant.

[revision removed]


Detailed log of new commits:

Author: msv
Date: Tue Sep 22 09:13:26 2015 +0300

    Add comments and make minor cosmetic changes.

13Commenter 13
Reviewed.
14Commenter 2
Branch [archived branch] has been updated by Participant.

[revision removed]


Detailed log of new commits:

Author: isn
Date: Tue Sep 22 10:34:19 2015 +0300

    corrections

15Commenter 2
Branch [archived branch] has been updated by Participant.

[revision removed]


Detailed log of new commits:

Author: msv
Date: Tue Sep 22 12:23:47 2015 +0300

    Correction

16Commenter 16
Dear BugMaster,
Branch CR26701 from occt git-repository (and master from products git-repository) was compiled on Linux, MacOS and Windows platforms and tested on Release mode.
[revision removed]

Number of compiler warnings:

occt component :
Linux: 15 (15 on master)
Windows: 0 (0 on master)

products component :
Linux: 39 (39 on master)
Windows: 0 (0 on master)

Regressions/Differences/Improvements:
No regressions/differences

Testing cases:
http://occt-tests/CR26701-master-occt-64/Debian70-64/bugs/modalg_6/bug26701.html
http://occt-tests/CR26701-master-occt-64/Windows-64-VC10/bugs/modalg_6/bug26701.html
bugs modalg_6 bug26701: OK

Testing on Linux:
occt component :
Total MEMORY difference: 92568895 / 92151446 [+0.45%]
Total CPU difference: 18896.16999999891 / 18842.199999998986 [+0.29%]
products component :
Total MEMORY difference: 25926924 / 25980951 [-0.21%]
Total CPU difference: 7239.480000000009 / 7208.589999999996 [+0.43%]

Testing on Windows:
occt component :
Total MEMORY difference: 56807230 / 56825790 [-0.03%]
Total CPU difference: 16997.41655709906 / 16810.58975949913 [+1.11%]
products component :
Total MEMORY difference: 16784757 / 16790438 [-0.03%]
Total CPU difference: 5494.916823599973 / 5526.49142599996 [-0.57%]

There are no differences in images found by testdiff.
17Commenter 2
Branch [archived branch] has been updated by Participant.

[revision removed]


Detailed log of new commits:

Author: mkv
Date: Wed Sep 23 14:31:35 2015 +0300

    Test case for issue CR26701

18Commenter 18
Dear msv,
could you please review following test case
bugs modalg_6 bug26701
19Commenter 19
Please simplify the script using steps for reproduce.
20Commenter 2
Branch [archived branch] has been updated by Participant.

[revision removed]


Detailed log of new commits:

Author: mkv
Date: Wed Sep 23 16:15:39 2015 +0300

    Correction of test case for issue CR26701

21Commenter 21
Dear BugMaster,
following test case is corrected and pushed to branch CR26701 of occt git-repository
bugs modalg_6 bug26701
22Commenter 22
Dear BugMaster,
Branch CR26701 is TESTED.
23Commenter 2
Branch [archived branch] has been deleted by Commenter 1.

[revision removed]