Bug#739502: libstdc++6-4.7-dev: std::set<>::operator== uses operator== to compare elements

2014-02-19 Thread Skuratovich Sergey Nikolaevich
Package: libstdc++6-4.7-dev
Version: 4.7.2-5
Severity: important

Hello.

std::set<>::operator== uses operator== to compare elements instead of functor, 
specified in template parameters.
This makes imposible to compare sets of elements, which requires custom compare 
operator.
Minimal code example, which represents this wrong behaviour, is attached.

std::set<>::operator== uses underlying _Rb_tree container's operator== 
(stl_set.h:706),
which uses std::equal (stl_tree.h:867) to compare content by specifying 
iterators range.
std::equal, in turn, uses operator== to compare elements (stl_algobase.h:791).



-- System Information:
Debian Release: 7.4
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.2.0-4-amd64 (SMP w/4 CPU cores)
Locale: LANG=ru_RU.UTF-8, LC_CTYPE=ru_RU.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages libstdc++6-4.7-dev depends on:
ii  g++-4.7   4.7.2-5
ii  gcc-4.7-base  4.7.2-5
ii  libc6-dev 2.13-38+deb7u1
ii  libstdc++64.7.2-5

libstdc++6-4.7-dev recommends no packages.

Versions of packages libstdc++6-4.7-dev suggests:
pn  libstdc++6-4.7-doc  

-- no debconf information
#include 
#include 
#include 

template <
class C,
class PtrType = std::shared_ptr,
class Compare = std::less
>
class CompareByValue {
public:
CompareByValue(): cmp() {}
inline bool operator()(const PtrType& _1, const PtrType& _2) const {
return _1 ? (_2 && cmp(*_1, *_2)) : bool(_2);
}
private:
Compare cmp;
};

// Simple class with operator<.
class A {
public:
A(const std::size_t i_): i(i_) {}
bool operator<(const A& other) const {return i < other.i;}
std::size_t getI() const {return i;}
private:
const std::size_t i;
};

std::ostream& operator<<(std::ostream& stream, const A& c) {
return stream << c.getI();
}

int main(int, char**) {
typedef std::set, CompareByValue > Set;
using std::make_shared;

// Initializing containers
Set s0{make_shared(1), make_shared(2), make_shared(3)};
Set s1{make_shared(1), make_shared(2), make_shared(3)};

// Print containers content
for (const auto& s : {s0, s1}) {
for (const auto i : s)
std::cout << *i << " ";
std::cout << std::endl;
}

// Manually compare elements using CompareByValue<> and print results.
CompareByValue cmp;
for (auto i0 = s0.begin(), i1 = s1.begin(); i0 != s0.end(); ++i0, ++i1) {
std::cout << (!(cmp(*i0, *i1) || cmp(*i0, *i1))) << " ";
}
std::cout << std::endl;

// Comparing containers using std::set<>::operator== ...Oops!
std::cout << std::boolalpha << (s0 == s1) << std::endl;
}



Bug#469809: libxml++2.6-2: malloc/free disbalance(possible memory leakage)

2008-03-06 Thread Skuratovich Sergey Nikolaevich
Package: libxml++2.6-2
Version: 2.14.0-0.1
Severity: important


Valgrind tool reports about malloc/free disbalance (number of memalloc calls
larger than number of free calls).

example program source:

#include 
#include 

int main(int argc, char* argv[])
{
try
{
xmlpp::DomParser parser("example.xml");
}
catch(...)
{
std::cout << "Exception caught" << std::endl;
}

return 0;
}

valgrind output:

ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 8 from 1)
malloc/free: in use at exit: 966 bytes in 20 blocks.
malloc/free: 208 allocs, 188 frees, 49,646 bytes allocated.
For counts of detected errors, rerun with: -v
searching for pointers to 20 not-freed blocks.
checked 322,904 bytes.

62 bytes in 8 blocks are still reachable in loss record 1 of 5
   at 0x4A1B858: malloc (vg_replace_malloc.c:149)
   by 0x579982E: xmlStrndup (xmlstring.c:45)
   by 0x572A628: xmlNewCharEncodingHandler (encoding.c:1286)
   by 0x572A734: xmlInitCharEncodingHandlers (encoding.c:1351)
   by 0x5731A99: xmlInitParser (parser.c:12848)
   by 0x4CCBFC2: xmlpp::Document::Init::Init() (in 
/usr/lib/libxml++-2.6.so.2.0.7)
   by 0x4CD5945: (within /usr/lib/libxml++-2.6.so.2.0.7)
   by 0x4CCA0CA: (within /usr/lib/libxml++-2.6.so.2.0.7)


80 bytes in 2 blocks are still reachable in loss record 2 of 5
   at 0x4A1B858: malloc (vg_replace_malloc.c:149)
   by 0x5796ADC: xmlNewMutex (threads.c:180)
   by 0x5796628: xmlInitGlobals (globals.c:49)
   by 0x5731A85: xmlInitParser (parser.c:12845)
   by 0x4CCBFC2: xmlpp::Document::Init::Init() (in 
/usr/lib/libxml++-2.6.so.2.0.7)
   by 0x4CD5945: (within /usr/lib/libxml++-2.6.so.2.0.7)
   by 0x4CCA0CA: (within /usr/lib/libxml++-2.6.so.2.0.7)


104 bytes in 1 blocks are still reachable in loss record 3 of 5
   at 0x4A1B858: malloc (vg_replace_malloc.c:149)
   by 0x5796A8C: xmlNewRMutex (threads.c:287)
   by 0x57E4914: xmlInitializeDict (dict.c:95)
   by 0x57E4B31: xmlDictCreate (dict.c:327)
   by 0x572E2BB: xmlInitParserCtxt (parserInternals.c:1517)
   by 0x572E32D: xmlNewParserCtxt (parserInternals.c:1768)
   by 0x573046C: xmlCreateURLParserCtxt (parser.c:12220)
   by 0x4CCF440: xmlpp::DomParser::parse_file(Glib::ustring const&) (in 
/usr/lib/libxml++-2.6.so.2.0.7)
   by 0x4CCF67C: xmlpp::DomParser::DomParser(Glib::ustring const&, bool) (in 
/usr/lib/libxml++-2.6.so.2.0.7)
   by 0x400D43: main (in /home/skur/devel/sandbox/libxml_test/main)


320 bytes in 8 blocks are still reachable in loss record 4 of 5
   at 0x4A1B858: malloc (vg_replace_malloc.c:149)
   by 0x572A63E: xmlNewCharEncodingHandler (encoding.c:1295)
   by 0x572A734: xmlInitCharEncodingHandlers (encoding.c:1351)
   by 0x5731A99: xmlInitParser (parser.c:12848)
   by 0x4CCBFC2: xmlpp::Document::Init::Init() (in 
/usr/lib/libxml++-2.6.so.2.0.7)
   by 0x4CD5945: (within /usr/lib/libxml++-2.6.so.2.0.7)
   by 0x4CCA0CA: (within /usr/lib/libxml++-2.6.so.2.0.7)


400 bytes in 1 blocks are still reachable in loss record 5 of 5
   at 0x4A1B858: malloc (vg_replace_malloc.c:149)
   by 0x572A6EA: xmlInitCharEncodingHandlers (encoding.c:1337)
   by 0x5731A99: xmlInitParser (parser.c:12848)
   by 0x4CCBFC2: xmlpp::Document::Init::Init() (in 
/usr/lib/libxml++-2.6.so.2.0.7)
   by 0x4CD5945: (within /usr/lib/libxml++-2.6.so.2.0.7)
   by 0x4CCA0CA: (within /usr/lib/libxml++-2.6.so.2.0.7)

LEAK SUMMARY:
   definitely lost: 0 bytes in 0 blocks.
 possibly lost: 0 bytes in 0 blocks.
   still reachable: 966 bytes in 20 blocks.
suppressed: 0 bytes in 0 blocks.

This situation occurs in both cases, whether example.xml exists of not.


-- System Information:
Debian Release: 4.0
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.18-4-686
Locale: LANG=ru_RU.UTF-8, LC_CTYPE=ru_RU.UTF-8 (charmap=UTF-8)

Versions of packages libxml++2.6-2 depends on:
ii  libc6  2.3.6.ds1-13etch4 GNU C Library: Shared libraries
ii  libgcc11:4.1.1-21GCC support library
ii  libglib2.0-0   2.12.4-2  The GLib library of C routines
ii  libglibmm-2.4-1c2a 2.12.0-1  C++ wrapper for the GLib toolkit (
ii  libsigc++-2.0-0c2a 2.0.17-2  type-safe Signal Framework for C++
ii  libstdc++6 4.1.1-21  The GNU Standard C++ Library v3
ii  libxml22.6.27.dfsg-1 GNOME XML library

libxml++2.6-2 recommends no packages.

-- no debconf information



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Bug#553191: manpages-ru: Spelling mistake in ldd(1) manpage: "старными" must be fixed to "старыми".

2009-10-29 Thread Skuratovich Sergey Nikolaevich
Package: manpages-ru
Version: 0.98-4
Severity: minor
Tags: l10n


Spelling mistake in ldd(1) manpage: "старными" must be fixed to "старыми".

$ gunzip -c /usr/share/man/ru/man1/ldd.1.gz |iconv -f koi8r|grep -n старными
64:не работает с некоторыми очень старными a.out программами, которые были

-- System Information:
Debian Release: 5.0.3
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: i386 (i686)

Kernel: Linux 2.6.26-2-686 (SMP w/2 CPU cores)
Locale: LANG=ru_RU.UTF-8, LC_CTYPE=ru_RU.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

manpages-ru depends on no packages.

manpages-ru recommends no packages.

Versions of packages manpages-ru suggests:
ii  konqueror [man-browser] 4:3.5.9.dfsg.1-6 KDE's advanced file manager, web b
ii  man-db [man-browser]2.5.2-4  on-line manual pager

-- no debconf information



--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org