View Issue Details

IDProjectCategoryView StatusLast Update
0026061CommunityOCCT:Application Frameworkpublic2015-05-14 16:35
ReporterVico Liang Assigned Tobugmaster  
PrioritynormalSeveritycrash 
Status closedResolutionfixed 
PlatformWindowsOSVC++ 2013 
Target Version6.9.0Fixed in Version6.9.0 
Summary0026061: TNaming_Selector crash in select method.
Description> TKCAF.dll!TNaming_Localizer::Ancestors(const TopoDS_Shape & In, const TopAbs_ShapeEnum TS) Line 255 C++
     TKCAF.dll!TNaming_Localizer::FindNeighbourg(const TopoDS_Shape & Sol, const TopoDS_Shape & S, TopTools_MapOfShape & Neighbourg) Line 553 C++
     TKCAF.dll!Filter(const TDF_Label & F, TNaming_Scope & MDF, const TopoDS_Shape & S, const TopoDS_Shape & Context, TNaming_Localizer & Localizer, Handle_TNaming_NamedShape & NS, const int Lev) Line 687 C++
     TKCAF.dll!BuildName(const TDF_Label & F, TNaming_Scope & MDF, const TopoDS_Shape & Selection, const TopoDS_Shape & Context, const Handle_TNaming_NamedShape & Stop, const unsigned int Geom) Line 1132 C++
     TKCAF.dll!BuildNameInNS(const TDF_Label & F, TNaming_Scope & MDF, const TopoDS_Shape & S, const Handle_TNaming_NamedShape & Context, const Handle_TNaming_NamedShape & Stop, const unsigned int Geometry) Line 944 C++
     TKCAF.dll!BuildName(const TDF_Label & F, TNaming_Scope & MDF, const TopoDS_Shape & Selection, const TopoDS_Shape & Context, const Handle_TNaming_NamedShape & Stop, const unsigned int Geom) Line 1049 C++
     TKCAF.dll!BuildName(const TDF_Label & F, TNaming_Scope & MDF, const TopoDS_Shape & Selection, const TopoDS_Shape & Context, const Handle_TNaming_NamedShape & Stop, const unsigned int Geom) Line 1051 C++
     TKCAF.dll!TNaming_Naming::Name(const TDF_Label & F, const TopoDS_Shape & S, const TopoDS_Shape & Context, const unsigned int Geom, const unsigned int KeepOrientation, const unsigned int BNProblem) Line 1834 C++
     TKCAF.dll!TNaming_Selector::Select(const TopoDS_Shape & Selection, const TopoDS_Shape & Context, const unsigned int Geometry, const unsigned int KeepOrientation) Line 368 C++
     TKCAF.dll!TNaming_Selector::Select(const TopoDS_Shape & Selection, const unsigned int Geometry, const unsigned int KeepOrientation) Line 422 C++
Steps To Reproducevoid BugReproduce(const TDF_Label& theLabel)
{
    gp_Pln aPlane(gp::Origin(), gp::DZ());
    BRepBuilderAPI_MakeFace aMF(aPlane, -10, 10, -10, 10);
    TopoDS_Shape aFace = aMF.Shape();

    TDF_Label aFaceLabel = theLabel.FindChild(900, Standard_True);
    TNaming_Builder aFaceBuilder(aFaceLabel);
    aFaceBuilder.Generated(aFace);

    gp_Trsf aMirrorTrsf;
    aMirrorTrsf.SetMirror(gp_Ax2(gp_Pnt(0, 0, 10), gp::DZ()));
    BRepBuilderAPI_Transform aMakeMirror(aFace, aMirrorTrsf, Standard_False);
    TopoDS_Shape aFaceMirror = aMakeMirror.Shape();

    TDF_Label aFaceMirrorLabel = theLabel.FindChild(901, Standard_True);
    TNaming_Builder aFaceMirrorBuilder(aFaceMirrorLabel);
    aFaceMirrorBuilder.Generated(aFace, aFaceMirror);

    gp_Trsf aTranslateTrsf;
    aTranslateTrsf.SetTranslation(gp_Vec(0, 0, -5.0));
    BRepBuilderAPI_Transform aMakeTranslate(aFace, aTranslateTrsf, Standard_False);
    TopoDS_Shape aFaceTranslate = aMakeTranslate.Shape();

    TDF_Label aFaceTranslateLabel = theLabel.FindChild(902, Standard_True);
    TNaming_Builder aFaceTranslateBuilder(aFaceTranslateLabel);
    aFaceTranslateBuilder.Modify(aFace, aFaceTranslate);

    BRepBuilderAPI_Transform aFaceMirrorTranslate(aFaceMirror, aTranslateTrsf, Standard_False);
    TopoDS_Shape aFaceMirrorTranslateShape = aFaceMirrorTranslate.Shape();

    TDF_Label aFaceMirrorTranslateLabel = theLabel.FindChild(903, Standard_True);
    TNaming_Builder aFaceMirrorTranslateBuilder(aFaceMirrorTranslateLabel);
    aFaceMirrorTranslateBuilder.Modify(aFaceMirror, aFaceMirrorTranslateShape);

    TDF_Label aFaceMirrorSelectLabel = theLabel.FindChild(904, Standard_True);
    TNaming_Selector aSeletor(aFaceMirrorSelectLabel);
    aSeletor.Select(aFaceMirrorTranslateShape);
}
TagsNo tags attached.
Test case numberbugs caf(016) bug26061

Attached Files

  • t26061.tcl (1,129 bytes)

Activities

Vico Liang

2015-04-13 14:15

developer   ~0039628

Hi ABV,

I dare to ask why is this issue unscheduled?

It is a normal workflow to use the naming mechnism in OCAF. The workflow to reproduce this issue is to create a primitive rectangle and then make a duplicate mirror from that rectangle, after that translate the rectangle and its mirror duplication. Finally Select the mirror duplication rectangle will cause crash.

If this issue won't be resolved, it's impossible to use the naming mechinsm of OCCT. What a pity. OCCT naming mechnism is so powerful but there is no body pay attention to it including OCCT team.

Best Regards,
Vico

abv

2015-04-13 14:29

manager   ~0039629

Hello Vico Liang,
Target Version could not be 6.8.0 since that version has been already released, and issue with wrong target version may fall out of the consideration when we review the issues. That is why I changed it. I let Sergey to decide on more appropriate target version.

Vico Liang

2015-04-13 14:49

developer   ~0039636

Hi ABV,

Thanks for your answer and considering my thought. It's fine to change the target version according to Sergey's schedule. It would be appriciated if this issue can be resolved in 6.9.0.

Regards,
Vico

git

2015-04-14 18:26

administrator   ~0039706

Branch CR26061 has been created by szy.

SHA-1: 7cb6fb64c00a2d7a35c2221ccad366fc00566795


Detailed log of new commits:

Author: szy
Date: Tue Apr 14 18:26:32 2015 +0300

    TNaming_Selector crash in select method.
    
    Removed obsolete method with single argument.

szy

2015-04-14 18:36

manager   ~0039710

The reason of the exception is obsolete method with one argument => TNaming_Selector::Select(theSelection).
In fact this method is 'relict' kept because really it was never used during years and it should be removed immediately it is not compatible with current algorithm.
The API supposed to be used:
TNaming_Selector::Select(theSelection, theContext), where 'theSelection' is sub-shape and 'theContext' is a main shape containing the specified sub-shape to be selected.

szy

2015-04-14 18:38

manager   ~0039711

Any additional test case is not needed.

Vico Liang

2015-04-15 03:43

developer   ~0039730

After removing the obsolte Select method, the exception stack frame is no much different.

     TKCAF.dll!TNaming_Localizer::Ancestors(const TopoDS_Shape & In, const TopAbs_ShapeEnum TS) Line 255 C++
     TKCAF.dll!TNaming_Localizer::FindNeighbourg(const TopoDS_Shape & Sol, const TopoDS_Shape & S, TopTools_MapOfShape & Neighbourg) Line 553 C++
     TKCAF.dll!Filter(const TDF_Label & F, TNaming_Scope & MDF, const TopoDS_Shape & S, const TopoDS_Shape & Context, TNaming_Localizer & Localizer, Handle_TNaming_NamedShape & NS, const int Lev) Line 687 C++
     TKCAF.dll!BuildName(const TDF_Label & F, TNaming_Scope & MDF, const TopoDS_Shape & Selection, const TopoDS_Shape & Context, const Handle_TNaming_NamedShape & Stop, const unsigned int Geom) Line 1132 C++
     TKCAF.dll!BuildNameInNS(const TDF_Label & F, TNaming_Scope & MDF, const TopoDS_Shape & S, const Handle_TNaming_NamedShape & Context, const Handle_TNaming_NamedShape & Stop, const unsigned int Geometry) Line 944 C++
     TKCAF.dll!BuildName(const TDF_Label & F, TNaming_Scope & MDF, const TopoDS_Shape & Selection, const TopoDS_Shape & Context, const Handle_TNaming_NamedShape & Stop, const unsigned int Geom) Line 1049 C++
     TKCAF.dll!BuildName(const TDF_Label & F, TNaming_Scope & MDF, const TopoDS_Shape & Selection, const TopoDS_Shape & Context, const Handle_TNaming_NamedShape & Stop, const unsigned int Geom) Line 1051 C++
     TKCAF.dll!TNaming_Naming::Name(const TDF_Label & F, const TopoDS_Shape & S, const TopoDS_Shape & Context, const unsigned int Geom, const unsigned int KeepOrientation, const unsigned int BNProblem) Line 1834 C++
> TKCAF.dll!TNaming_Selector::Select(const TopoDS_Shape & Selection, const TopoDS_Shape & Context, const unsigned int Geometry, const unsigned int KeepOrientation) Line 368 C++

mkv

2015-04-15 12:10

tester   ~0039763

Dear BugMaster,
Branch CR26061 from occt git-repository (and master from products git-repository) was compiled on Linux and Windows platforms on Release mode.
SHA-1: 7cb6fb64c00a2d7a35c2221ccad366fc00566795

There are following compilation errors:
Linux:
http://jenkins-test-04.nnov.opencascade.com:8080/view/CR26061-master/job/CR26061-master_build_occt_linux/2/parsed_console/
../../../../src/DNaming/DNaming_SelectionCommands.cxx:122: error: no matching function for call to ‘TNaming_Selector::Select(TopoDS_Shape&, Standard_Boolean&)’

Windows:
http://jenkins-test-04.nnov.opencascade.com:8080/view/CR26061-master/job/CR26061-master_build_occt_windows_64/1/parsed_console/
125>..\..\..\src\DNaming\DNaming_SelectionCommands.cxx(122): error C2664: 'TNaming_Selector::Select' : cannot convert parameter 2 from 'Standard_Boolean' to 'const TopoDS_Shape &' [y:\builds\vc10\CR26061-master-occt-64\adm\msvc\vc10\TKDCAF.vcxproj]
Reason: cannot convert from 'Standard_Boolean' to 'const TopoDS_Shape'
No constructor could take the source type, or constructor overload resolution was ambiguous
DNaming_SphereDriver.cxx
...
..\..\..\src\DNaming\DNaming_SelectionCommands.cxx(122): error C2664: 'TNaming_Selector::Select' : cannot convert parameter 2 from 'Standard_Boolean' to 'const TopoDS_Shape &' [y:\builds\vc10\CR26061-master-occt-64\adm\msvc\vc10\TKDCAF.vcxproj]
...
125>..\..\..\src\DNaming\DNaming_SelectionCommands.cxx(122): error C2664: 'TNaming_Selector::Select' : cannot convert parameter 2 from 'Standard_Boolean' to 'const TopoDS_Shape &'
125> Reason: cannot convert from 'Standard_Boolean' to 'const TopoDS_Shape'
No constructor could take the source type, or constructor overload resolution was ambiguous
DNaming_SphereDriver.cxx
...
..\..\..\src\DNaming\DNaming_SelectionCommands.cxx(122): error C2664: 'TNaming_Selector::Select' : cannot convert parameter 2 from 'Standard_Boolean' to 'const TopoDS_Shape &'
...
125>..\..\..\src\DNaming\DNaming_SelectionCommands.cxx(122): error C2664: 'TNaming_Selector::Select' : cannot convert parameter 2 from 'Standard_Boolean' to 'const TopoDS_Shape &'
125> Reason: cannot convert from 'Standard_Boolean' to 'const TopoDS_Shape'
No constructor could take the source type, or constructor overload resolution was ambiguous
DNaming_SphereDriver.cxx
...
..\..\..\src\DNaming\DNaming_SelectionCommands.cxx(122): error C2664: 'TNaming_Selector::Select' : cannot convert parameter 2 from 'Standard_Boolean' to 'const TopoDS_Shape &'

git

2015-04-20 17:24

administrator   ~0040058

Branch CR26061_1 has been created by szy.

SHA-1: b5ddb652d4e258944deb806e8a538047be50f168


Detailed log of new commits:

Author: szy
Date: Mon Apr 20 17:24:34 2015 +0300

    TNaming_Selector crash in select method.
    
    TNaming_Localizer is protected from not expected input arguments.

szy

2015-04-20 17:46

manager   ~0040059

Fixed in CR26061_1.
TNaming_Localizer is protected from not expected input arguments.

Note. The provided procedure BugReproduce(const TDF_Label& theLabel) can be used exclusively for testing purpose. For modeling purpose it looks like meaningless.

szy

2015-04-20 17:50

manager   ~0040060

Last edited: 2015-04-21 12:16

Reviewed.
1.Can be tested.
2. Test to be used attached => t26061.tcl

szy

2015-04-21 12:15

manager  

t26061.tcl (1,129 bytes)

mkv

2015-04-22 17:57

tester   ~0040123

Dear BugMaster,
Branch CR26061_1 from occt git-repository (and master from products git-repository) was compiled on Linux, MacOS and Windows platforms and tested on Release mode.
SHA-1: b5ddb652d4e258944deb806e8a538047be50f168

Number of compiler warnings:

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

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

Regressions/Differences:
No regressions/differences

Testing cases:
http://occt-tests/CR26061-1-master-occt-64/Debian60-64/bugs/caf/bug26061.html
http://occt-tests/CR26061-1-master-occt-64/Windows-64-VC10/bugs/caf/bug26061.html
bugs caf(016) bug26061: OK

Testing on Linux:
occt component :
Total MEMORY difference: 94959375 / 94540592 [+0.44%]
Total CPU difference: 52975.66999999973 / 52230.219999999455 [+1.43%]
products component :
Total MEMORY difference: 23698378 / 23676267 [+0.09%]
Total CPU difference: 17505.649999999983 / 17777.469999999976 [-1.53%]

Testing on Windows:
occt component :
Total MEMORY difference: 57155470 / 57165566 [-0.02%]
Total CPU difference: 16049.570081198994 / 16283.477980599077 [-1.44%]
products component :
Total MEMORY difference: 15561099 / 15564896 [-0.02%]
Total CPU difference: 6374.590862499969 / 6585.207812599981 [-3.20%]

There are no differences in images found by testdiff.

git

2015-04-22 17:58

administrator   ~0040124

Branch CR26061_1 has been updated by mkv.

SHA-1: 6c6f88807ea9e73931e83c5d6cb597ae77f9bc53


Detailed log of new commits:

Author: mkv
Date: Wed Apr 22 17:56:30 2015 +0300

    Test case for issue CR26061

mkv

2015-04-22 17:59

tester   ~0040125

Dear szy,
could you please review following test case
bugs caf(016) bug26061

szy

2015-04-23 10:19

manager   ~0040151

Yes, bu26061 looks Ok.
Note. This test (which presents the initially reported C++ sample in form of Draw command only) has no too much sense as it doesn't respect several Naming rules.
Therefore it can be used only to check and reproduce the specified exception.
szy

mkv

2015-04-23 16:18

tester   ~0040169

Dear BugMaster,
Branch CR26061_1 is TESTED.

git

2015-05-14 16:35

administrator   ~0041082

Branch CR26061 has been deleted by inv.

SHA-1: 7cb6fb64c00a2d7a35c2221ccad366fc00566795

git

2015-05-14 16:35

administrator   ~0041083

Branch CR26061_1 has been deleted by inv.

SHA-1: 6c6f88807ea9e73931e83c5d6cb597ae77f9bc53

Related Changesets

occt: master 57c718c4

2015-04-23 14:28:40

szy


Committer: bugmaster Details Diff
0026061: TNaming_Selector crash in select method.

TNaming_Selector crash in select method.

TNaming_Localizer is protected from not expected input arguments.

Test case for issue CR26061
Affected Issues
0026061
mod - src/TNaming/TNaming_Localizer.cxx Diff File
add - tests/bugs/caf/bug26061 Diff File

Issue History

Date Modified Username Field Change
2015-04-12 17:52 Vico Liang New Issue
2015-04-12 17:52 Vico Liang Assigned To => szy
2015-04-12 21:56 abv Target Version 6.8.0 => Unscheduled
2015-04-13 14:15 Vico Liang Note Added: 0039628
2015-04-13 14:29 abv Note Added: 0039629
2015-04-13 14:49 Vico Liang Note Added: 0039636
2015-04-14 14:45 szy Target Version Unscheduled => 7.1.0
2015-04-14 18:18 szy Status new => assigned
2015-04-14 18:26 git Note Added: 0039706
2015-04-14 18:36 szy Note Added: 0039710
2015-04-14 18:36 szy Status assigned => resolved
2015-04-14 18:36 szy Target Version 7.1.0 => 6.9.0
2015-04-14 18:38 szy Note Added: 0039711
2015-04-14 18:38 szy Assigned To szy => mkv
2015-04-14 18:38 szy Status resolved => reviewed
2015-04-15 03:43 Vico Liang Note Added: 0039730
2015-04-15 12:10 mkv Note Added: 0039763
2015-04-15 12:10 mkv Assigned To mkv => szy
2015-04-15 12:10 mkv Status reviewed => assigned
2015-04-15 12:12 mkv Test case number => Not needed
2015-04-16 12:44 szy Target Version 6.9.0 => 7.0.0
2015-04-20 17:24 git Note Added: 0040058
2015-04-20 17:46 szy Note Added: 0040059
2015-04-20 17:46 szy Status assigned => resolved
2015-04-20 17:50 szy Note Added: 0040060
2015-04-20 17:50 szy Assigned To szy => mkv
2015-04-20 17:50 szy Status resolved => reviewed
2015-04-20 17:50 szy Target Version 7.0.0 => 6.9.0
2015-04-21 12:15 szy File Added: t26061.tcl
2015-04-21 12:16 szy Note Edited: 0040060
2015-04-22 17:57 mkv Note Added: 0040123
2015-04-22 17:58 git Note Added: 0040124
2015-04-22 17:59 mkv Note Added: 0040125
2015-04-22 17:59 mkv Assigned To mkv => szy
2015-04-22 17:59 mkv Status reviewed => feedback
2015-04-22 17:59 mkv Test case number Not needed => bugs caf(016) bug26061
2015-04-23 10:19 szy Note Added: 0040151
2015-04-23 10:19 szy Assigned To szy => bugmaster
2015-04-23 10:19 szy Status feedback => reviewed
2015-04-23 16:18 mkv Note Added: 0040169
2015-04-23 16:18 mkv Status reviewed => tested
2015-04-25 17:37 bugmaster Changeset attached => occt master 57c718c4
2015-04-25 17:37 bugmaster Status tested => verified
2015-04-25 17:37 bugmaster Resolution open => fixed
2015-05-14 15:28 aiv Status verified => closed
2015-05-14 15:30 aiv Fixed in Version => 6.9.0
2015-05-14 16:35 git Note Added: 0041082
2015-05-14 16:35 git Note Added: 0041083