473,400 Members | 2,145 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,400 software developers and data experts.

Trouble with getbyhostname()


Hi,
I am having trouble with getbyhostname().I works sometimes but on
other occasions it crashes.
IPADDRESS is a string say "192.123.12.1"

(gdb)
Client::SendSocket (this=0xbfa9493c, QuerBuf=@0xbfa948c4,
IPADDRESS=@0xbfa948d4) at Client.cc:141
141 h = gethostbyname(IPADDRESS.c_str());
(gdb)
*** glibc detected *** /home/workspace/DNSResolver1/checkstring:
free(): invalid next size (normal): 0x0804eb38 ***
======= Backtrace: =========
/lib/tls/i686/cmov/libc.so.6[0xb7db1d65]
/lib/tls/i686/cmov/libc.so.6(cfree+0x90)[0xb7db5800]
/lib/tls/i686/cmov/libc.so.6(fclose+0x134)[0xb7da06f4]
/lib/tls/i686/cmov/libc.so.6[0xb7e2a73d]
/lib/tls/i686/cmov/libc.so.6(__res_ninit+0x25)[0xb7e2ae65]
/lib/tls/i686/cmov/libc.so.6(__res_maybe_init+0x7b)[0xb7e2c30b]
/lib/tls/i686/cmov/libc.so.6(__nss_hostname_digits_dots+0x2d)
[0xb7e2dcdd]
/lib/tls/i686/cmov/libc.so.6(gethostbyname+0x9a)[0xb7e3227a]
Mar 26 '08 #1
5 2281
Hi, i think this a wrong group to post the kind of problem that u r
looking to solve. You have to find some newsgroup where sockets
related stuff is discussed.

Regards,
..ab

On Mar 26, 5:18*pm, sam.bark...@gmail.com wrote:
Hi,
I am having trouble with getbyhostname().I works sometimes but on
other occasions it crashes.
IPADDRESS is a string say "192.123.12.1"

(gdb)
*Client::SendSocket (this=0xbfa9493c, QuerBuf=@0xbfa948c4,
* * IPADDRESS=@0xbfa948d4) at Client.cc:141
141 * * * * * * h = gethostbyname(IPADDRESS.c_str());
(gdb)
*** glibc detected *** /home/workspace/DNSResolver1/checkstring:
free(): invalid next size (normal): 0x0804eb38 ***
======= Backtrace: =========
/lib/tls/i686/cmov/libc.so.6[0xb7db1d65]
/lib/tls/i686/cmov/libc.so.6(cfree+0x90)[0xb7db5800]
/lib/tls/i686/cmov/libc.so.6(fclose+0x134)[0xb7da06f4]
/lib/tls/i686/cmov/libc.so.6[0xb7e2a73d]
/lib/tls/i686/cmov/libc.so.6(__res_ninit+0x25)[0xb7e2ae65]
/lib/tls/i686/cmov/libc.so.6(__res_maybe_init+0x7b)[0xb7e2c30b]
/lib/tls/i686/cmov/libc.so.6(__nss_hostname_digits_dots+0x2d)
[0xb7e2dcdd]
/lib/tls/i686/cmov/libc.so.6(gethostbyname+0x9a)[0xb7e3227a]
Mar 26 '08 #2
I was thinking that it might not be a networking related issue but a
memory related issue.I cannot seem to put my figure on it
After the error.The was a memory map.
====== Memory map: ========
08048000-0804c000 r-xp 00000000 08:06 1619927 /home/workspace/
backup/DNSResolver1/checkstring
0804c000-0804d000 rw-p 00003000 08:06 1619927 /home/workspace/
backup/DNSResolver1/checkstring
0804d000-0806e000 rw-p 0804d000 00:00 0 [heap]
b7b00000-b7b21000 rw-p b7b00000 00:00 0
b7b21000-b7c00000 ---p b7b21000 00:00 0
b7cbf000-b7cc0000 rw-p b7cbf000 00:00 0
b7cc0000-b7e04000 r-xp 00000000 08:06 2095711 /lib/tls/i686/cmov/
libc-2.6.1.so
b7e04000-b7e05000 r--p 00143000 08:06 2095711 /lib/tls/i686/cmov/
libc-2.6.1.so
b7e05000-b7e07000 rw-p 00144000 08:06 2095711 /lib/tls/i686/cmov/
libc-2.6.1.so
b7e07000-b7e0a000 rw-p b7e07000 00:00 0
b7e0a000-b7e14000 r-xp 00000000 08:06 2060358 /lib/libgcc_s.so.1
b7e14000-b7e15000 rw-p 0000a000 08:06 2060358 /lib/libgcc_s.so.1
b7e15000-b7e16000 rw-p b7e15000 00:00 0
b7e16000-b7e39000 r-xp 00000000 08:06 2095715 /lib/tls/i686/cmov/
libm-2.6.1.so
b7e39000-b7e3b000 rw-p 00023000 08:06 2095715 /lib/tls/i686/cmov/
libm-2.6.1.so
b7e3b000-b7f23000 r-xp 00000000 08:06 1128811 /usr/lib/libstdc++.so.
6.0.9
b7f23000-b7f26000 r--p 000e8000 08:06 1128811 /usr/lib/libstdc++.so.
6.0.9
b7f26000-b7f28000 rw-p 000eb000 08:06 1128811 /usr/lib/libstdc++.so.
6.0.9
b7f28000-b7f2e000 rw-p b7f28000 00:00 0
b7f3d000-b7f3f000 rw-p b7f3d000 00:00 0
b7f3f000-b7f59000 r-xp 00000000 08:06 2060373 /lib/ld-2.6.1.so
b7f59000-b7f5b000 rw-p 00019000 08:06 2060373 /lib/ld-2.6.1.so
bf985000-bf99b000 rw-p bf985000 00:00 0 [stack]
ffffe000-fffff000 r-xp 00000000 00:00 0 [vdso]

Mar 26 '08 #3
On Mar 26, 9:29*am, sam.bark...@gmail.com wrote:
I was thinking that it might not be a networking related issue but a
memory related issue.I cannot seem to put my figure on it
Post the smallest piece of code that compiles and exhibits the problem
and we might be able to help. Memory-related problems occur for a
variety of reasons.

Mar 26 '08 #4
sa*********@gmail.com wrote:
I was thinking that it might not be a networking related issue but a
memory related issue.I cannot seem to put my figure on it
After the error.The was a memory map.
"Put my finger on it". And see FAQ 5.8.

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
Mar 26 '08 #5
Solved.There was a buffer overflow in a function call.
Mar 27 '08 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: James | last post by:
Hi I am having some trouble getting a asp page to load. Im a noob to the asp side. I have followed knowledege base Article 301305. I am running 2000 adv, IIS 5.0 I have the following...
4
by: Jacek Dziedzic | last post by:
Hi! First of all, I hope my problem is not too loosely tied to the "standard C++" that is the topic of this group. I have some code that exhibits a strange behaviour: on one computer, where I...
0
by: Paul C | last post by:
Hello, everybody. I am having trouble running some of the VS.NET samples, specifically the CarSelector web app, which is very simple. The symptom is that the web controls (drop down listboxes and...
0
by: Alexandre Jaquet | last post by:
Hi does anybody know how to solve my trouble, when I try to create a MS Office project I always got trouble. I can't create office project when I try to create one vs.net restart ... :s
1
by: Jim Bancroft | last post by:
Hi everyone, I'm running into a problem with my ASP.Net application. I've just created a new aspx page which uses some new components of mine that inherit from ServicedComponent and are...
6
by: Daniel Walzenbach | last post by:
Hi, I have a web application which sometimes throws an “out of memory” exception. To get an idea what happens I traced some values using performance monitor and got the following values (for...
3
by: Olivier BESSON | last post by:
Hello, I have a web service of my own on a server (vb.net). I must declare it with SoapRpcMethod to be used with JAVA. This is a simple exemple method of my vb source : ...
2
by: JLupear | last post by:
I am having trouble with my code again, I had prepared a question and the code to upload, however I am having trouble posting it, are there limits to the amount of lines you can post? I split it...
0
by: mrchatgroup | last post by:
news from http://www.mrchat.net/myblog/myblog/small-accidents-mean-big-trouble-for-supercollider.html Small Accidents Mean Big Trouble for Supercollider Image Scientists expect startup...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.