View Issue Details

IDProjectCategoryView StatusLast Update
0026929CommunityOCCT:Modeling Algorithmspublic2016-04-20 15:50
ReporterIstvan Csanady Assigned Tobugmaster  
PriorityhighSeveritycrash 
Status closedResolutionfixed 
Target Version7.0.0Fixed in Version7.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 Files

  • main.cpp (86,308 bytes)
  • OCC26629-edge.brep (24,362 bytes)
  • OCC26629-face.brep (58,648 bytes)
  • log.txt (2,266 bytes)

Activities

Istvan Csanady

2015-11-25 18:09

developer  

main.cpp (86,308 bytes)

msv

2015-11-25 18:38

developer   ~0048579

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.

git

2015-11-25 22:50

administrator   ~0048586

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.

aml

2015-11-25 22:51

developer   ~0048587

Shapes were converted into "restore" format and attached. Test case added.

git

2015-11-26 08:34

administrator   ~0048588

Branch CR26929 has been updated forcibly by aml.

SHA-1: d248664d6ffcd0bb650f3684959e254c75c92972

git

2015-11-26 09:21

administrator   ~0048589

Branch CR26929 has been updated forcibly by aml.

SHA-1: 3a899dc7308bd47c4e23b989a03bcae8d051444f

aml

2015-11-26 09:22

developer  

OCC26629-edge.brep (24,362 bytes)

aml

2015-11-26 09:22

developer  

OCC26629-face.brep (58,648 bytes)

aml

2015-11-26 09:24

developer   ~0048590

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?

abv

2015-11-26 09:45

manager   ~0048592

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)?

git

2015-11-26 10:14

administrator   ~0048593

Branch CR26929 has been updated forcibly by aml.

SHA-1: 0835c04be48617581c72a633fd73580bff78e3a1

git

2015-11-26 10:38

administrator   ~0048596

Branch CR26929 has been updated forcibly by aml.

SHA-1: 2e35a9bf545a87795a3edd0adbe549e9282e7cf6

msv

2015-11-26 10:51

developer   ~0048599

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?

Istvan Csanady

2015-11-26 15:32

developer   ~0048611

Unfortunately I can not run tcl scripts on iOS, but based on the code it should.

msv

2015-11-26 17:22

developer   ~0048614

What about OS X then?

Istvan Csanady

2015-11-26 19:07

developer   ~0048621

I don't have MacOSX binaries, but I will compile them tomorrow morning.

Istvan Csanady

2015-11-27 14:57

developer   ~0048633

OCCT version: latest master, Clang, Xcode 7.1

Istvan Csanady

2015-11-27 14:58

developer   ~0048634

But this one is not related to Clang optimizations, because it hangs in debug mode as well.

Istvan Csanady

2015-11-27 15:19

developer   ~0048635

Well, I can not even compile the master branch on OSX, TKernel compilation fails with linker error to std::bad_cast.

Istvan Csanady

2015-11-27 16:13

developer   ~0048637

Finally I compiled on OSX, but DRAWEXE crashes with
libc++abi.dylib: terminating with uncaught exception of type Standard_DomainError
Abort trap: 6

msv

2015-11-27 16:53

developer   ~0048639

Dear bugmaster, could you check the test case in this branch on MacOSX?

bugmaster

2015-11-30 11:51

administrator   ~0048647

MacOS master

test script crashed by CPU limit 100 and 300. See attached log.txt file

bugmaster

2015-11-30 11:53

administrator  

log.txt (2,266 bytes)

Istvan Csanady

2016-03-24 16:54

developer   ~0051966

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

if (theA.X() == theB.X() && theA.Y() == theB.Y())
    {
        return &theA < &theB;
    }

msv

2016-03-25 11:05

developer   ~0051976

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.

abv

2016-03-26 22:00

manager   ~0052043

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

git

2016-03-27 00:16

administrator   ~0052044

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.

msv

2016-03-27 00:18

developer   ~0052045

Hi Istvan,
Could you test this problem on the branch CR26929_1?
Mikhail

msv

2016-03-27 00:21

developer   ~0052046

I have tested this change on a set of tests "bugs mod*", no regressions have been revealed.

git

2016-03-28 11:06

administrator   ~0052050

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.

abv

2016-03-28 11:07

manager   ~0052051

Igor, please compile branch CR26929 on OS X and check test bugs modalg_6 bug26929

abv

2016-03-28 17:17

manager   ~0052081

Sorry, correct branch is indeed CR26929_2

git

2016-04-17 14:01

administrator   ~0053029

Branch CR26929 has been deleted by kgv.

SHA-1: 2e35a9bf545a87795a3edd0adbe549e9282e7cf6

git

2016-04-17 14:01

administrator   ~0053030

Branch CR26929_1 has been deleted by kgv.

SHA-1: d1eff45ccdad6967985e81b12362aad1216c1dee

git

2016-04-17 14:01

administrator   ~0053031

Branch CR26929_2 has been deleted by kgv.

SHA-1: 0b65fec2954ecdace867197f58a6b9eeab5ed0f6

Related Changesets

occt: master afb27815

2016-03-26 17:42:49

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.
Affected Issues
0026929
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
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 aiv Fixed in Version => 7.0.0
2016-04-20 15:50 aiv Status verified => closed