Skip to content

Emplace back is buggy when called on an empty vector #21

@kstppd

Description

@kstppd

Not being used by anyone currently but to be fixed:
Vallgrind output showing the move :

==26511== Invalid write of size 2
==26511==    at 0x4C38753: memmove (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==26511==    by 0x12A084: __copy_m<int> (stl_algobase.h:368)
==26511==    by 0x12A084: __copy_move_a<true, int*, int*> (stl_algobase.h:385)
==26511==    by 0x12A084: __copy_move_a2<true, int*, int*> (stl_algobase.h:422)
==26511==    by 0x12A084: move<int*, int*> (stl_algobase.h:487)
==26511==    by 0x12A084: split::SplitVector<int, split::split_host_allocator<int> >::iterator split::SplitVector<int, split::split_host_allocator<int> >::emplace<int>(split::SplitVector<int, split::split_host_allocator<int> >::iterator, int&&) (splitvec.h:1275)
==26511==    by 0x124B63: emplace_back<int> (splitvec.h:1289)
==26511==    by 0x124B63: Vector_Functionality_Emplace_Back_Test::TestBody() (vec_test.cu:389)
==26511==    by 0x154710: void testing::internal::HandleSehExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) (in /home/kostis/dev/hashinator/unit_tests/gtestvechost)
==26511==    by 0x14E6B6: void testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) (in /home/kostis/dev/hashinator/unit_tests/gtestvechost)
==26511==    by 0x131EF5: testing::Test::Run() (in /home/kostis/dev/hashinator/unit_tests/gtestvechost)
==26511==    by 0x13282B: testing::TestInfo::Run() (in /home/kostis/dev/hashinator/unit_tests/gtestvechost)
==26511==    by 0x132EB5: testing::TestCase::Run() (in /home/kostis/dev/hashinator/unit_tests/gtestvechost)
==26511==    by 0x139D81: testing::internal::UnitTestImpl::RunAllTests() (in /home/kostis/dev/hashinator/unit_tests/gtestvechost)
==26511==    by 0x1558D6: bool testing::internal::HandleSehExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*) (in /home/kostis/dev/hashinator/unit_tests/gtestvechost)
==26511==    by 0x14F4F2: bool testing::internal::HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*) (in /home/kostis/dev/hashinator/unit_tests/gtestvechost)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions