|
From: Tom Hu <to...@ci...> - 2004-08-24 20:41:06
|
Hi, It looks like there are two warning here, First one is syscall param socketcall.sendto. I initialized "msg" parameter with memset zero in xxx_data_to_packet [please see the second section] and it still post the warning. Can anyone help why? Second warning is "Address 0x3C32A478 is 40 bytes inside a block of size 520 alloc'd" "Can anyone tell me what does it imply? Are the second one is related to the frist one or not? If yes, please let me know what it is. ==11466== Syscall param socketcall.sendto(msg) contains uninitialised or unaddressable byte(s) ==11466== at 0x3C206C5C: sendto (in /lib/tls/libc-2.3.2.so) ==11466== by 0x806864B: xxx_send_packet (xxx_action.c:57) ==11466== by 0x80699DE: action_send_r_auth_msg (xxx_action.c:732) ==11466== by 0x806C452: xxx_sm_internal (xxx_sm.c:265) ==11466== by 0x806C776: xxx_sm (xxx_sm.c:344) ==11466== by 0x805F8D1: xxx_parser (xxx_parser.c:1471) ==11466== Address 0x3C32A478 is 40 bytes inside a block of size 520 alloc'd ==11466== at 0x3C01E268: malloc (vg_replace_malloc.c:105) ==11466== by 0x8049B05: xxx_malloc (xxx_linux.c:86) ==11466== by 0x8056671: xxx_data_to_packet (xxx_packet_context.c:51) ==11466== by 0x806EE38: construct_notify (xxx_construct.c:845) ==11466== by 0x806FD90: construct_init_message_continue (xxx_construct.c:1420) Thank in advance Note: I have problem to reply the mail when I received the reply from someone in gmane.comp.debugging.valgrind newsgroup. I am appreciated if someone help me how to do it. Tom Hu |
|
From: Tom H. <th...@cy...> - 2004-08-24 21:34:55
|
In message <412...@ci...>
Tom Hu <to...@ci...> wrote:
> It looks like there are two warning here,
Only one in the output you sent.
> First one is syscall param socketcall.sendto. I initialized "msg"
> parameter with memset zero in xxx_data_to_packet [please see the second
> section] and it still post the warning. Can anyone help why?
Second section of what?
> Second warning is "Address 0x3C32A478 is 40 bytes inside a block of
> size 520 alloc'd" "Can anyone tell me what does it imply?
That's not a second warning, it's part of the detail about the
first warning. The first trace tells you where the uninitialised
memory was used and the second tells you where it was allocated
and exactly which byte was uninitialised.
> ==11466== Syscall param socketcall.sendto(msg) contains uninitialised or
> unaddressable byte(s)
> ==11466== at 0x3C206C5C: sendto (in /lib/tls/libc-2.3.2.so)
> ==11466== by 0x806864B: xxx_send_packet (xxx_action.c:57)
> ==11466== by 0x80699DE: action_send_r_auth_msg (xxx_action.c:732)
> ==11466== by 0x806C452: xxx_sm_internal (xxx_sm.c:265)
> ==11466== by 0x806C776: xxx_sm (xxx_sm.c:344)
> ==11466== by 0x805F8D1: xxx_parser (xxx_parser.c:1471)
So at line 57 of xxx_action.c you called sendto() with a buffer
that included uninitialised data...
> ==11466== Address 0x3C32A478 is 40 bytes inside a block of size 520 alloc'd
> ==11466== at 0x3C01E268: malloc (vg_replace_malloc.c:105)
> ==11466== by 0x8049B05: xxx_malloc (xxx_linux.c:86)
> ==11466== by 0x8056671: xxx_data_to_packet (xxx_packet_context.c:51)
> ==11466== by 0x806EE38: construct_notify (xxx_construct.c:845)
> ==11466== by 0x806FD90: construct_init_message_continue
> (xxx_construct.c:1420)
...and the buffer in question is part or all of the block of
memory allocated at line 51 of xxx_packet_context.c, with the
first uninitialised byte being 40 bytes inside the buffer.
Tom
--
Tom Hughes (th...@cy...)
Software Engineer, Cyberscience Corporation
http://www.cyberscience.com/
|
|
From: Eric E. <eri...@fr...> - 2004-08-24 21:37:43
|
In fact there is only one warning. What you see is 2 stacks: - the one where the error occured (when calling someto) - the one where the memory block involved in the error was allocated Either Valgrind is broken (could you give the version you are using ?), or your code is doing wrong, e.g. : - classic memset( p, 0, sizeof(p) ) instead of sizeof( *p ) - or you passed a wrong len or buf argument to sendto Cheers -- Eric Tom Hu wrote: > Hi, > > It looks like there are two warning here, > First one is syscall param socketcall.sendto. I initialized "msg" > parameter with memset zero in xxx_data_to_packet [please see the second > section] and it still post the warning. Can anyone help why? |