Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Nef_S2 Qt5 visualization #3511

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

cedricpradalier
Copy link

Please use the following template to help us managing pull requests.

Summary of Changes

Adding back QT5 Nef_S2 visualization following discussion in #3473

In comparison to #3473, draw_nef_s2.h is also part of the examples. It can be moved to the Nef_S2 package if needed.

Release Management

  • Affected package(s): Nef_S2
  • Issue(s) solved (if any): fix Nef_S2 Qt visualization #3473
  • Feature/Small Feature (if any):
  • Link to compiled documentation (obligatory for small feature) link
  • License and copyright ownership:

@cedricpradalier
Copy link
Author

I've implemented the suggested changes. While testing, I found that the createRandomNefS2 function segfaults in the draw_nef_s2.cpp code if compiled in Release. It works fine in RelWithDebInfo and Debug. The same code runs fine in release if the draw_nef_s2 function is not called (although it is normally called after the segfault point). The same code works fine in all compile modes in the nef_S2.cpp example.
Is this a known problem with g++ being too aggressive in its optimizations in Release mode?
This feels like some buffer overflow or stack corruption, but this is fairly hard to debug without the DebugInfo...

@lrineau
Copy link
Member

lrineau commented Dec 5, 2018

It is probably an error you made. Optimisation errors are very rare nowdays in g++.

If you have a recent g++, you can try to add -fsanitizer=address -g3 to your compiler flags, in Release. That may help detect buffer overflows or uses-after-free.

if(CGAL_3RD_PARTY_LIBRARIES)
target_link_libraries(nef_S2 PRIVATE ${CGAL_3RD_PARTY_LIBRARIES})
endif()
target_link_libraries(nef_S2 PRIVATE ${CGAL_LIBRARIES} Qt5::Widgets Qt5::OpenGL glut GLU GL )
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You probably do not need glut and GLU. And if you use the Qt5 OpenGL module, GL is not required either.

@cedricpradalier
Copy link
Author

cedricpradalier commented Dec 5, 2018 via email

@cedricpradalier
Copy link
Author

cedricpradalier commented Dec 5, 2018 via email

@lrineau
Copy link
Member

lrineau commented Dec 7, 2018

I have a patch to make it compile.

diff --git a/Nef_S2/examples/Nef_S2/include/CGAL/Nef_S2/Qt_widget_Nef_S2.h b/Nef_S2/examples/Nef_S2/include/CGAL/Nef_S2/Qt_widget_Nef_S2.h
index 121e66143d8..5c5db2d007e 100644
--- a/Nef_S2/examples/Nef_S2/include/CGAL/Nef_S2/Qt_widget_Nef_S2.h
+++ b/Nef_S2/examples/Nef_S2/include/CGAL/Nef_S2/Qt_widget_Nef_S2.h
@@ -23,7 +23,7 @@
 
 #include <CGAL/Nef_S2/Sphere_geometry_OGL.h>
 #include "CGAL/Nef_S2/Qt_widget_OpenGL.h"
-#include <boost/thread/mutex.hpp>
+#include <CGAL/mutex.h>
 
 namespace CGAL {
 
@@ -45,7 +45,7 @@ class Qt_widget_Nef_S2 : public Qt_widget_OpenGL {
   virtual ~Qt_widget_Nef_S2(); 
 
  protected:
-  boost::mutex mutex;
+  CGAL_MUTEX mutex;
   
 };
 

@cedricpradalier
Copy link
Author

Sorry, I did not know about CGAL_MUTEX; Thanks for patching.

@lrineau
Copy link
Member

lrineau commented Dec 7, 2018

Hi @cedricpradalier,

We are reluctant to integrate the pull-request as it is, because its code uses:

  • GLU and GLUT,
  • and OpenGL direct mode (with glBegin and so on), instead of modern OpenGL (with buffers and shaders).

@maxGimeno will have a look at the code, and try to find how much work from him would be necessary to transform the code.

@cedricpradalier
Copy link
Author

Thanks. I have no knowledge about this part at all. I just ported the Qt3 version and left all the opengl as is.

@lrineau
Copy link
Member

lrineau commented Dec 7, 2018

@cedricpradalier Can you please add us as collaborators of your fork?

https://github.com/cedricpradalier/cgal/settings/collaboration

Please add maxGimeno and lrineau.

@gdamiand
Copy link
Member

gdamiand commented Dec 7, 2018

@maxGimeno @lrineau I suggest again to use basic viewer...

@maxGimeno
Copy link
Contributor

@gdamiand We discussed it with lrineau, for now we just want the PR as it is to compile and run without warning to integrate it. If we manage that, I will probably port the code to a basic_viewer for Nesh_polyhedron_2, but later.

@lrineau
Copy link
Member

lrineau commented Dec 7, 2018

@gdamiand commented on Dec 7, 2018, 11:35 AM GMT+1:

@maxGimeno @lrineau I suggest again to use basic viewer...

There are a lot of interaction in the Nef_s2 viewer, for which the basic viewer is too basic. But maybe by a derivation from it.

@gdamiand
Copy link
Member

gdamiand commented Dec 7, 2018

Yes it is possible to inherit from basic viewer and add interactions (I just did that for the LCC demo, cf my last PR).

@lrineau
Copy link
Member

lrineau commented Dec 7, 2018

Thanks @cedricpradalier. I have pushed the fix with <CGAL/mutex.h> to avoid having the dependency on Boost Thread with recent C++11 compilers.

@lrineau
Copy link
Member

lrineau commented Dec 7, 2018

About the segfault, with the flag -fsanitize=address, the compiler shows that there is a use-after-scope.

@cedricpradalier
Copy link
Author

cedricpradalier commented Dec 7, 2018

Thanks. I need to hone my skills with fsanitize which I did not know beforehand. In my setup fsanitize only shows me memory leaks but the segfault disappears (it comes back if I comment out the option...). Weird...
g++ (Ubuntu 5.4.0-6ubuntu1~16.04.10) 5.4.0 20160609

@cedricpradalier
Copy link
Author

Can you send me your AddressSanitizer output for comparison? It may gives me an hint on where to search. Thanks

@maxGimeno
Copy link
Contributor

maxGimeno commented Dec 7, 2018

I get :

==11859==ERROR: AddressSanitizer: stack-use-after-scope on address 0x7ffd86440390 at pc 0x559e024db0b0 bp 0x7ffd8643f9a0 sp 0x7ffd8643f990
READ of size 4 at 0x7ffd86440390 thread T0
#0 0x559e024db0af in CGAL::Positive_halfsphere_geometry<CGAL::Simple_cartesianCGAL::Gmpq >::compare_xy(CGAL::Sphere_point<CGAL::Simple_cartesianCGAL::Gmpq > const&, CGAL::Sphere_point<CGAL::Simple_cartesianCGAL::Gmpq > const&) const (/home/gimeno/CGAL/Nef_S2/examples/build/draw_nef_s2+0x1f50af)
#1 0x559e0253eb72 in CGAL::stl_seg_overlay_traits<std::_List_iterator<CGAL::Sphere_segment<CGAL::Simple_cartesianCGAL::Gmpq > >, CGAL::SMO_from_segs<CGAL::SM_overlayer<CGAL::SM_decorator<CGAL::Sphere_map<CGAL::Sphere_geometry<CGAL::Simple_cartesianCGAL::Gmpq >, CGAL::SM_items, bool> > >, std::_List_iterator<CGAL::Sphere_segment<CGAL::Simple_cartesianCGAL::Gmpq > > >, CGAL::Positive_halfsphere_geometry<CGAL::Simple_cartesianCGAL::Gmpq > >::compare_pnts_xy::operator()(CGAL::Sphere_point<CGAL::Simple_cartesianCGAL::Gmpq > const&, CGAL::Sphere_point<CGAL::Simple_cartesianCGAL::Gmpq > const&) const (/home/gimeno/CGAL/Nef_S2/examples/build/draw_nef_s2+0x258b72)
#2 0x559e02584749 in CGAL::Multiset<CGAL::Sphere_point<CGAL::Simple_cartesianCGAL::Gmpq >, CGAL::stl_seg_overlay_traits<std::_List_iterator<CGAL::Sphere_segment<CGAL::Simple_cartesianCGAL::Gmpq > >, CGAL::SMO_from_segs<CGAL::SM_overlayer<CGAL::SM_decorator<CGAL::Sphere_map<CGAL::Sphere_geometry<CGAL::Simple_cartesianCGAL::Gmpq >, CGAL::SM_items, bool> > >, std::_List_iterator<CGAL::Sphere_segment<CGAL::Simple_cartesianCGAL::Gmpq > > >, CGAL::Positive_halfsphere_geometry<CGAL::Simple_cartesianCGAL::Gmpq > >::compare_pnts_xy, std::allocator >::Node* CGAL::Multiset<CGAL::Sphere_point<CGAL::Simple_cartesianCGAL::Gmpq >, CGAL::stl_seg_overlay_traits<std::_List_iterator<CGAL::Sphere_segment<CGAL::Simple_cartesianCGAL::Gmpq > >, CGAL::SMO_from_segs<CGAL::SM_overlayer<CGAL::SM_decorator<CGAL::Sphere_map<CGAL::Sphere_geometry<CGAL::Simple_cartesianCGAL::Gmpq >, CGAL::SM_items, bool> > >, std::_List_iterator<CGAL::Sphere_segment<CGAL::Simple_cartesianCGAL::Gmpq > > >, CGAL::Positive_halfsphere_geometry<CGAL::Simple_cartesianCGAL::Gmpq > >::compare_pnts_xy, std::allocator >::_bound<CGAL::Sphere_point<CGAL::Simple_cartesianCGAL::Gmpq >, CGAL::stl_seg_overlay_traits<std::_List_iterator<CGAL::Sphere_segment<CGAL::Simple_cartesianCGAL::Gmpq > >, CGAL::SMO_from_segs<CGAL::SM_overlayer<CGAL::SM_decorator<CGAL::Sphere_map<CGAL::Sphere_geometry<CGAL::Simple_cartesianCGAL::Gmpq >, CGAL::SM_items, bool> > >, std::_List_iterator<CGAL::Sphere_segment<CGAL::Simple_cartesianCGAL::Gmpq > > >, CGAL::Positive_halfsphere_geometry<CGAL::Simple_cartesianCGAL::Gmpq > >::compare_pnts_xy>(CGAL::Multiset<CGAL::Sphere_point<CGAL::Simple_cartesianCGAL::Gmpq >, CGAL::stl_seg_overlay_traits<std::_List_iterator<CGAL::Sphere_segment<CGAL::Simple_cartesianCGAL::Gmpq > >, CGAL::SMO_from_segs<CGAL::SM_overlayer<CGAL::SM_decorator<CGAL::Sphere_map<CGAL::Sphere_geometry<CGAL::Simple_cartesianCGAL::Gmpq >, CGAL::SM_items, bool> > >, std::_List_iterator<CGAL::Sphere_segment<CGAL::Simple_cartesianCGAL::Gmpq > > >, CGAL::Positive_halfsphere_geometry<CGAL::Simple_cartesianCGAL::Gmpq > >::compare_pnts_xy, std::allocator >::Bound_type, CGAL::Sphere_point<CGAL::Simple_cartesianCGAL::Gmpq > const&, CGAL::stl_seg_overlay_traits<std::_List_iterator<CGAL::Sphere_segment<CGAL::Simple_cartesianCGAL::Gmpq > >, CGAL::SMO_from_segs<CGAL::SM_overlayer<CGAL::SM_decorator<CGAL::Sphere_map<CGAL::Sphere_geometry<CGAL::Simple_cartesianCGAL::Gmpq >, CGAL::SM_items, bool> > >, std::_List_iterator<CGAL::Sphere_segment<CGAL::Simple_cartesianCGAL::Gmpq > > >, CGAL::Positive_halfsphere_geometry<CGAL::Simple_cartesianCGAL::Gmpq > >::compare_pnts_xy const&, bool&) const (/home/gimeno/CGAL/Nef_S2/examples/build/draw_nef_s2+0x29e749)
#3 0x559e0257d281 in CGAL::Multiset<CGAL::Sphere_point<CGAL::Simple_cartesianCGAL::Gmpq >, CGAL::stl_seg_overlay_traits<std::_List_iterator<CGAL::Sphere_segment<CGAL::Simple_cartesianCGAL::Gmpq > >, CGAL::SMO_from_segs<CGAL::SM_overlayer<CGAL::SM_decorator<CGAL::Sphere_map<CGAL::Sphere_geometry<CGAL::Simple_cartesianCGAL::Gmpq >, CGAL::SM_items, bool> > >, std::_List_iterator<CGAL::Sphere_segment<CGAL::Simple_cartesianCGAL::Gmpq > > >, CGAL::Positive_halfsphere_geometry<CGAL::Simple_cartesianCGAL::Gmpq > >::compare_pnts_xy, std::allocator >::iterator CGAL::Multiset<CGAL::Sphere_point<CGAL::Simple_cartesianCGAL::Gmpq >, CGAL::stl_seg_overlay_traits<std::_List_iterator<CGAL::Sphere_segment<CGAL::Simple_cartesianCGAL::Gmpq > >, CGAL::SMO_from_segs<CGAL::SM_overlayer<CGAL::SM_decorator<CGAL::Sphere_map<CGAL::Sphere_geometry<CGAL::Simple_cartesianCGAL::Gmpq >, CGAL::SM_items, bool> > >, std::_List_iterator<CGAL::Sphere_segment<CGAL::Simple_cartesianCGAL::Gmpq > > >, CGAL::Positive_halfsphere_geometry<CGAL::Simple_cartesianCGAL::Gmpq > >::compare_pnts_xy, std::allocator >::upper_bound<CGAL::Sphere_point<CGAL::Simple_cartesianCGAL::Gmpq >, CGAL::stl_seg_overlay_traits<std::_List_iterator<CGAL::Sphere_segment<CGAL::Simple_cartesianCGAL::Gmpq > >, CGAL::SMO_from_segs<CGAL::SM_overlayer<CGAL::SM_decorator<CGAL::Sphere_map<CGAL::Sphere_geometry<CGAL::Simple_cartesianCGAL::Gmpq >, CGAL::SM_items, bool> > >, std::_List_iterator<CGAL::Sphere_segment<CGAL::Simple_cartesianCGAL::Gmpq > > >, CGAL::Positive_halfsphere_geometry<CGAL::Simple_cartesianCGAL::Gmpq > >::compare_pnts_xy>(CGAL::Sphere_point<CGAL::Simple_cartesianCGAL::Gmpq > const&, CGAL::stl_seg_overlay_traits<std::_List_iterator<CGAL::Sphere_segment<CGAL::Simple_cartesianCGAL::Gmpq > >, CGAL::SMO_from_segs<CGAL::SM_overlayer<CGAL::SM_decorator<CGAL::Sphere_map<CGAL::Sphere_geometry<CGAL::Simple_cartesianCGAL::Gmpq >, CGAL::SM_items, bool> > >, std::_List_iterator<CGAL::Sphere_segment<CGAL::Simple_cartesianCGAL::Gmpq > > >, CGAL::Positive_halfsphere_geometry<CGAL::Simple_cartesianCGAL::Gmpq > >::compare_pnts_xy const&) (/home/gimeno/CGAL/Nef_S2/examples/build/draw_nef_s2+0x297281)
#4 0x559e0253f402 in CGAL::Multiset<CGAL::Sphere_point<CGAL::Simple_cartesianCGAL::Gmpq >, CGAL::stl_seg_overlay_traits<std::_List_iterator<CGAL::Sphere_segment<CGAL::Simple_cartesianCGAL::Gmpq > >, CGAL::SMO_from_segs<CGAL::SM_overlayer<CGAL::SM_decorator<CGAL::Sphere_map<CGAL::Sphere_geometry<CGAL::Simple_cartesianCGAL::Gmpq >, CGAL::SM_items, bool> > >, std::_List_iterator<CGAL::Sphere_segment<CGAL::Simple_cartesianCGAL::Gmpq > > >, CGAL::Positive_halfsphere_geometry<CGAL::Simple_cartesianCGAL::Gmpq > >::compare_pnts_xy, std::allocator >::upper_bound(CGAL::Sphere_point<CGAL::Simple_cartesianCGAL::Gmpq > const&) (/home/gimeno/CGAL/Nef_S2/examples/build/draw_nef_s2+0x259402)
#5 0x559e024fec4e in CGAL::stl_seg_overlay_traits<std::_List_iterator<CGAL::Sphere_segment<CGAL::Simple_cartesianCGAL::Gmpq > >, CGAL::SMO_from_segs<CGAL::SM_overlayer<CGAL::SM_decorator<CGAL::Sphere_map<CGAL::Sphere_geometry<CGAL::Simple_cartesianCGAL::Gmpq >, CGAL::SM_items, bool> > >, std::_List_iterator<CGAL::Sphere_segment<CGAL::Simple_cartesianCGAL::Gmpq > > >, CGAL::Positive_halfsphere_geometry<CGAL::Simple_cartesianCGAL::Gmpq > >::insertXS(CGAL::Sphere_point<CGAL::Simple_cartesianCGAL::Gmpq > const&) (/home/gimeno/CGAL/Nef_S2/examples/build/draw_nef_s2+0x218c4e)
#6 0x559e024cc471 in CGAL::stl_seg_overlay_traits<std::_List_iterator<CGAL::Sphere_segment<CGAL::Simple_cartesianCGAL::Gmpq > >, CGAL::SMO_from_segs<CGAL::SM_overlayer<CGAL::SM_decorator<CGAL::Sphere_map<CGAL::Sphere_geometry<CGAL::Simple_cartesianCGAL::Gmpq >, CGAL::SM_items, bool> > >, std::_List_iterator<CGAL::Sphere_segment<CGAL::Simple_cartesianCGAL::Gmpq > > >, CGAL::Positive_halfsphere_geometry<CGAL::Simple_cartesianCGAL::Gmpq > >::initialize_structures() (/home/gimeno/CGAL/Nef_S2/examples/build/draw_nef_s2+0x1e6471)
#7 0x559e024b0add in CGAL::generic_sweep<CGAL::stl_seg_overlay_traits<std::_List_iterator<CGAL::Sphere_segment<CGAL::Simple_cartesianCGAL::Gmpq > >, CGAL::SMO_from_segs<CGAL::SM_overlayer<CGAL::SM_decorator<CGAL::Sphere_map<CGAL::Sphere_geometry<CGAL::Simple_cartesianCGAL::Gmpq >, CGAL::SM_items, bool> > >, std::_List_iterator<CGAL::Sphere_segment<CGAL::Simple_cartesianCGAL::Gmpq > > >, CGAL::Positive_halfsphere_geometry<CGAL::Simple_cartesianCGAL::Gmpq > > >::sweep() (/home/gimeno/CGAL/Nef_S2/examples/build/draw_nef_s2+0x1caadd)
#8 0x559e024a1c89 in void CGAL::SM_overlayer<CGAL::SM_decorator<CGAL::Sphere_map<CGAL::Sphere_geometry<CGAL::Simple_cartesianCGAL::Gmpq >, CGAL::SM_items, bool> > >::create_from_circles<std::_List_iterator<CGAL::Sphere_circle<CGAL::Simple_cartesianCGAL::Gmpq > > >(std::_List_iterator<CGAL::Sphere_circle<CGAL::Simple_cartesianCGAL::Gmpq > >, std::_List_iterator<CGAL::Sphere_circle<CGAL::Simple_cartesianCGAL::Gmpq > >) (/home/gimeno/CGAL/Nef_S2/examples/build/draw_nef_s2+0x1bbc89)
#9 0x559e0249bd4d in CGAL::Nef_polyhedron_S2<CGAL::Simple_cartesianCGAL::Gmpq, CGAL::SM_items, bool, CGAL::Sphere_map<CGAL::Sphere_geometry<CGAL::Simple_cartesianCGAL::Gmpq >, CGAL::SM_items, bool> >::Nef_polyhedron_S2<std::_List_iterator<CGAL::Sphere_circle<CGAL::Simple_cartesianCGAL::Gmpq > > >(std::_List_iterator<CGAL::Sphere_circle<CGAL::Simple_cartesianCGAL::Gmpq > >, std::_List_iterator<CGAL::Sphere_circle<CGAL::Simple_cartesianCGAL::Gmpq > >, double) (/home/gimeno/CGAL/Nef_S2/examples/build/draw_nef_s2+0x1b5d4d)
#10 0x559e024978b7 in void CGAL::create_random_Nef_S2<CGAL::Simple_cartesianCGAL::Gmpq, CGAL::SM_items, bool>(CGAL::Nef_polyhedron_S2<CGAL::Simple_cartesianCGAL::Gmpq, CGAL::SM_items, bool, CGAL::Sphere_map<CGAL::Sphere_geometry<CGAL::Simple_cartesianCGAL::Gmpq >, CGAL::SM_items, bool> >&, int, int) (/home/gimeno/CGAL/Nef_S2/examples/build/draw_nef_s2+0x1b18b7)
#11 0x559e024880a2 in main (/home/gimeno/CGAL/Nef_S2/examples/build/draw_nef_s2+0x1a20a2)
#12 0x7f70101c6b96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)
#13 0x559e02487ad9 in _start (/home/gimeno/CGAL/Nef_S2/examples/build/draw_nef_s2+0x1a1ad9)

Address 0x7ffd86440390 is located in stack of thread T0 at offset 96 in frame
#0 0x559e024a0c71 in void CGAL::SM_overlayer<CGAL::SM_decorator<CGAL::Sphere_map<CGAL::Sphere_geometry<CGAL::Simple_cartesianCGAL::Gmpq >, CGAL::SM_items, bool> > >::create_from_circles<std::_List_iterator<CGAL::Sphere_circle<CGAL::Simple_cartesianCGAL::Gmpq > > >(std::_List_iterator<CGAL::Sphere_circle<CGAL::Simple_cartesianCGAL::Gmpq > >, std::_List_iterator<CGAL::Sphere_circle<CGAL::Simple_cartesianCGAL::Gmpq > >) (/home/gimeno/CGAL/Nef_S2/examples/build/draw_nef_s2+0x1bac71)

This frame has 46 object(s):
[32, 33) ''
[96, 100) '' <== Memory access at offset 96 is inside this variable
[160, 164) ''
[224, 228) ''
[288, 292) ''
[352, 360) 'it'
[416, 424) ''
[480, 488) ''
[544, 552) ''
[608, 616) ''
[672, 680) ''
[736, 744) ''
[800, 808) ''
[864, 872) ''
[928, 936) ''
[992, 1000) ''
[1056, 1064) ''
[1120, 1128) ''
[1184, 1192) ''
[1248, 1256) 'v'
[1312, 1320) 'e'
[1376, 1384) ''
[1440, 1448) ''
[1504, 1512) ''
[1568, 1576) ''
[1632, 1640) ''
[1696, 1704) ''
[1760, 1768) 'u'
[1824, 1832) ''
[1888, 1896) 's'
[1952, 1968) 'spair'
[2016, 2032) ''
[2080, 2096) ''
[2144, 2288) 'From_input'
[2336, 2360) 'L'
[2400, 2424) 'L_pos'
[2464, 2488) 'L_neg'
[2528, 2560) ''
[2592, 2624) ''
[2656, 2688) ''
[2720, 2752) ''
[2784, 2816) ''
[2848, 2880) ''
[2912, 2952) 'O'
[3008, 4384) 'SP'
[4416, 5792) 'SM'
HINT: this may be a false positive if your program uses some custom stack unwind mechanism or swapcontext
(longjmp and C++ exceptions are supported)
SUMMARY: AddressSanitizer: stack-use-after-scope (/home/gimeno/CGAL/Nef_S2/examples/build/draw_nef_s2+0x1f50af) in CGAL::Positive_halfsphere_geometry<CGAL::Simple_cartesianCGAL::Gmpq >::compare_xy(CGAL::Sphere_point<CGAL::Simple_cartesianCGAL::Gmpq > const&, CGAL::Sphere_point<CGAL::Simple_cartesianCGAL::Gmpq > const&) const
Shadow bytes around the buggy address:
0x100030c80020: f2 f2 00 00 00 f2 f2 f2 f2 f2 00 00 00 f2 f2 f2
0x100030c80030: f2 f2 00 00 00 f2 f2 f2 f2 f2 00 00 00 f2 f2 f2
0x100030c80040: f2 f2 00 00 00 f2 f2 f2 f2 f2 00 00 00 00 f3 f3
0x100030c80050: f3 f3 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x100030c80060: 00 00 00 00 00 00 f1 f1 f1 f1 f8 f2 f2 f2 f2 f2
=>0x100030c80070: f2 f2[f8]f2 f2 f2 f2 f2 f2 f2 04 f2 f2 f2 f2 f2
0x100030c80080: f2 f2 04 f2 f2 f2 f2 f2 f2 f2 04 f2 f2 f2 f2 f2
0x100030c80090: f2 f2 00 f2 f2 f2 f2 f2 f2 f2 f8 f2 f2 f2 f2 f2
0x100030c800a0: f2 f2 f8 f2 f2 f2 f2 f2 f2 f2 f8 f2 f2 f2 f2 f2
0x100030c800b0: f2 f2 f8 f2 f2 f2 f2 f2 f2 f2 f8 f2 f2 f2 f2 f2
0x100030c800c0: f2 f2 f8 f2 f2 f2 f2 f2 f2 f2 f8 f2 f2 f2 f2 f2
Shadow byte legend (one shadow byte represents 8 application bytes):
Addressable: 00
Partially addressable: 01 02 03 04 05 06 07
Heap left redzone: fa
Freed heap region: fd
Stack left redzone: f1
Stack mid redzone: f2
Stack right redzone: f3
Stack after return: f5
Stack use after scope: f8
Global redzone: f9
Global init order: f6
Poisoned by user: f7
Container overflow: fc
Array cookie: ac
Intra object redzone: bb
ASan internal: fe
Left alloca redzone: ca
Right alloca redzone: cb
==11859==ABORTING

Apparently, compare_xy() is called on a point that has been destroyed.

@cedricpradalier
Copy link
Author

cedricpradalier commented Dec 7, 2018 via email

@maxGimeno
Copy link
Contributor

For me it's just that trying to access an invalid address is a very unstable operation, that shouldn't ever work, but as long as the memory has not been re-allocated, it is still there, so it doesn't crash. From here, moving anything can lead to altering this memory, and lead to a segfault.

@cedricpradalier
Copy link
Author

I am pretty sure this happens in SM_Overlayer but I am not familiar enough with the core of the algorithm to identify what is happenning. I suspect some part of the algorithm relying on the reference counting in some types when deleting iterators but I cannot pinpoint it.

I tried with Simple_homogeneous<Exact_integer>, Homogeneous<Exact_integer>, Cartesian<mpq_class>, Simple_cartesian<mpq_class>, Cartesian<Exact_rational> and Simple_cartesian<Exact_rational>. Only Simple_cartesian<Exact_rational> exhibits the issue on my system.

@maxGimeno
Copy link
Contributor

On my machine, the sanitizer error is still triggered even with Cartesian<exact_rational>

@lrineau lrineau added this to the Trash / Attic milestone Feb 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Nef_S2 Qt visualization
5 participants