Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Heap corruption when constructing AABB tree with OPENMP

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Heap corruption when constructing AABB tree with OPENMP


Chronological Thread 
  • From: Andreas Fabri <>
  • To:
  • Subject: Re: [cgal-discuss] Heap corruption when constructing AABB tree with OPENMP
  • Date: Sat, 22 Feb 2020 21:53:05 +0100
  • Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None ; spf=None ; spf=None
  • Ironport-phdr: 9a23:fdLZLhE1uC1pDbT1aC65s51GYnF86YWxBRYc798ds5kLTJ76p8u+bnLW6fgltlLVR4KTs6sC17OK9fC+EjVcuN6oizMrTt9lb1c9k8IYnggtUoauKHbQC7rUVRE8B9lIT1R//nu2YgB/Ecf6YEDO8DXptWZBUhrwOhBoKevrB4Xck9q41/yo+53Ufg5EmCexbal9IRmrogjdrMobjIptJqosxRbFv2ZDdvhLy29vOV+ckBHw69uq8pV+6SpQofUh98BBUaX+Yas1SKFTASolPW4o+sDlrAHPQgST6HQSVGUWiQdIDBPe7B7mRJfxszD1ufR71SKHIMD5V7E0WTCl76d2VB/ljToMOjAl/G3LjMF7kaRWqw+jqRNi2Y7ZeJybOuRwfq3dft0US2ROUclTWCNdGY6zdZcDAvAbMOpEoYTwp10Dpga+Cwm2A+PvzydFi2Pw3aInyeQuDxvJ3Bc9FNwOqnvbt8/1NKYPWu2y1qbIyyjMb+lI1jjn84jEaB4hruuXUrJqcMrc0kYvGB3CjlWVt4PlIymV1+QDs2eB8+VgSeWvi3Qnqg1rvjevwcIsh5DPi4kIxF7E8iB5z5w0Jd2+UEN7ZN+kH4dKtyGdLIt2Rc0iQ31ytCkmzb0GvJi2dzUJxpQ/3xPSZP2Kf5KV7h7/VOudOzd1iXN/dL+9hhu+6UytxvHmWsS3ylpGsDRJn9rWunwQ0xHe6dCLRudn8ku9wzqDyxrf5v1CLEspi6fbL4MhwqUslpUNq0TNAy72mUTog6KOakkp/PWj5f79bbX8vJCcMpd5igHgPaQqncyyGeU1PhILX2ic5Oix1rnu8Vf8QLpQj/02lrDVsJfHJcQHvKK5BBFV0oY55xa5ETimzMwUnXgBLF1bZBKKl4fkNlDULPzlEfuyg06gnTdqyvzcPLDsA43BLn3Zn7fgebZ95VRcyA02zd1H/Z1UDKwOIOjtVUDrr9zUFBE5PBavzOb9CdVwzYweVnyIAq+cLqzSrUWI5+IhI+aWeIAVpDH9K+Il5vL0kXA5nlodcbGz3ZQLcHC4AuhmI0KBbHXwjdcOC2MKshMjQ+zrk12NTSNTZ22pX68n/TE6CIemDZ/ZSYy3gbyB2j27HpxMaWxcBFCMC2/kd4CDW/gRdi2fOtRhkjkYVbi5UoMh0gyutBPix7pnMOXU/ioYuIr71Nhx/eLSlQ899SZ2Asmfzm2BVWF0kXkSSz8xwqB/oVZxylGd3qhkm/BYFNpT6O1VUgoiKZLQ1fB2B8ruVg7bYtuFUEymTcm+ATEtUtIxxMcDbFpyG9q4ihDPxjelA74Ol7OXGZw06bnc0mPwJ8Z70XbG1bMug0MoQstVZiWagft0+AHXQoLIiE6EjL2CdKIG3SeL+n3Q43CJuRRxVgJqXKzeFV4WbFHX5YDw4E/YQra1T7ouOBFA4cGPLa5Hdsf4g1xNWPD5KZLVZGfnyDT4PgqB2r7ZNNmiQG4axiiIUBFVwTBWxm6PME0FPgnkpmvfCDJ0Ele1OhHj/O57pW+hX0E9xB2NdVwn3L2wqEZM2a6sDsgL17dBgx8P7i1uFQzkjd3bDN+NuxBwcqxXfdQn8RFM0meL71UgbKzlFLhrgxslSyoyv07q0E8pWNsGlM9z8yJsyQNzLeefzU8HcC2Ym5b9Ju+PJw==

What kernel do you use?

On 2/22/2020 9:51 PM, Yifang Zhao wrote:
I have a for loop containing approximately 1,000,000 iterations of calling AABBTree.all_intersections() method. Thus, I use #pragma omp parallel for to speed up the program. However, I got an error as "A heap has been corrupted". The cpp file is roughly like the following:
Polyhedron polyhedron;
Facet_tree m_facet_tree(faces(m_polyhedron).first, faces(m_polyhedron).second, m_polyhedon);
 
#pragma omp parallel for
for (int i = 0; i<100; ++i){
    Plane plane = Plane(1, 0, 0, 0);
 
    // Compute intersections
    typedef std::vector<Facet_tree::Object_and_primitive_id> Intersections;
    Intersections intersections;
    m_facet_tree.all_intersections(plane, std::back_inserter(intersections));
}
Finally, The program will break here:
    ~Handle()
    {
    if ( PTR && (--PTR->count == 0))
        delete PTR;
    }
What are the possible reasons that cause this problem? Thanks a lot!

Kind Regards,

Yifang Zhao.

 

Sent from Mail for Windows 10

 

-- 
Andreas Fabri, PhD
Chief Officer, GeometryFactory
Editor, The CGAL Project

phone: +33.492.954.912    skype: andreas.fabri



Archive powered by MHonArc 2.6.18.

Top of Page