> The lines following that give the backtrace for the sendmsg() call; and
> the message "Address 0xad39096 is 86 bytes inside a block of size 32,444
> alloc'd ..." tells you details about the above error:
> - where the uninitialized memory was originally allocated (the lines
> following the "Address 0xad39096 is 86 bytes inside..." line should give
> the exact backtrace to the malloc() call)
> - which byte in the memory is uninitialized; in this case it's the 86th
> byte.

I think I understand what happens now, I'm using std::vector for
storing bytes to be sent over the socket and I guess at some moment
std::vector automatically reserves more memory for future needs:

==31513==  Address 0xad39096 is 86 bytes inside a block of size 32,444 alloc'd
==31513==    at 0x40279EE: operator new(unsigned int) (vg_replace_malloc.c:224)
==31513==    by 0x4C72C7C: __gnu_cxx::new_allocator<unsigned
char>::allocate(unsigned int, void const*) (new_allocator.h:92)
==31513==    by 0x4C72CB7: std::__norm::_Vector_base<unsigned char,
std::allocator<unsigned char> >::_M_allocate(unsigned int)
(stl_vector.h:144)
==31513==    by 0x59B7775: std::__norm::vector<unsigned char,
std::allocator<unsigned char>
>::_M_fill_insert(__gnu_cxx::__normal_iterator<unsigned char*,
std::__norm::vector<unsigned char, std::allocator<unsigned char> > >,
unsigned int, unsigned char const&) (vector.tcc:395)
==31513==    by 0x59B7943: std::__norm::vector<unsigned char,
std::allocator<unsigned char>
>::insert(__gnu_cxx::__normal_iterator<unsigned char*,
std::__norm::vector<unsigned char, std::allocator<unsigned char> > >,
unsigned int, unsigned char const&) (stl_vector.h:792)
==31513==    by 0x59B79D6: std::__norm::vector<unsigned char,
std::allocator<unsigned char> >::resize(unsigned int, unsigned char)
(stl_vector.h:509)
==31513==    by 0x59B7AA3: std::__debug::vector<unsigned char,
std::allocator<unsigned char> >::resize(unsigned int, unsigned char)
(vector:214)
==31513==    by 0x59B56DE: ByteBuffer::append(unsigned char const*,
unsigned int) (ByteBuffer.cpp:264)

Thank you all again for being so much helpful

-- 
Best regards, Pavel

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Valgrind-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/valgrind-users

Reply via email to