Skip to Content.
Sympa Menu

cgal-discuss - [cgal-discuss] Crash when calling operator += with lazy_exact_nt

Subject: CGAL users discussion list

List archive

[cgal-discuss] Crash when calling operator += with lazy_exact_nt


Chronological Thread 
  • From: <>
  • To:
  • Subject: [cgal-discuss] Crash when calling operator += with lazy_exact_nt
  • Date: Thu, 25 Sep 2008 12:39:26 +0200 (CEST)

Hi,
I have encountered a problem when using CGAL and I was wondering if anyone
knows how to fix this. The problem is that when I run the following code the
application crashes.

The code:
#include <CGAL/Exact_predicates_exact_constructions_kernel.h>

typedef CGAL::Exact_predicates_exact_constructions_kernel KERNEL;
typedef KERNEL::FT

NUMBER_TYPE;

int main( int argc, char* argv[])
{
NUMBER_TYPE num1 = 4;
NUMBER_TYPE num2 = 3;


for (int i =0; i< 100000; i++)
{
num1+=num2;
}
num1 = 5;
num2 =4;
};

I compile the code with the following preprocessor definitions :
CGAL_USE_GMP;_SECURE_SCL=0

I use CGAL 3.3.1 downloaded from the site using the windows installer (when
tested with vs2005) and boost 1.35 from the Boost Consulting web site.
The code is compiled using Visual Studio 2005 and Visual Studio 2008 compilers
on Windows XP, Windows Vista. The application was tested on various different
computers (both Intel and AMD based). The runtime library is Multi-threaded
Debug when compiled in Debug and Multi-threaded when compiled in Release.
It falls both for Debug and Release.
What I have noticed that when I run the loop for a small number of iterations
the application does not crash. When I increase the number of iterations, the
application crashes in Debug but not in Release. When I increase the number of
iterations furthermore, it also falls in Release.


Here is the call stack when I run it in Debug:
1.
test+.exe!CGAL::Lazy_exact_nt<CGAL::Gmpq>::~Lazy_exact_nt<CGAL::Gmpq>() + 0x9
bytes C++
2.
test+.exe!CGAL::Lazy_exact_binary<CGAL::Gmpq,CGAL::Gmpq,CGAL::Gmpq>::~Lazy_exact_binary<CGAL::Gmpq,CGAL::Gmpq,CGAL::Gmpq>()
+ 0x54 bytes C++
3.
test+.exe!CGAL::Lazy_exact_Add<CGAL::Gmpq,CGAL::Gmpq,CGAL::Gmpq>::~Lazy_exact_Add<CGAL::Gmpq,CGAL::Gmpq,CGAL::Gmpq>()
+ 0x2b bytes C++
4.
test+.exe!CGAL::Lazy_exact_Add<CGAL::Gmpq,CGAL::Gmpq,CGAL::Gmpq>::`scalar
deleting destructor'() + 0x2b bytes C++
and 166 loops of the following:
5. test+.exe!CGAL::Handle::~Handle() Line 58 + 0x36 bytes
C++
6.
test+.exe!CGAL::Lazy<CGAL::Interval_nt<0>,CGAL::Gmpq,CGAL::Lazy_exact_nt<CGAL::Gmpq>,CGAL::To_interval<CGAL::Gmpq>
>::~Lazy<CGAL::Interval_nt<0>,CGAL::Gmpq,CGAL::Lazy_exact_nt<CGAL::Gmpq>,CGAL::To_interval<CGAL::Gmpq>
>() + 0x2b bytes C++
7.
test+.exe!CGAL::Lazy_exact_nt<CGAL::Gmpq>::~Lazy_exact_nt<CGAL::Gmpq>() +
0x2b
bytes C++
8.
test+.exe!CGAL::Lazy_exact_binary<CGAL::Gmpq,CGAL::Gmpq,CGAL::Gmpq>::~Lazy_exact_binary<CGAL::Gmpq,CGAL::Gmpq,CGAL::Gmpq>()
+ 0x63 bytes C++
9.
test+.exe!CGAL::Lazy_exact_Add<CGAL::Gmpq,CGAL::Gmpq,CGAL::Gmpq>::~Lazy_exact_Add<CGAL::Gmpq,CGAL::Gmpq,CGAL::Gmpq>()
+ 0x2b bytes C++
10.
test+.exe!CGAL::Lazy_exact_Add<CGAL::Gmpq,CGAL::Gmpq,CGAL::Gmpq>::`scalar
deleting destructor'() + 0x2b bytes C++

Thank you in advance
Shiran Ben Israel



Archive powered by MHonArc 2.6.16.

Top of Page