← Back to team overview

zorba-coders team mailing list archive

[Bug 944826] [NEW] Incorrect use of delete[] in ptr_rep

 

Public bug reported:

test/libunit/string

 ==28568== Mismatched free() / delete / delete []
==28568==    at 0x4C26A4B: operator delete[](void*) (vg_replace_malloc.c:409)
==28568==    by 0x5EED144: zorba::rstring<zorba::rstring_classes::ptr_rep<zorba::atomic_int, std::char_traits<char>, std::allocator<char> > >::~rstring() (ptr_rep.h:321)
==28568==    by 0x5EE8969: void test_non_empty<zorba::rstring<zorba::rstring_classes::ptr_rep<zorba::atomic_int, std::char_traits<char>, std::allocator<char> > > >(zorba::rstring<zorba::rstring_classes::ptr_rep<zorba::atomic_int, std::char_traits<char>, std::allocator<char> > >&, char const*) (string.cpp:136)
==28568==    by 0x5EE8D33: void test<zorba::rstring<zorba::rstring_classes::ptr_rep<zorba::atomic_int, std::char_traits<char>, std::allocator<char> > > >() (string.cpp:152)
==28568==    by 0x5EEAA9A: zorba::UnitTests::test_string(int, char**) (string.cpp:792)
==28568==    by 0x5EF5BCF: zorba::UnitTests::runUnitTest(int, char**) (unit_tests.cpp:72)
==28568==    by 0x400BAC: main (lib_unit_test.cpp:34)
==28568==  Address 0xaac7d70 is 0 bytes inside a block of size 6 alloc'd
==28568==    at 0x4C27CC1: operator new(unsigned long) (vg_replace_malloc.c:261)
==28568==    by 0x5EE83B8: void test_non_empty<zorba::rstring<zorba::rstring_classes::ptr_rep<zorba::atomic_int, std::char_traits<char>, std::allocator<char> > > >(zorba::rstring<zorba::rstring_classes::ptr_rep<zorba::atomic_int, std::char_traits<char>, std::allocator<char> > >&, char const*) (string.cpp:93)
==28568==    by 0x5EE8D33: void test<zorba::rstring<zorba::rstring_classes::ptr_rep<zorba::atomic_int, std::char_traits<char>, std::allocator<char> > > >() (string.cpp:152)
==28568==    by 0x5EEAA9A: zorba::UnitTests::test_string(int, char**) (string.cpp:792)
==28568==    by 0x5EF5BCF: zorba::UnitTests::runUnitTest(int, char**) (unit_tests.cpp:72)
==28568==    by 0x400BAC: main (lib_unit_test.cpp:34)

** Affects: zorba
     Importance: Medium
     Assignee: Paul J. Lucas (paul-lucas)
         Status: New

** Branch linked: lp:~paul-lucas/zorba/bug-944826

-- 
You received this bug notification because you are a member of Zorba
Coders, which is the registrant for Zorba.
https://bugs.launchpad.net/bugs/944826

Title:
  Incorrect use of delete[] in ptr_rep

Status in Zorba - The XQuery Processor:
  New

Bug description:
  test/libunit/string

   ==28568== Mismatched free() / delete / delete []
  ==28568==    at 0x4C26A4B: operator delete[](void*) (vg_replace_malloc.c:409)
  ==28568==    by 0x5EED144: zorba::rstring<zorba::rstring_classes::ptr_rep<zorba::atomic_int, std::char_traits<char>, std::allocator<char> > >::~rstring() (ptr_rep.h:321)
  ==28568==    by 0x5EE8969: void test_non_empty<zorba::rstring<zorba::rstring_classes::ptr_rep<zorba::atomic_int, std::char_traits<char>, std::allocator<char> > > >(zorba::rstring<zorba::rstring_classes::ptr_rep<zorba::atomic_int, std::char_traits<char>, std::allocator<char> > >&, char const*) (string.cpp:136)
  ==28568==    by 0x5EE8D33: void test<zorba::rstring<zorba::rstring_classes::ptr_rep<zorba::atomic_int, std::char_traits<char>, std::allocator<char> > > >() (string.cpp:152)
  ==28568==    by 0x5EEAA9A: zorba::UnitTests::test_string(int, char**) (string.cpp:792)
  ==28568==    by 0x5EF5BCF: zorba::UnitTests::runUnitTest(int, char**) (unit_tests.cpp:72)
  ==28568==    by 0x400BAC: main (lib_unit_test.cpp:34)
  ==28568==  Address 0xaac7d70 is 0 bytes inside a block of size 6 alloc'd
  ==28568==    at 0x4C27CC1: operator new(unsigned long) (vg_replace_malloc.c:261)
  ==28568==    by 0x5EE83B8: void test_non_empty<zorba::rstring<zorba::rstring_classes::ptr_rep<zorba::atomic_int, std::char_traits<char>, std::allocator<char> > > >(zorba::rstring<zorba::rstring_classes::ptr_rep<zorba::atomic_int, std::char_traits<char>, std::allocator<char> > >&, char const*) (string.cpp:93)
  ==28568==    by 0x5EE8D33: void test<zorba::rstring<zorba::rstring_classes::ptr_rep<zorba::atomic_int, std::char_traits<char>, std::allocator<char> > > >() (string.cpp:152)
  ==28568==    by 0x5EEAA9A: zorba::UnitTests::test_string(int, char**) (string.cpp:792)
  ==28568==    by 0x5EF5BCF: zorba::UnitTests::runUnitTest(int, char**) (unit_tests.cpp:72)
  ==28568==    by 0x400BAC: main (lib_unit_test.cpp:34)

To manage notifications about this bug go to:
https://bugs.launchpad.net/zorba/+bug/944826/+subscriptions


Follow ups

References