LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 02-13-2006, 03:37 AM   #1
yashwantpinge
LQ Newbie
 
Registered: Nov 2005
Posts: 17

Rep: Reputation: 0
valgrind with C++


hi,


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...?

yashwant
 
Old 02-15-2006, 03:49 PM   #2
XavierP
Moderator
 
Registered: Nov 2002
Location: Kent, England
Distribution: Debian Testing
Posts: 19,192
Blog Entries: 4

Rep: Reputation: 475Reputation: 475Reputation: 475Reputation: 475Reputation: 475
Moved: This thread is more suitable in Programming and has been moved accordingly to help your thread/question get the exposure it deserves.
 
Old 02-16-2006, 03:56 PM   #3
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,696

Rep: Reputation: 232Reputation: 232Reputation: 232
I'd look at 'host' variable. Is it initialized?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Valgrind - an answer. cyent Programming 6 02-11-2010 01:49 PM
Valgrind not included? Zeno McDohl Slackware 1 02-05-2006 03:13 PM
Valgrind and Shared Memory nodger Programming 0 04-27-2005 07:29 AM
Valgrind 2.2.0 works sridurai Linux - General 0 02-18-2005 05:51 AM
valgrind terminates unexpectedly appas Linux - General 0 02-18-2005 02:30 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:28 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration