MantisBT
Mantis Bug Tracker Workflow

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0031009Open CASCADE[OCCT] OCCT:Modeling Algorithmspublic2019-09-28 09:262019-10-02 08:10
Reporterabv 
Assigned Tomsv 
PrioritynormalSeverityminor 
StatusnewResolutionopen 
PlatformOSOS Version
Product Version 
Target Version[OCCT] 7.5.0*Fixed in Version 
Summary0031009: Modeling Algorithms - alloc-dealloc-mismatch reported by Clang address sanitizer in IntCurvesFace_ShapeIntersector
DescriptionWhen running OCCT built on Linux with Clang with option -fsanitize=address, error alloc-dealloc-mismatch is reported on test bugs moddata_1 bug17424:

OCC17424 a 86.960439048069262 1028.2863798310484 -266.58526583558000 0.25881904510252074 0 -0.96592582628906831 0.
=================================================================
==3012==ERROR: AddressSanitizer: alloc-dealloc-mismatch (operator new [] vs operator delete) on 0x6040000aae10
    #0 0x5174e0 in operator delete(void*) (/home/abv/tmp/occt-clang/lin64/clang/bini/DRAWEXE-7.4.0+0x5174e0)
    0000001 0x7fed0aa00cda in IntCurvesFace_ShapeIntersector::Destroy() /home/abv/occt/src/IntCurvesFace/IntCurvesFace_ShapeIntersector.cxx:59:5
    0000002 0x7fecf96f95ce in IntCurvesFace_ShapeIntersector::~IntCurvesFace_ShapeIntersector() /home/abv/occt/src/IntCurvesFace/IntCurvesFace_ShapeIntersector.hxx:118:3
    #3 0x7fecf96dadd5 in OCC17424(Draw_Interpretor&, int, char const**) /home/abv/occt/src/QABugs/QABugs_11.cxx:4564:1
    #4 0x7fed0c24c349 in Draw_Interpretor::CallBackDataFunc::Invoke(Draw_Interpretor&, int, char const**) /home/abv/occt/src/Draw/Draw_Interpretor.hxx:81:31
    #5 0x7fed0c259b7d in CommandCmd(void*, Tcl_Interp*, int, char const**) /home/abv/occt/src/Draw/Draw_Interpretor.cxx:154:40
    #6 0x7fed065e9b95 in TclInvokeStringCommand (/usr/lib/x86_64-linux-gnu/libtcl8.6.so+0x38b95)
    0000007 0x7fed065ebfa6 in TclNRRunCallbacks (/usr/lib/x86_64-linux-gnu/libtcl8.6.so+0x3afa6)
    0000008 0x7fed0668a87a in Tcl_RecordAndEvalObj (/usr/lib/x86_64-linux-gnu/libtcl8.6.so+0xd987a)
    0000009 0x7fed0668a756 in Tcl_RecordAndEval (/usr/lib/x86_64-linux-gnu/libtcl8.6.so+0xd9756)
    #10 0x7fed0c25b0bf in Draw_Interpretor::RecordAndEval(char const*, int) /home/abv/occt/src/Draw/Draw_Interpretor.cxx:496:10
    0000011 0x7fed0c241dad in Draw_Interprete(char const*) /home/abv/occt/src/Draw/Draw.cxx:608:19
    #12 0x7fed0c242b90 in interpreteTclCommand(TCollection_AsciiString const&) /home/abv/occt/src/Draw/Draw.cxx:110:5
    0000013 0x7fed0c24037b in ReadInitFile(TCollection_AsciiString const&) /home/abv/occt/src/Draw/Draw.cxx:121:3
    0000014 0x7fed0c23f973 in Draw_Appli(int, char**, void (*)(Draw_Interpretor&)) /home/abv/occt/src/Draw/Draw.cxx:497:5
    0000015 0x7fed0c25c328 in Draw_Main(int, char**, void (*)(Draw_Interpretor&)) /home/abv/occt/src/Draw/Draw_Main.cxx:113:3
    0000016 0x51aaef in main /home/abv/occt/src/DRAWEXE/DRAWEXE.cxx:33:1
    0000017 0x7fed0501582f in __libc_start_main /build/glibc-Cl5G7W/glibc-2.23/csu/../csu/libc-start.c:291
    0000018 0x41aac8 in _start (/home/abv/tmp/occt-clang/lin64/clang/bini/DRAWEXE-7.4.0+0x41aac8)

0x6040000aae10 is located 0 bytes inside of 40-byte region [0x6040000aae10,0x6040000aae38)
allocated by thread T0 here:
    #0 0x516918 in operator new[](unsigned long) (/home/abv/tmp/occt-clang/lin64/clang/bini/DRAWEXE-7.4.0+0x516918)
    0000001 0x7fed0aa01b9f in IntCurvesFace_ShapeIntersector::PerformNearest(gp_Lin const&, double, double) /home/abv/occt/src/IntCurvesFace/IntCurvesFace_ShapeIntersector.cxx:98:33
    0000002 0x7fecf96dad0c in OCC17424(Draw_Interpretor&, int, char const**) /home/abv/occt/src/QABugs/QABugs_11.cxx:4554:15
    #3 0x7fed0c24c349 in Draw_Interpretor::CallBackDataFunc::Invoke(Draw_Interpretor&, int, char const**) /home/abv/occt/src/Draw/Draw_Interpretor.hxx:81:31
    #4 0x7fed0c259b7d in CommandCmd(void*, Tcl_Interp*, int, char const**) /home/abv/occt/src/Draw/Draw_Interpretor.cxx:154:40
    #5 0x7fed065e9b95 in TclInvokeStringCommand (/usr/lib/x86_64-linux-gnu/libtcl8.6.so+0x38b95)

SUMMARY: AddressSanitizer: alloc-dealloc-mismatch (/home/abv/tmp/occt-clang/lin64/clang/bini/DRAWEXE-7.4.0+0x5174e0) in operator delete(void*)
==3012==HINT: if you don't care about these errors you may set ASAN_OPTIONS=alloc_dealloc_mismatch=0
==3012==ABORTING
Additional information
and documentation updates
Class IntCurvesFace_ShapeIntersector needs to be refactored as a whole:

- Use typed collections instead of void* buffers
- Use English words to name variables (instead of French)
- Follow OCCT coding rules in names of variables and formatting
TagsNo tags attached.
Test case number
Attached Files

- Relationships
child of 0030557newkgv Coding - eliminate errors reported by -fsanitize 

-  Notes
There are no notes attached to this issue.

- Issue History
Date Modified Username Field Change
2019-09-28 09:26 abv New Issue
2019-09-28 09:26 abv Assigned To => msv
2019-09-28 09:27 abv Relationship added child of 0030557
2019-10-02 08:10 abv Additional Information Updated View Revisions


Copyright © 2000 - 2019 MantisBT Team
Powered by Mantis Bugtracker