Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: [ace-bugs] Valgrind indicates uninitialised bytes by using ACE_OutputCDR::from_boolean

47 views
Skip to first unread message

Johnny Willemsen

unread,
Feb 9, 2011, 12:47:14 PM2/9/11
to Alexej Lotz, ace-...@list.isis.vanderbilt.edu
Hi,

First I would recommend you to upgrade to 6.0.1, also add valgrind=1 to
your platform_macros.GNU file when you want to test with valgrind. This
enabled a define that will initialise some buffers explicitly with zero
to get rid of this warning. It is not a real problem, but that way you
should get a clean valgrind output

Johnny

On 02/08/2011 05:18 PM, Alexej Lotz wrote:
> ACE VERSION: 6.0.0
>
> HOST MACHINE and OPERATING SYSTEM:
> Ubunutu Linux with Kernel 2.6.35-24-generic i686
>
> TARGET MACHINE and OPERATING SYSTEM: same
>
> COMPILER NAME AND VERSION (AND PATCHLEVEL):
> gcc (Ubuntu/Linaro 4.4.4-14ubuntu5) 4.4.5
>
> THE $ACE_ROOT/ace/config.h FILE
> config-linux.h
>
> THE $ACE_ROOT/include/makeinclude/platform_macros.GNU FILE
>
> platform-linux.GNU
>
> BUILD METHOD USED:
> ./bin/mwc.pl <http://mwc.pl> -type gnuace ACE.mwc
>
> CONTENTS OF $ACE_ROOT/bin/MakeProjectCreator/config/default.features
> gnuace.features
>
> ssl=1
> qt=1
> fl=1
> tk=1
> xt=1
> sctp=1
> ndds=1
>
> EXAMPLE AFFECTED:
> examples/Logger/client
>
> CLASS AFFECTED:
> ACE_OutputCDR
>
> INSTRUCTION AFFECTED:
>
> ACE_OutputCDR::from_boolean(ACE_CDR_BYTE_ORDER)
>
>
> DOES THE PROBLEM AFFECT:
> EXECUTION:
> COMMAND: valgrind --track-origins=yes ./logging_app
>
>
> SYNOPSIS:
> Valgrind tool detects uninitialised bytes if a boolean is written into an OutputCDR stream.
>
>
> DESCRIPTION:
> Valgrind prints the following error summary:
>
> ==2329== Memcheck, a memory error detector
> ==2329== Copyright (C) 2002-2010, and GNU GPL'd, by Julian Seward et al.
> ==2329== Using Valgrind-3.6.0.SVN-Debian and LibVEX; rerun with -h for copyright info
>
> ==2329== Command: ./logging_app
> ==2329==
> ==2329== Syscall param writev(vector[...]) points to uninitialised byte(s)
> ==2329== at 0x43D13C1: writev (writev.c:51)
> ==2329== by 0x40B7B8B: ACE::sendv_n_i(int, iovec const*, int, unsigned int*) (OS_NS_sys_uio.inl:48)
>
> ==2329== by 0x8049145: main (ACE.inl:211)
> ==2329== Address 0x44801e9 is 1 bytes inside a block of size 24 alloc'd
> ==2329== at 0x40259C6: operator new[](unsigned int, std::nothrow_t const&) (vg_replace_malloc.c:319)
>
> ==2329== by 0x40FB639: ACE_New_Allocator::malloc(unsigned int) (Malloc_Allocator.cpp:116)
> ==2329== by 0x40FFE2E: ACE_Data_Block::ACE_Data_Block(unsigned int, int, char const*, ACE_Allocator*, ACE_Lock*, unsigned long, ACE_Allocator*) (Message_Block.cpp:365)
>
> ==2329== by 0x41007FC: ACE_Message_Block::init_i(unsigned int, int, ACE_Message_Block*, char const*, ACE_Allocator*, ACE_Lock*, unsigned long, unsigned long, ACE_Time_Value const&, ACE_Time_Value const&, ACE_Data_Block*, ACE_Allocator*, ACE_Allocator*) (Message_Block.cpp:724)
>
> ==2329== by 0x4100E37: ACE_Message_Block::ACE_Message_Block(unsigned int, int, ACE_Message_Block*, char const*, ACE_Allocator*, ACE_Lock*, unsigned long, ACE_Time_Value const&, ACE_Time_Value const&, ACE_Allocator*, ACE_Allocator*) (Message_Block.cpp:450)
>
> ==2329== by 0x40CF312: ACE_OutputCDR::ACE_OutputCDR(unsigned int, int, ACE_Allocator*, ACE_Allocator*, ACE_Allocator*, unsigned int, unsigned char, unsigned char) (CDR_Stream.cpp:47)
> ==2329== by 0x80490A2: main (logging_app.cpp:62)
>
> ==2329== Uninitialised value was created by a heap allocation
> ==2329== at 0x40259C6: operator new[](unsigned int, std::nothrow_t const&) (vg_replace_malloc.c:319)
> ==2329== by 0x40FB639: ACE_New_Allocator::malloc(unsigned int) (Malloc_Allocator.cpp:116)
>
> ==2329== by 0x40FFE2E: ACE_Data_Block::ACE_Data_Block(unsigned int, int, char const*, ACE_Allocator*, ACE_Lock*, unsigned long, ACE_Allocator*) (Message_Block.cpp:365)
> ==2329== by 0x41007FC: ACE_Message_Block::init_i(unsigned int, int, ACE_Message_Block*, char const*, ACE_Allocator*, ACE_Lock*, unsigned long, unsigned long, ACE_Time_Value const&, ACE_Time_Value const&, ACE_Data_Block*, ACE_Allocator*, ACE_Allocator*) (Message_Block.cpp:724)
>
> ==2329== by 0x4100E37: ACE_Message_Block::ACE_Message_Block(unsigned int, int, ACE_Message_Block*, char const*, ACE_Allocator*, ACE_Lock*, unsigned long, ACE_Time_Value const&, ACE_Time_Value const&, ACE_Allocator*, ACE_Allocator*) (Message_Block.cpp:450)
>
> ==2329== by 0x40CF312: ACE_OutputCDR::ACE_OutputCDR(unsigned int, int, ACE_Allocator*, ACE_Allocator*, ACE_Allocator*, unsigned int, unsigned char, unsigned char) (CDR_Stream.cpp:47)
> ==2329== by 0x80490A2: main (logging_app.cpp:62)
>
> ==2329==
> ==2329==
> ==2329== HEAP SUMMARY:
> ==2329== in use at exit: 0 bytes in 0 blocks
> ==2329== total heap usage: 128 allocs, 128 frees, 169,804 bytes allocated
> ==2329==
> ==2329== All heap blocks were freed -- no leaks are possible
>
> ==2329==
> ==2329== For counts of detected and suppressed errors, rerun with: -v
> ==2329== ERROR SUMMARY: 10 errors from 1 contexts (suppressed: 27 from 8)
>
> REPEAT BY:
> 1) start logging daemon example: $ACE_ROOT/examples/Logger/simple-server/server_loggerd
>
> 2) start logging client with valgrind: valgrind --track-origins=yes ./logging_app
>
> SAMPLE FIX/WORKAROUND:
> Not known
>
> Is it a real bug at all? Or is it a problem of valgrind and one does not has to worry about it?
>
>
> Thanks,
> Alexej
>
>
>
> _______________________________________________
> ace-bugs mailing list
> ace-...@list.isis.vanderbilt.edu
> http://list.isis.vanderbilt.edu/mailman/listinfo/ace-bugs

Alexey

unread,
Feb 10, 2011, 8:27:46 AM2/10/11
to
Hi Johnny,

thank you for your help! You are right this is not a bug and this
solved my issue, although the valgrind flag is a bit tricky to find
without the knowledge of its existence ;-)

Alexey

> > ace-b...@list.isis.vanderbilt.edu
> >http://list.isis.vanderbilt.edu/mailman/listinfo/ace-bugs

0 new messages