|
From: ashutosh n. <ash...@ya...> - 2005-09-29 16:09:32
|
> Hi, > > I have pasted a piece of valgrind dump. > It says that sendto points to uninitialized bytes > whereas from the trace itself you can see that i have > allocated memory with calloc. > > Could you help in deciphering... > > Thanks, > > Ashutosh > > > > > > > > > > > ==2005-09-29 17:50:42.077 3243== > ==2005-09-29 17:50:42.077 3243== 22 errors in context > 26 of 35: > ==2005-09-29 17:50:42.077 3243== Syscall param > socketcall.sendto(msg) points to uninitialised byte(s) > ==2005-09-29 17:50:42.077 3243== at 0x1BB2D328: > sendto (in > /opt/Nevis/gcc-v3.2.2/lib/libpthread-0.10.so) > ==2005-09-29 17:50:42.077 3243== by 0x1B91A785: > cpSendIpcAsyncMsg (src/ipc.c:1455) > ==2005-09-29 17:50:42.077 3243== by 0x807A1C1: > cpL2secMACLogout (src/cp_l2sec_thread.c:7269) > ==2005-09-29 17:50:42.077 3243== by 0x80791EB: > cpL2secRemoveLoggedInMACPh3 > (src/cp_l2sec_thread.c:7201) > ==2005-09-29 17:50:42.077 3243== by 0x807E005: > cpL2secRemovePrimaryMac (src/cp_l2sec_thread.c:8121) > ==2005-09-29 17:50:42.077 3243== by 0x807C57E: > cpL2secFlushAllMacs (src/cp_l2sec_thread.c:7926) > ==2005-09-29 17:50:42.078 3243== by 0x807388C: > cpL2secRemoveLoggedInMACPh2 > (src/cp_l2sec_thread.c:6572) > ==2005-09-29 17:50:42.078 3243== by 0x8073025: > cpL2secRemoveLoggedInMAC (src/cp_l2sec_thread.c:6483) > ==2005-09-29 17:50:42.078 3243== by 0x807FED4: > cpL2secProcessAAAReply (src/cp_l2sec_thread.c:8355) > ==2005-09-29 17:50:42.078 3243== by 0x804D33B: > cpL2secMsgHandler (src/cp_l2sec_thread.c:205) > ==2005-09-29 17:50:42.078 3243== by 0x1BB737DF: > do_work (src/threadpool.c:200) > ==2005-09-29 17:50:42.078 3243== by 0x1BB26D02: > pthread_start_thread (manager.c:300) > ==2005-09-29 17:50:42.078 3243== by 0x1BC63BE6: > clone (in /opt/Nevis/gcc-v3.2.2/lib/libc-2.3.2.so) > ==2005-09-29 17:50:42.078 3243== Address 0x1BD9D6E3 > is 27 bytes inside a block of size 274 alloc'd > ==2005-09-29 17:50:42.078 3243== at 0x1B8FFD0D: > calloc (vg_replace_malloc.c:279) > ==2005-09-29 17:50:42.078 3243== by 0x1B92ABDA: > cpCalloc > (/newbuild/sachinshukla/mainbranch/software/control_plane/common/src/cp_mem >_mgmt.c:211) ==2005-09-29 17:50:42.078 3243== by 0x1B919179: > cpPackAndSendIpc (src/ipc.c:597) > ==2005-09-29 17:50:42.078 3243== by 0x1B91A785: > cpSendIpcAsyncMsg (src/ipc.c:1455) > ==2005-09-29 17:50:42.078 3243== by 0x807A1C1: > cpL2secMACLogout (src/cp_l2sec_thread.c:7269) > ==2005-09-29 17:50:42.078 3243== by 0x80791EB: > cpL2secRemoveLoggedInMACPh3 > (src/cp_l2sec_thread.c:7201) > ==2005-09-29 17:50:42.078 3243== by 0x807E005: > cpL2secRemovePrimaryMac (src/cp_l2sec_thread.c:8121) > ==2005-09-29 17:50:42.078 3243== by 0x807C57E: > cpL2secFlushAllMacs (src/cp_l2sec_thread.c:7926) > ==2005-09-29 17:50:42.078 3243== by 0x807388C: > cpL2secRemoveLoggedInMACPh2 > (src/cp_l2sec_thread.c:6572) > ==2005-09-29 17:50:42.078 3243== by 0x8073025: > cpL2secRemoveLoggedInMAC (src/cp_l2sec_thread.c:6483) > ==2005-09-29 17:50:42.079 3243== by 0x807FED4: > cpL2secProcessAAAReply (src/cp_l2sec_thread.c:8355) > ==2005-09-29 17:50:42.079 3243== by 0x804D33B: > cpL2secMsgHandler (src/cp_l2sec_thread.c:205) > ==2005-09-29 17:50:42.079 3243== by 0x1BB737DF: > do_work (src/threadpool.c:200) > ==2005-09-29 17:50:42.079 3243== by 0x1BB26D02: > pthread_start_thread (manager.c:300) > ==2005-09-29 17:50:42.079 3243== by 0x1BC63BE6: > clone (in /opt/Nevis/gcc-v3.2.2/lib/libc-2.3.2.so) > ==2005-09-29 17:50:42.079 3243== __________________________________ Yahoo! Mail - PC Magazine Editors' Choice 2005 http://mail.yahoo.com |
|
From: Paul P. <ppl...@gm...> - 2005-09-30 02:02:11
|
On 9/29/05, ashutosh nasikkar <ash...@ya...> wrote:
> It says that sendto points to uninitialized bytes
> whereas from the trace itself you can see that i have
> allocated memory with calloc.
You believe that this to be a contradiction, but it isn't. Consider:
#include <stdlib.h>
int main()
{
int *ip =3D calloc(1, sizeof(int));
int q;
*ip =3D q; // *ip now uninitialized
write(1, ip, sizeof(int));
return 0;
}
Cheers,
|