-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Added Nef_S2 Qt5 visualization #3511
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
base: master
Are you sure you want to change the base?
Conversation
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. |
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 |
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 ) |
There was a problem hiding this comment.
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.
I don't know much about OpenGL but the original code use the glLightfv
function and gluQuadricNormal
/usr/bin/ld: CMakeFiles/nef_S2.dir/Qt_widget_OpenGL.cpp.o: undefined
reference to symbol 'glLightfv'
CGAL/Nef_S2/Sphere_geometry_OGL.h:471: undefined reference to
`gluQuadricNormals'
I tried removing glut GLU and GL and I got the above. I'm not sure what is
the proper CMake magic to find these one and how they combine with the
WITH_OPENGL flag.
…On Wed, Dec 5, 2018 at 9:43 AM Laurent Rineau ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In Nef_S2/examples/Nef_S2/CMakeLists.txt
<#3511 (comment)>:
> +
+ qt5_generate_moc(include/CGAL/Nef_S2/Qt_widget_OpenGL.h Qt_widget_OpenGL.h.moc.cpp)
+ qt5_generate_moc(include/CGAL/Nef_S2/Qt_widget_Nef_S2.h Qt_widget_Nef_S2.h.moc.cpp)
+
+
+ add_executable(nef_S2
+ "nef_S2.cpp"
+ "Qt_widget_OpenGL.h.moc.cpp"
+ "Qt_widget_Nef_S2.h.moc.cpp"
+ "Qt_widget_Nef_S2.cpp"
+ "Qt_widget_OpenGL.cpp" )
+ target_link_libraries(nef_S2 PRIVATE CGAL::CGAL)
+ 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 )
You probably do not need glut and GLU. And if you use the Qt5 OpenGL
module, GL is not required either.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#3511 (review)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAepk4IgdS2TZ-0wXsngOX1gnvEjutJWks5u14cngaJpZM4Y_YWF>
.
--
Cedric Pradalier
|
Thanks for the flag. I don't really believe in the G++ error either.
Now some more experiments. For reference, the code with numbered line is
below, I'm compiling in Release only. The errors I observed do not happen
in other compile mode.
1) First tests were made with Simple_cartesian kernel. Without line 25, the
program returns normally.
2) Adding line 25 triggers a segfault in line 16. Yes this is 10 lines
before. GDB reports the following:
(gdb) where
#0 0x000000000046ffc6 in
CGAL::stl_seg_overlay_traits<std::_List_iterator<CGAL::Sphere_segment<CGAL::Simple_cartesian<CGAL::Gmpq>
> >,
CGAL::SMO_from_segs<CGAL::SM_overlayer<CGAL::SM_decorator<CGAL::Sphere_map<CGAL::Sphere_geometry<CGAL::Simple_cartesian<CGAL::Gmpq>
>, CGAL::SM_items, bool> > >,
std::_List_iterator<CGAL::Sphere_segment<CGAL::Simple_cartesian<CGAL::Gmpq>
> > >,
CGAL::Negative_halfsphere_geometry<CGAL::Simple_cartesian<CGAL::Gmpq> >
>::process_event() ()
#1 0x000000000047272c in void
CGAL::SM_overlayer<CGAL::SM_decorator<CGAL::Sphere_map<CGAL::Sphere_geometry<CGAL::Simple_cartesian<CGAL::Gmpq>
>, CGAL::SM_items, bool> >
>::create_from_circles<std::_List_iterator<CGAL::Sphere_circle<CGAL::Simple_cartesian<CGAL::Gmpq>
> >
>(std::_List_iterator<CGAL::Sphere_circle<CGAL::Simple_cartesian<CGAL::Gmpq>
> >,
std::_List_iterator<CGAL::Sphere_circle<CGAL::Simple_cartesian<CGAL::Gmpq>
> >) ()
#2 0x0000000000473969 in void
CGAL::create_random_Nef_S2<CGAL::Simple_cartesian<CGAL::Gmpq>,
CGAL::SM_items,
bool>(CGAL::Nef_polyhedron_S2<CGAL::Simple_cartesian<CGAL::Gmpq>,
CGAL::SM_items, bool,
CGAL::Sphere_map<CGAL::Sphere_geometry<CGAL::Simple_cartesian<CGAL::Gmpq>
>, CGAL::SM_items, bool> >&, int, int) ()
#3 0x0000000000433c87 in main ()
3) Replacing Simple_cartesian with Cartesian (line 9 vs 10), makes the
problem disappear.
… 1. #include <CGAL/basic.h>
2. #include <CGAL/Exact_rational.h>
3. #include <CGAL/Simple_cartesian.h>
4. #include <CGAL/Cartesian.h>
5. #include <CGAL/Nef_polyhedron_S2.h>
6. #include "CGAL/Nef_S2/create_random_Nef_S2.h"
7. #include "CGAL/Nef_S2/draw_nef_S2.h"
8. typedef CGAL::Exact_rational FT;
9. // typedef CGAL::Cartesian<FT> Kernel;
10. typedef CGAL::Simple_cartesian<FT> Kernel;
11. typedef CGAL::Nef_polyhedron_S2<Kernel> Nef_polyhedron_S2;
12. int main(int argc, char* argv[])
13. {
14. Nef_polyhedron_S2 S1,S2,S3;
15. std::cout << "Create RANDOM 0" << std::endl;
16. create_random_Nef_S2(S1,5);
17. std::cout << "Create RANDOM 1" << std::endl;
18. create_random_Nef_S2(S2,5);
19. std::cout << "Create RANDOM 2" << std::endl;
20. create_random_Nef_S2(S3,5);
21. std::cout << "Create RANDOM Done" << std::endl;
22. std::cout << S1 << std::endl;
23. std::cout << S2 << std::endl;
24. std::cout << S3 << std::endl;
25. CGAL::draw<Nef_polyhedron_S2>(S3);
26. return EXIT_SUCCESS;
27. }
On Wed, Dec 5, 2018 at 9:41 AM Laurent Rineau ***@***.***> wrote:
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.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#3511 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAepkzTe_LWu7Tya0r9uHRi8xM3z82Wjks5u14bKgaJpZM4Y_YWF>
.
--
Cedric Pradalier
|
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;
};
|
Sorry, I did not know about CGAL_MUTEX; Thanks for patching. |
Hi @cedricpradalier, We are reluctant to integrate the pull-request as it is, because its code uses:
@maxGimeno will have a look at the code, and try to find how much work from him would be necessary to transform the code. |
Thanks. I have no knowledge about this part at all. I just ported the Qt3 version and left all the opengl as is. |
@cedricpradalier Can you please add us as collaborators of your fork? https://github.com/cedricpradalier/cgal/settings/collaboration Please add |
@maxGimeno @lrineau I suggest again to use basic viewer... |
@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. |
@gdamiand commented on Dec 7, 2018, 11:35 AM GMT+1:
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. |
Yes it is possible to inherit from basic viewer and add interactions (I just did that for the LCC demo, cf my last PR). |
Thanks @cedricpradalier. I have pushed the fix with |
About the segfault, with the flag |
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... |
Can you send me your AddressSanitizer output for comparison? It may gives me an hint on where to search. Thanks |
I get :==11859==ERROR: AddressSanitizer: stack-use-after-scope on address 0x7ffd86440390 at pc 0x559e024db0b0 bp 0x7ffd8643f9a0 sp 0x7ffd8643f990 Address 0x7ffd86440390 is located in stack of thread T0 at offset 96 in frame This frame has 46 object(s): Apparently, compare_xy() is called on a point that has been destroyed. |
Ok, this is consistent with what gdb reports and fairly deep inside the
Nef_S2 constructor.
This does not really explains why this happens only in release mode and
only if we plan to display the polygon *later* in the code.
…On Fri, Dec 7, 2018, 13:02 Maxime GIMENO ***@***.*** wrote:
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 <#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 <#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 <#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 <#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 <#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 <#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 <#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 <#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 <#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 <#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 <#11> 0x559e024880a2 in main
(/home/gimeno/CGAL/Nef_S2/examples/build/draw_nef_s2+0x1a20a2)
#12 <#12> 0x7f70101c6b96 in
__libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)
#13 <#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, conpare_xy() is called on a point that has been destroyed.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#3511 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAepk8OTM1L_wHJHPNsX0pd-ZcigM_W1ks5u2ljTgaJpZM4Y_YWF>
.
|
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. |
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. |
On my machine, the sanitizer error is still triggered even with Cartesian<exact_rational> |
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