View Issue Details

IDProjectCategoryView StatusLast Update
0025429CommunityOCCT:Codingpublic2017-07-20 19:48
ReporterEpy Assigned Tobugmaster  
PrioritynormalSeveritymajor 
Status closedResolutionduplicate 
PlatformAll 
Product Version6.7.1 
Target Version7.2.0 
Summary0025429: Invalid use of NULL references
DescriptionOriginal summary: Increased testing failures with Clang 3.4 and later

With newer versions of Clang, the number of bad and failed tests has increased severely. Lots of SIGILLs and SIGFPEs. At least part of the problem is using NULL as a reference (C++ does not allow NULL references), e.g.

inline TColStd_Array1OfReal& BSplCLib::NoWeights()
{
  return (*((TColStd_Array1OfReal*) NULL));
}

Here is a possibly complete list of instances where this occurs:

src/BRep/BRep_CurveRepresentation.cxx:186: return *((Handle(Geom_Curve)*) NULL);
src/BRep/BRep_CurveRepresentation.cxx:211: return *((Handle(Geom_Surface)*) NULL);
src/BRep/BRep_CurveRepresentation.cxx:223: return *((Handle(Geom2d_Curve)*) NULL);
src/BRep/BRep_CurveRepresentation.cxx:234: return *((Handle(Geom2d_Curve)*) NULL);
src/BRep/BRep_CurveRepresentation.cxx:266: return *((GeomAbs_Shape*) NULL);
src/BRep/BRep_CurveRepresentation.cxx:288: return *((Handle(Geom_Surface)*) NULL);
src/BRep/BRep_CurveRepresentation.cxx:300: return *((TopLoc_Location*) NULL);
src/BRep/BRep_CurveRepresentation.cxx:313: return *((Handle(Poly_Polygon3D)*) NULL);
src/BRep/BRep_CurveRepresentation.cxx:335: return *((Handle(Poly_Polygon2D)*) NULL);
src/BRep/BRep_CurveRepresentation.cxx:357: return *((Handle(Poly_PolygonOnTriangulation)*) NULL);
src/BRep/BRep_CurveRepresentation.cxx:393: return *(Handle(Poly_PolygonOnTriangulation)*)NULL;
src/BRep/BRep_CurveRepresentation.cxx:404: return *(Handle(Poly_Triangulation)*)NULL;
src/BRep/BRep_CurveRepresentation.cxx:417: return *((Handle(Poly_Polygon2D)*) NULL);
src/BRep/BRep_PointRepresentation.cxx:136: return *((Handle(Geom_Curve)*) NULL);
src/BRep/BRep_PointRepresentation.cxx:159: return *((Handle(Geom2d_Curve)*) NULL);
src/BRep/BRep_PointRepresentation.cxx:182: return *((Handle(Geom_Surface)*) NULL);
src/BSplCLib/BSplCLib.lxx:38: return (*((TColStd_Array1OfReal*) NULL));
src/BSplCLib/BSplCLib.lxx:48: return (*((TColStd_Array1OfInteger*) NULL));
src/BSplSLib/BSplSLib.lxx:100: return (*((TColStd_Array2OfReal*) NULL));
src/Expr/Expr_BinaryExpression.cxx:77: return *( ( Handle_Expr_GeneralExpression* )NULL );
src/NCollection/NCollection_DoubleMap.hxx:133: return * (TheKey2Type *) NULL; // For compiler
src/NCollection/NCollection_IndexedMap.hxx:123: return * (TheKeyType *) NULL; // This for compiler
src/NCollection/NCollection_Map.hxx:113: return * (TheKeyType *) NULL; // For compiler
src/PLib/PLib.lxx:19: return (*((TColStd_Array1OfReal*) NULL ));
src/PLib/PLib.lxx:24: return (*((TColStd_Array2OfReal*) NULL ));
TagsNo tags attached.
Test case number

Relationships

duplicate of 0026042 closedbugmaster OCCT won't work with the latest Xcode 
related to 0025454 closedbugmaster Large number of test suite bads/failures starting with Clang 3.4 

Activities

kgv

2017-07-20 12:33

developer   ~0068487

Last edited: 2017-07-20 12:33

The bug should be fixed in scope of 0026042, thus the issue can be closed.

Issue History

Date Modified Username Field Change
2014-10-29 06:11 Epy New Issue
2014-10-29 06:11 Epy Assigned To => mkv
2014-10-29 06:19 abv Assigned To mkv => abv
2014-10-29 06:19 abv Status new => assigned
2014-10-29 06:19 abv Category OCCT:Tests => OCCT:Coding
2014-10-29 06:19 abv Target Version => 7.1.0
2014-10-29 06:19 abv Summary Increased testing failures with Clang 3.4 and later => Invalid use of NULL references
2014-10-29 06:19 abv Description Updated
2015-04-09 21:09 kgv Relationship added related to 0026042
2015-09-25 00:57 abv Assigned To abv => akz
2015-09-25 00:57 abv Target Version 7.1.0 => 7.0.0
2015-10-14 12:03 kgv Relationship added related to 0025454
2016-02-08 16:18 abv Assigned To akz => abv
2016-02-08 16:18 abv Target Version 7.0.0 => 7.1.0
2016-11-03 18:33 abv Target Version 7.1.0 => 7.2.0
2017-07-20 12:33 kgv Note Added: 0068487
2017-07-20 12:33 kgv Assigned To abv => bugmaster
2017-07-20 12:33 kgv Status assigned => feedback
2017-07-20 12:33 kgv Resolution open => duplicate
2017-07-20 12:33 kgv Note Edited: 0068487
2017-07-20 12:33 kgv Relationship replaced duplicate of 0026042
2017-07-20 19:48 bugmaster Status feedback => closed