Article View: comp.sys.sgi.misc
Article #64Re: Gethostbyname Error
From: Dave Olson
Date: Wed, 23 Dec 1992 04:48
Date: Wed, 23 Dec 1992 04:48
37 lines
2059 bytes
2059 bytes
In <1992Dec21.181140.21504@news2.cis.umn.edu> coyle@mars.cs.umn.edu (Mark Stephan Coyle) writes:
| *****Well I am glad I fit in with what Dave expects from a programmer (-:)
|
|
|
| Thanks for the response. As I said, the code works fine on other machines,
| including Sparcs, Suns, and another SGI. But on this machine, I get the following:
|
|
| dbx a.out
| dbx version 2.10 11/15/91 2:02
| Type 'help' for help.
| Reading symbolic information of `a.out' . . .
| main:29 29 sock=socket(AF_INET,SOCK_DGRAM,0);
| (dbx) run 2001
| Interrupt
| (dbx) run 2001
| Process 14353 (a.out) started
| Process 14353 (a.out) Segmentation fault [main:42 +0x8,0x4002d8]
| 42 bcopy(hp->h_addr, &(server.sin_addr.s_addr),hp->h_length);
| (dbx) where
| > 0 main(argc = 2, argv = 0x7fffc784) ["/usr/people/coyle/devel/flight/Sockets/i_net_send.c":42, 0x4002d8]
|
|
| Interstingly, and possibly connected, is what I get when I try to print
| out some simple tracing commands using printf. Note that I segment fault
| if I do the gethostbyname call, and then use printf, even if I exit immediately after the printf call:
Your test program works fine for me, -O, and -g, on 3 different
machines, with 3 different OS's and development releases...
That is whether the gethostbyname succeeds or fails (I tried
both).
--
Let no one tell me that silence gives consent, | Dave Olson
because whoever is silent dissents. | Silicon Graphics, Inc.
Maria Isabel Barreno | olson@sgi.com
Technical Details
Message-ID:
<tumomuk@zuni.esd.sgi.com>Path:
arc1-ca.pugleaf.net!sparky!uunet!cs.utexas.edu!sun-barr!ames!sgi!twilight!zuni!anchor!olsonReferences:
<1992Dec21.033141.15406@news2.cis.umn.edu> <ts526sg@zuni.esd.sgi.com> <1992Dec21.181140.21504@news2.cis.umn.edu>Show Full Headers
Complete Article Headers
Newsgroups: comp.sys.sgi.misc Path: arc1-ca.pugleaf.net!sparky!uunet!cs.utexas.edu!sun-barr!ames!sgi!twilight!zuni!anchor!olson From: olson@anchor.esd.sgi.com (Dave Olson) Subject: Re: Gethostbyname Error Message-ID: <tumomuk@zuni.esd.sgi.com> Sender: news@zuni.esd.sgi.com (Net News) Organization: Silicon Graphics, Inc. Mountain View, CA References: <1992Dec21.033141.15406@news2.cis.umn.edu> <ts526sg@zuni.esd.sgi.com> <1992Dec21.181140.21504@news2.cis.umn.edu> Date: Wed, 23 Dec 92 04:48:45 GMT Lines: 37