July 16, 2019, 07:59:17 AM

News : LinuxSolved.com Linux Help Community Forum..

Author Topic: valgrind with C++  (Read 2605 times)

Offline yashwantpinge

  • New Member
  • Posts: 2
valgrind with C++
« on: February 13, 2006, 09:42:15 AM »

Anybody tell me .............

I am stucked in a one position.

I run my binary with valgrind....

valgrind shows the following logs.

==24238== Conditional jump or move depends on uninitialised value(s)
==24238== at 0x1B90A9BC: getanswer_r (in /lib/libnss_dns.so.2)
==24238== by 0x1B90B327: _nss_dns_gethostbyname3_r (in /lib/libnss_dns.so.2)
==24238== by 0x1B90B512: _nss_dns_gethostbyname2_r (in /lib/libnss_dns.so.2)
==24238== by 0x1B90B57B: _nss_dns_gethostbyname_r (in /lib/libnss_dns.so.2)
==24238== by 0x1BB39275: gethostbyname_r@@GLIBC_2.1.2 (in /lib/tls/libc.so.6)
==24238== by 0x8078C13: p_gethostbyname(char const*) (compat.c:30)
==24238== by 0x806308B: net_dns(char const*) (network.c:750)
==24238== by 0x8064499: net_connect(char const*, int, in_addr, int) (network.c:251)
==24238== by 0x807500C: protocol_start(CONNECTION_T*) (protocol.c:123)
==24238== by 0x806005C: handle_request(CONNECTION_T*) (main.c:1372)
==24238== by 0x8060472: process_entry(CONNECTION_T*) (main.c:743)
==24238== by 0x1B9287F2: start_thread (in /lib/tls/libpthread.so.0)

my code is :-----

int ret, err;
char buf[1024];
HOSTENT *hostent;
struct hostent h, *hp;

ret = gethostbyname_r(host, &h, buf, sizeof(buf), &hp, &err);//this is a 30th line in compact.c

any body tell me that what the valgrind says...?


Offline dragoncity99

  • LST CareTaker
  • Experienced
  • *****
  • Posts: 551
valgrind with C++
« Reply #1 on: May 07, 2006, 12:51:32 PM »
Obviously, it's saying u have not initialize a value to the variables u declared.