MantisBT
Mantis Bug Tracker Workflow

View Issue Details Jump to Notes ] Related Changesets ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0026929Community[OCCT] OCCT:Modeling Algorithmspublic2015-11-25 18:092016-04-20 15:50
ReporterIstvan Csanady 
Assigned Tobugmaster 
PriorityhighSeveritycrash 
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version 
Target Version[OCCT] 7.0.0Fixed in Version[OCCT] 7.0.0 
Summary0026929: Extrema_ECC hang/crash
DescriptionSee the attached code. In this case it hangs, but in some similar cases it crashed.

Hang/crash occurs at Extrema_GenExtCC.gxx 0000291:

std::sort(aPnts.begin(), aPnts.end(), comp);
Steps To Reproducetest bugs modalg_6 bug26929
TagsNo tags attached.
Test case number
Attached Filescpp file icon main.cpp (86,308 bytes) 2015-11-25 18:09
? file icon OCC26629-edge.brep (24,362 bytes) 2015-11-26 09:22
? file icon OCC26629-face.brep (58,648 bytes) 2015-11-26 09:22
txt file icon log.txt (2,266 bytes) 2015-11-30 11:53

- Relationships

-  Notes
(0048579)
msv (developer)
2015-11-25 18:38

Dear Alexander, please look at this issue and estimate if it has a very simple solution to be integrated in 7.0. Otherwise, change target version to 7.1.
(0048586)
git (administrator)
2015-11-25 22:50

Branch CR26929 has been created by aml.

SHA-1: fd6b9b3ff8daf6c8679387da07e9da6d341fe385


Detailed log of new commits:

Author: aml
Date: Wed Nov 25 22:49:03 2015 +0300

    0026929: Extrema_ECC hang/crash
    
    Test case added.
(0048587)
aml (developer)
2015-11-25 22:51

Shapes were converted into "restore" format and attached. Test case added.
(0048588)
git (administrator)
2015-11-26 08:34

Branch CR26929 has been updated forcibly by aml.

SHA-1: d248664d6ffcd0bb650f3684959e254c75c92972
(0048589)
git (administrator)
2015-11-26 09:21

Branch CR26929 has been updated forcibly by aml.

SHA-1: 3a899dc7308bd47c4e23b989a03bcae8d051444f
(0048590)
aml (developer)
2015-11-26 09:24

Dear msv,
This problem not reproduced on the following configurations:
vc11-x64 Release / Debug
vc10-x64 Release / Debug

So, test case was created. Could you please review my modifications?
(0048592)
abv (manager)
2015-11-26 09:45

I guess the problem was reported on OS X or iOS, and can be specific to this platform and/or CLang compiler. Istvan, can you please specify the configuration where you observe the problem (OCCT version / commit hash, OS, compiler)?
(0048593)
git (administrator)
2015-11-26 10:14

Branch CR26929 has been updated forcibly by aml.

SHA-1: 0835c04be48617581c72a633fd73580bff78e3a1
(0048596)
git (administrator)
2015-11-26 10:38

Branch CR26929 has been updated forcibly by aml.

SHA-1: 2e35a9bf545a87795a3edd0adbe549e9282e7cf6
(0048599)
msv (developer)
2015-11-26 10:51

I have reviewed test case.

Dear Istvan, could you please try to run the test script from the branch CR26929 within your configuration to make sure it reproduces the problem?
(0048611)
Istvan Csanady (developer)
2015-11-26 15:32

Unfortunately I can not run tcl scripts on iOS, but based on the code it should.
(0048614)
msv (developer)
2015-11-26 17:22

What about OS X then?
(0048621)
Istvan Csanady (developer)
2015-11-26 19:07

I don't have MacOSX binaries, but I will compile them tomorrow morning.
(0048633)
Istvan Csanady (developer)
2015-11-27 14:57

OCCT version: latest master, Clang, Xcode 7.1
(0048634)
Istvan Csanady (developer)
2015-11-27 14:58

But this one is not related to Clang optimizations, because it hangs in debug mode as well.
(0048635)
Istvan Csanady (developer)
2015-11-27 15:19

Well, I can not even compile the master branch on OSX, TKernel compilation fails with linker error to std::bad_cast.
(0048637)
Istvan Csanady (developer)
2015-11-27 16:13

Finally I compiled on OSX, but DRAWEXE crashes with
libc++abi.dylib: terminating with uncaught exception of type Standard_DomainError
Abort trap: 6
(0048639)
msv (developer)
2015-11-27 16:53

Dear bugmaster, could you check the test case in this branch on MacOSX?
(0048647)
bugmaster (administrator)
2015-11-30 11:51

MacOS master

test script crashed by CPU limit 100 and 300. See attached log.txt file
(0051966)
Istvan Csanady (developer)
2016-03-24 16:54

Easy to fix: just add these three lines to the comparator code

if (theA.X() == theB.X() && theA.Y() == theB.Y())
    {
        return &theA < &theB;
    }
(0051976)
msv (developer)
2016-03-25 11:05

I do not like this solution. The performance will depend on ordering of objects in memory. We in OCCT try to avoid such behavior as much as possible.
I think it is ill implementation of std::sort in CLang.
(0052043)
abv (manager)
2016-03-26 22:00

Istvan, thank you for highlighting the problem! Can you try another fix: just replace "<=" by "<" at line 39:

> if (theA.Y() <= theB.Y())

Here the point is that operator 'less' may not return true for equal objects
(0052044)
git (administrator)
2016-03-27 00:16

Branch CR26929_1 has been created by msv.

SHA-1: d1eff45ccdad6967985e81b12362aad1216c1dee


Detailed log of new commits:

Author: msv
Date: Sat Mar 26 20:42:49 2016 +0300

    Experimental change: make comparator returning false in the case of equal elements.

Author: aml
Date: Wed Nov 25 22:49:03 2015 +0300

    0026929: Extrema_ECC hang/crash
    
    Test case added.
(0052045)
msv (developer)
2016-03-27 00:18

Hi Istvan,
Could you test this problem on the branch CR26929_1?
Mikhail
(0052046)
msv (developer)
2016-03-27 00:21

I have tested this change on a set of tests "bugs mod*", no regressions have been revealed.
(0052050)
git (administrator)
2016-03-28 11:06

Branch CR26929_2 has been created by abv.

SHA-1: 0b65fec2954ecdace867197f58a6b9eeab5ed0f6


Detailed log of new commits:

Author: msv
Date: Sat Mar 26 20:42:49 2016 +0300

    0026929: Extrema_ECC hang/crash
    
    Comparator functor corrected to return false in the case of equal elements.
    Test case added.
(0052051)
abv (manager)
2016-03-28 11:07

Igor, please compile branch CR26929 on OS X and check test bugs modalg_6 bug26929
(0052081)
abv (manager)
2016-03-28 17:17

Sorry, correct branch is indeed CR26929_2
(0053029)
git (administrator)
2016-04-17 14:01

Branch CR26929 has been deleted by kgv.

SHA-1: 2e35a9bf545a87795a3edd0adbe549e9282e7cf6
(0053030)
git (administrator)
2016-04-17 14:01

Branch CR26929_1 has been deleted by kgv.

SHA-1: d1eff45ccdad6967985e81b12362aad1216c1dee
(0053031)
git (administrator)
2016-04-17 14:01

Branch CR26929_2 has been deleted by kgv.

SHA-1: 0b65fec2954ecdace867197f58a6b9eeab5ed0f6

- Related Changesets
occt: master afb27815
Timestamp: 2016-03-26 17:42:49
Author: msv
Committer: bugmaster
Details ] Diff ]
0026929: Extrema_ECC hang/crash

Comparator functor corrected to return false in the case of equal elements.
Test case added.
mod - src/Extrema/Extrema_GenExtCC.gxx Diff ] File ]
add - tests/bugs/modalg_6/bug26929 Diff ] File ]

- Issue History
Date Modified Username Field Change
2015-11-25 18:09 Istvan Csanady New Issue
2015-11-25 18:09 Istvan Csanady Assigned To => msv
2015-11-25 18:09 Istvan Csanady File Added: main.cpp
2015-11-25 18:38 msv Note Added: 0048579
2015-11-25 18:38 msv Assigned To msv => aml
2015-11-25 18:38 msv Status new => assigned
2015-11-25 22:24 aml File Added: aE
2015-11-25 22:24 aml File Added: aF
2015-11-25 22:30 aml File Deleted: aE
2015-11-25 22:30 aml File Deleted: aF
2015-11-25 22:31 aml File Added: aF
2015-11-25 22:31 aml File Added: aE
2015-11-25 22:50 git Note Added: 0048586
2015-11-25 22:51 aml Note Added: 0048587
2015-11-26 08:34 git Note Added: 0048588
2015-11-26 09:21 git Note Added: 0048589
2015-11-26 09:22 aml File Deleted: aF
2015-11-26 09:22 aml File Deleted: aE
2015-11-26 09:22 aml File Added: OCC26629-edge.brep
2015-11-26 09:22 aml File Added: OCC26629-face.brep
2015-11-26 09:24 aml Note Added: 0048590
2015-11-26 09:24 aml Assigned To aml => msv
2015-11-26 09:24 aml Status assigned => resolved
2015-11-26 09:24 aml Steps to Reproduce Updated View Revisions
2015-11-26 09:45 abv Note Added: 0048592
2015-11-26 10:14 git Note Added: 0048593
2015-11-26 10:38 git Note Added: 0048596
2015-11-26 10:51 msv Note Added: 0048599
2015-11-26 10:51 msv Assigned To msv => Istvan Csanady
2015-11-26 10:51 msv Status resolved => feedback
2015-11-26 15:32 Istvan Csanady Note Added: 0048611
2015-11-26 17:22 msv Note Added: 0048614
2015-11-26 19:07 Istvan Csanady Note Added: 0048621
2015-11-27 14:57 Istvan Csanady Note Added: 0048633
2015-11-27 14:58 Istvan Csanady Note Added: 0048634
2015-11-27 15:19 Istvan Csanady Note Added: 0048635
2015-11-27 16:13 Istvan Csanady Note Added: 0048637
2015-11-27 16:53 msv Note Added: 0048639
2015-11-27 16:53 msv Assigned To Istvan Csanady => bugmaster
2015-11-30 11:51 bugmaster Note Added: 0048647
2015-11-30 11:51 bugmaster Assigned To bugmaster => msv
2015-11-30 11:51 bugmaster Status feedback => assigned
2015-11-30 11:53 bugmaster File Added: log.txt
2016-02-02 11:07 abv Target Version 7.0.0 => 7.1.0
2016-03-24 16:54 Istvan Csanady Note Added: 0051966
2016-03-24 19:50 abv Target Version 7.1.0 => 7.0.0
2016-03-25 11:05 msv Note Added: 0051976
2016-03-26 22:00 abv Note Added: 0052043
2016-03-27 00:16 git Note Added: 0052044
2016-03-27 00:18 msv Note Added: 0052045
2016-03-27 00:21 msv Note Added: 0052046
2016-03-28 11:06 git Note Added: 0052050
2016-03-28 11:07 abv Note Added: 0052051
2016-03-28 11:07 abv Assigned To msv => bugmaster
2016-03-28 11:07 abv Status assigned => feedback
2016-03-28 11:08 abv Priority normal => high
2016-03-28 17:17 abv Note Added: 0052081
2016-03-29 15:55 bugmaster Changeset attached => occt master afb27815
2016-03-29 15:55 bugmaster Status feedback => verified
2016-03-29 15:55 bugmaster Resolution open => fixed
2016-04-17 14:01 git Note Added: 0053029
2016-04-17 14:01 git Note Added: 0053030
2016-04-17 14:01 git Note Added: 0053031
2016-04-20 15:42 user533 Fixed in Version => 7.0.0
2016-04-20 15:50 user533 Status verified => closed


Copyright © 2000 - 2018 MantisBT Team
Powered by Mantis Bugtracker