Mantis Bug Tracker Workflow

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0025725Open CASCADE[OCCT] OCCT:Codingpublic2015-01-20 11:532019-07-10 19:27
Assigned Toabv 
PlatformOSOS Version
Product Version 
Target Version[OCCT] 7.5.0*Fixed in Version 
Summary0025725: Avoid invocation of virtual methods in constructors and destructors
DescriptionStatic code analyzers complain about multiple places where virtual method is called from constructor or destructor, which may result in behavior different from expected (own method will be called in all cases).

More information: CAST report issue №628.
TagsNo tags attached.
Test case number
Attached Filestxt file icon scan-build-OCE.txt (24,250 bytes) 2015-01-20 14:35

- Relationships
related to 0025622closedbugmaster Open CASCADE CAST analysis: Avoid invocation of virtual Methods of the declared Class in a Constructor or Destructor 
related to 0025572closedbugmaster Open CASCADE Remove MMgt_TShared class. 
parent of 0027067closedabv Open CASCADE Avoid use of virtual methods for implementation of destructors in legacy classes 

-  Notes
barbier (updater)
2015-01-20 14:35

Scan-build reports similar issues, see attached file scan-build-OCE.txt (against OCE; it is not complete, I forgot to build DRAWEXE). It may be more complete than CAST report, since scan-build is able to also detect virtual functions indirectly called by constructors/destructors.
abv (manager)
2018-02-25 23:06
edited on: 2018-02-25 23:07

For the record, I tried to run scan-build for OCCT but it does not work for me (reports zero bugs). (Ubuntu 16.04 with CLang.)

According to documentation, scan-build works by replacing compiler by its own wrapper by tweaking CXX make veriable; however, scripts generated by CMake does not use such variable. Direct path to compiler is encoded instead. For instance, in build folder/src/TKQADraw/CMakeFiles/TKQADraw.dir/build.make:

src/TKQADraw/CMakeFiles/TKQADraw.dir/__/QABugs/QABugs.cxx.o: /home/abv/occt/src/QABugs/QABugs.cxx
    @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/home/abv/tmp/occt-clang/CMakeFiles --progress-num=$(CMAKE_PROGRESS_1) "Building CXX object src/TKQADraw/CMakeFiles/TKQADraw.dir/__/QABugs/QABugs.cxx.o"
    cd /home/abv/tmp/occt-clang/src/TKQADraw && /usr/bin/clang $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -o CMakeFiles/TKQADraw.dir/__/QABugs/QABugs.cxx.o -c /home/abv/occt/src/QABugs/QABugs.cxx

- Issue History
Date Modified Username Field Change
2015-01-20 11:53 azn New Issue
2015-01-20 11:53 azn Assigned To => azn
2015-01-20 11:54 azn Description Updated View Revisions
2015-01-20 11:54 azn Relationship added related to 0025622
2015-01-20 11:55 azn Relationship added related to 0025572
2015-01-20 11:56 azn Assigned To azn => abv
2015-01-20 14:35 barbier Note Added: 0036263
2015-01-20 14:35 barbier File Added: scan-build-OCE.txt
2015-03-27 21:32 abv Target Version 6.9.0 => 7.0.0
2015-12-14 22:44 abv Target Version 7.0.0 => 7.1.0
2016-01-08 19:55 abv Relationship added parent of 0027067
2016-01-08 19:59 abv Summary Avoid invocation of virtual methods in a constructor and destructor of the Standard_Transient class inheritors. => Avoid invocation of virtual methods in constructors and destructors
2016-01-08 19:59 abv Description Updated View Revisions
2016-11-03 17:13 abv Target Version 7.1.0 => 7.2.0
2017-07-20 12:28 kgv Relationship added parent of 0028902
2017-07-20 12:29 kgv Target Version 7.2.0 => 7.3.0
2018-02-25 21:04 abv Target Version 7.3.0 => 7.4.0
2018-02-25 23:06 abv Note Added: 0074129
2018-02-25 23:07 abv Note Edited: 0074129 View Revisions
2019-07-10 19:27 abv Target Version 7.4.0 => 7.5.0*

Copyright © 2000 - 2020 MantisBT Team
Powered by Mantis Bugtracker