boostorg / thread

Boost.org thread module
http://boost.org/libs/thread
202 stars 163 forks source link

Aboated at boost::polygon::polygon_set_data<long long>::get() #372

Closed mleon08 closed 2 years ago

mleon08 commented 2 years ago

Executing this code aborted in version 1.66.0. I confirmed that aborted in version 1.79.0. Aborted when run in debug mode.

#include <stdio.h>
#include <stdlib.h>
#include <vector>

#include <boost/polygon/polygon.hpp>

namespace gtl = boost::polygon;
int main(int argc, char* argv[])
{
    gtl::polygon_set_data<long long>* polyset = new gtl::polygon_set_data<long long>;

    {
        gtl::polygon_data<long long>* ppoly = new gtl::polygon_data<long long>;
        std::vector<gtl::polygon_traits<gtl::polygon_data<long long>>::point_type> vpoint;
        vpoint.reserve(4);
        vpoint.push_back(gtl::polygon_traits<gtl::polygon_data<long long>>::point_type(346862000, 438294000));
        vpoint.push_back(gtl::polygon_traits<gtl::polygon_data<long long>>::point_type(346533000, 438337000));
        vpoint.push_back(gtl::polygon_traits<gtl::polygon_data<long long>>::point_type(353343000, 490071000));
        vpoint.push_back(gtl::polygon_traits<gtl::polygon_data<long long>>::point_type(353673000, 490027000));
        set_points(*ppoly, vpoint.begin(), vpoint.end());
        (*polyset).insert(*ppoly);
        delete ppoly;
    }

    {
        gtl::polygon_data<long long>* ppoly = new gtl::polygon_data<long long>;
        std::vector<gtl::polygon_traits<gtl::polygon_data<long long>>::point_type> vpoint;
        vpoint.reserve(4);
        vpoint.push_back(gtl::polygon_traits<gtl::polygon_data<long long>>::point_type(353626000, 489671000));
        vpoint.push_back(gtl::polygon_traits<gtl::polygon_data<long long>>::point_type(353176000, 489730000));
        vpoint.push_back(gtl::polygon_traits<gtl::polygon_data<long long>>::point_type(353223000, 490087000));
        vpoint.push_back(gtl::polygon_traits<gtl::polygon_data<long long>>::point_type(353673000, 490027000));
        set_points(*ppoly, vpoint.begin(), vpoint.end());
        (*polyset).insert(*ppoly);
        delete ppoly;
    }

    {
        gtl::polygon_data<long long>* ppoly = new gtl::polygon_data<long long>;
        std::vector<gtl::polygon_traits<gtl::polygon_data<long long>>::point_type> vpoint;
        vpoint.reserve(4);
        vpoint.push_back(gtl::polygon_traits<gtl::polygon_data<long long>>::point_type(354911000, 489643000));
        vpoint.push_back(gtl::polygon_traits<gtl::polygon_data<long long>>::point_type(354791000, 489659000));
        vpoint.push_back(gtl::polygon_traits<gtl::polygon_data<long long>>::point_type(354838000, 490016000));
        vpoint.push_back(gtl::polygon_traits<gtl::polygon_data<long long>>::point_type(354958000, 490000000));
        set_points(*ppoly, vpoint.begin(), vpoint.end());
        (*polyset).insert(*ppoly);
        delete ppoly;
    }

    {
        gtl::polygon_data<long long>* ppoly = new gtl::polygon_data<long long>;
        std::vector<gtl::polygon_traits<gtl::polygon_data<long long>>::point_type> vpoint;
        vpoint.reserve(4);
        vpoint.push_back(gtl::polygon_traits<gtl::polygon_data<long long>>::point_type(353296000, 489714000));
        vpoint.push_back(gtl::polygon_traits<gtl::polygon_data<long long>>::point_type(353176000, 489730000));
        vpoint.push_back(gtl::polygon_traits<gtl::polygon_data<long long>>::point_type(353223000, 490087000));
        vpoint.push_back(gtl::polygon_traits<gtl::polygon_data<long long>>::point_type(353343000, 490071000));
        set_points(*ppoly, vpoint.begin(), vpoint.end());
        (*polyset).insert(*ppoly);
        delete ppoly;
    }

    std::vector<gtl::polygon_data<long long>> result;
    polyset->get(result);

    delete  polyset;

    return 0;
}

This is the call stack and The value of the variable when aborting.

Please investigate the cause of the abort.

mleon08 commented 2 years ago

I should have posted this to boostorf/boost. I will post again.