Archived issue #0026929
Extrema_ECC hang/crash
Description
See 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);
Hang/crash occurs at Extrema_GenExtCC.gxx #0000291:
std::sort(aPnts.begin(), aPnts.end(), comp);
Steps to reproduce
test bugs modalg_6 bug26929
Public activity
31 archived notes
Participants are labeled by their role within this record.
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.
Branch [archived branch] has been created by Participant.
[revision removed]
Detailed log of new commits:
Author: aml
Date: Wed Nov 25 22:49:03 2015 +0300
0026929: Extrema_ECC hang/crash
Test case added.
[revision removed]
Detailed log of new commits:
Author: aml
Date: Wed Nov 25 22:49:03 2015 +0300
0026929: Extrema_ECC hang/crash
Test case added.
Shapes were converted into "restore" format and attached. Test case added.
Branch [archived branch] has been updated forcibly by Participant.
[revision removed]
[revision removed]
Branch [archived branch] has been updated forcibly by Participant.
[revision removed]
[revision removed]
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?
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?
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)?
Branch [archived branch] has been updated forcibly by Participant.
[revision removed]
[revision removed]
Branch [archived branch] has been updated forcibly by Participant.
[revision removed]
[revision removed]
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?
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?
Unfortunately I can not run tcl scripts on iOS, but based on the code it should.
What about OS X then?
I don't have MacOSX binaries, but I will compile them tomorrow morning.
OCCT version: latest master, Clang, Xcode 7.1
But this one is not related to Clang optimizations, because it hangs in debug mode as well.
Well, I can not even compile the master branch on OSX, TKernel compilation fails with linker error to std::bad_cast.
Finally I compiled on OSX, but DRAWEXE crashes with
libc++abi.dylib: terminating with uncaught exception of type Standard_DomainError
Abort trap: 6
libc++abi.dylib: terminating with uncaught exception of type Standard_DomainError
Abort trap: 6
Dear Commenter 1, could you check the test case in this branch on MacOSX?
MacOS master
test script crashed by CPU limit 100 and 300. See attached Attachment 1 (TXT) file
test script crashed by CPU limit 100 and 300. See attached Attachment 1 (TXT) file
Easy to fix: just add these three lines to the comparator code
if (theA.X() == theB.X() && theA.Y() == theB.Y())
{
return &theA < &theB
}
if (theA.X() == theB.X() && theA.Y() == theB.Y())
{
return &theA < &theB
}
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.
I think it is ill implementation of std::sort in CLang.
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
> if (theA.Y() <= theB.Y())
Here the point is that operator 'less' may not return true for equal objects
Branch [archived branch] has been created by Participant.
[revision removed]
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.
[revision removed]
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.
Hi Istvan,
Could you test this problem on the branch CR26929_1?
Mikhail
Could you test this problem on the branch CR26929_1?
Mikhail
I have tested this change on a set of tests "bugs mod*", no regressions have been revealed.
Branch [archived branch] has been created by Participant.
[revision removed]
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.
[revision removed]
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.
Igor, please compile branch CR26929 on OS X and check test bugs modalg_6 bug26929
Sorry, correct branch is indeed CR26929_2
Branch [archived branch] has been deleted by Participant.
[revision removed]
[revision removed]
Branch [archived branch] has been deleted by Participant.
[revision removed]
[revision removed]
Branch [archived branch] has been deleted by Participant.
[revision removed]
[revision removed]