[M3devel] Juno (X) networking problem on AMD64_FREEBSD
Mika Nystrom
mika at async.caltech.edu
Mon Jan 12 10:37:42 CET 2009
netobjd has similar problems.
Hmm, yes, in both cases it is somehow related to listening on a port.
In your X case it also sounds wrong. It should just check hname[0]
against the DISPLAY env var. It doesn't need GetHostAddress.
Mika
Jay writes:
>--_b0c10337-0e1c-414e-aae5-e611dcd4be8a_
>Content-Type: text/plain; charset="iso-8859-1"
>Content-Transfer-Encoding: quoted-printable
>
>
>PPC_LINUX not PPC_DARWIN.
>I think.
>And at one point AMD64_LINUX (same machine as AMD64_FREEBSD=2C multiboot).I=
> think I tested I386_OPENBSD Juno too and it worked=2CI don't remember. Oh=
>=2C but that was in a VM=2C so different networking setup.
>This is Trestle startup=2C seeing if there mightbe shared memory available =
>between the X client and server.
>If $DISPLAY is set=2C to specify the server=2C it wants to comparethat agai=
>nst "current"=2C the client.You know=2C if I set DISPLAY=3D:0.0 or localhos=
>t:0.0=2C don't penalize perf=2Cbut if it really is remote=2C then do penali=
>ze perf.
>/Something/ like that.
>I hardly read the code..
> - Jay> To: jay.krell at cornell.edu> Date: Mon=2C 12 Jan 2009 01:06:30 -0800>=
> From: mika at async.caltech.edu> CC: m3devel at elegosoft.com> Subject: Re: [M3d=
>evel] Juno (X) networking problem on AMD64_FREEBSD> > Jay=2C> > I think the=
> problem here is actually in the caller. Why does a> caller need "GetHostAd=
>dr()"? It is probably doing this for the> purpose of calling listen() or so=
>me such thing. What the caller> probably *really* wants is INADDR_ANY=2C an=
>d not the IP address of> some arbitrarily chosen interface on the host.> > =
>I'm guessing it works on the Mac because the Mac libraries do> something co=
>mplicated when you ask for the host's name (i.e.=2C they> somehow generate =
>a hostname that always maps to the IP address of> an interface on the compu=
>ter).> > Mika> > Jay writes:> >--_b00371fe-730b-4981-9051-a874361296d7_> >C=
>ontent-Type: text/plain=3B charset=3D"iso-8859-1"> >Content-Transfer-Encodi=
>ng: quoted-printable> >> >> >Do you know the right way?> >=3D20> >PPC_LINUX=
> "just worked"=3D2C and I can check Solaris and Darwin.> >=3D20> >I don't w=
>ant to edit /etc/hosts -- I use DHCP.> >Though DHCP has been bothering me -=
>- only for some of my machines do names =3D> >resolve=3D2C so I end using I=
>P addresses=3D2C which change sometimes=3D2C and I l=3D> >oop over them run=
>ning ssh to all of them and "see what I get"=3D2C not ideal.> >=3D20> > - J=
>ay> To: jay.krell at cornell.edu> Date: Sun=3D2C 11 Jan 2009 08:02:18 -0800>=
>=3D> > From: mika at async.caltech.edu> CC: m3devel at elegosoft.com> Subject: Re=
>: [M3d=3D> >evel] Juno (X) networking problem on AMD64_FREEBSD> > This is a=
> screwy thin=3D> >g in Modula-3. A bug I would call it.> > I've noticed a l=
>ot of networking M=3D> >3 programs don't work right unless> the return valu=
>e of Unix's "hostname" m=3D> >aps to a real IP address via> gethostbyname. =
>I accomplish it in practice by=3D> > adding my hostname> to /etc/hosts.> > =
>This is obviously not the right way =3D> >to fix it... > > Mika> > Jay writ=
>es:> >--_9e67232c-a064-417d-879e-227a77e31=3D> >0f9_> >Content-Type: text/p=
>lain=3D3B charset=3D3D"iso-8859-1"> >Content-Transfe=3D> >r-Encoding: quote=
>d-printable> >> >> >Hi. Unix network programming question.=3D> >.> >AMD64_F=
>REEBSD:> >$DISPLAY is set to point back to Cygwin host.It works =3D> >for P=
>PC_LINUX.> >[jay at fbsdamd64a /cm3/bin]$ ./Juno> >****** runtime error:*=3D> =
>>** Exception "IPError.FatalError" not in RAISES li=3D3D> >st*** file "../s=
>rc/=3D> >common/IPError.m3"=3D3D2C line 27***> >Abort trap: 6 (core dumped)=
>[jay at fbsdam=3D> >d64a /cm3/bin]$> >IP.m3:> >=3D3D20> >PROCEDURE GetHostAddr=
>(): Address =3D3D3D V=3D> >AR hname: ARRAY [0..255] OF CHAR=3D3D3B =3D3D> >=
> BEGIN LOCK mu DO IF Unix.getho=3D> >stname(ADR(hname[0])=3D3D2C BYTESIZE(h=
>na=3D3D> >me)) # 0 THEN IPError.Die ()=3D3D=3D> >3B END=3D3D3B VAR h :=3D3D=
>3D Unetdb.g=3D3D> >ethostbyname(ADR(hname[0]))=3D3D3B BEG=3D> >IN IF h =3D3=
>D3D NIL THEN IPError.Die()=3D3D> >=3D3D3B END=3D3D3B RETURN GetAddress(=3D>=
> >h)=3D3D3B END=3D3D3B END=3D3D3B END GetHos=3D3D> >tAddr=3D3D3B> >PROCEDUR=
>E GetAddress=3D> > (ent: Unetdb.struct_hostent_star): Address =3D3D3D VAR u=
>a=3D3D> >: Uin.struct_=3D> >in_addr=3D3D3B BEGIN <* ASSERT ent.h_length <=
>=3D3D3D BYTESIZE(Addr=3D3D> >ess) *>=3D> > ua :=3D3D3D LOOPHOLE(ent.h_addr_=
>list=3D3D2C UNTRACED =3D3D> >REF UNTRACED REF Ui=3D> >n.struct_in_addr)^^=
>=3D3D3B RETURN LOOPHOLE(ua.s_addr=3D3D2C A=3D3D> >ddress)=3D3D3B=3D> > END =
>GetAddress=3D3D3B> >=3D3D20> >gethostbyname is failing.> >=3D3D20> >Analogo=
>u=3D> >s C code also fails:> >=3D3D20> >[jay at fbsdamd64a /cm3/bin]$ cat ~/5.=
>c#include=3D> > <assert.h>#include <netdb.h>#i=3D3D> >nclude <stdio.h>#incl=
>ude <errno.h>type=3D> >def struct hostent hostent_t=3D3D3B> >=3D3D20> >int =
>main(){ char hostname[200]=3D> >=3D3D3B hostent_t* h=3D3D3B int i=3D3D3B> >=
> i =3D3D3D gethostname(hostname=3D3D2C 200=3D> >)=3D3D3B assert(i =3D3D3D=
>=3D3D3D 0)=3D3D3B printf("hostna=3D3D> >me: %s\n"=3D3D2C hostn=3D> >ame)=3D=
>3D3B h =3D3D3D gethostbyname(hostname)=3D3D3B herror("foo")=3D3D3B=3D3D> > =
>pri=3D> >ntf("%p %d %d\n"=3D3D2C h=3D3D2C errno=3D3D2C h_errno)=3D3D3B asse=
>rt(h)=3D3D3B return=3D> > 0=3D3D3B}> >=3D3D20> >herror says "unknown host".=
>> >Stack is:> > at ../src/run=3D> >time/ex_frame/RTExFrame.m3:58#13 0x00000=
>00801a7f2b3 in RTH=3D3D> >ooks__Raise=3D> > (M3_AJWxb1_ex=3D3D3DError acces=
>sing memory address 0x8000ffffd278: =3D3D> >Bad=3D> > address.) at ../src/r=
>untime/common/RTHooks.m3:79#14 0x000000080169c8=3D3D> >=3D> >d3 in IPError_=
>_Die () at ../src/common/IPError.m3:27#15 0x0000000801698a3e =3D> >=3D3D> >=
>in IP__GetHostAddr (M3_BCxjPn__result=3D3D3DError accessing memory addr=3D>=
> >ess 0x80=3D3D> >00ffffd338: Bad address.) at ../src/POSIX/IP.m3:82#16 0x0=
>0000=3D> >008012133d0=3D3D> > in XSharedMem__SameHost (M3_AQuuui_trsl=3D3D3=
>DError accessi=3D> >ng memory address 0=3D3D> >x8000ffffd4d8: Bad address.)=
> at ../src/xvbt/XShare=3D> >dMem.m3:96#17 0x000000=3D3D> >0801212ab7 in XSh=
>aredMem__InitXClient (M3_AQuuu=3D> >i_v=3D3D3DError accessing memory=3D3D> =
>> address 0x8000ffffd648: Bad address.) =3D> >at ../src/xvbt/XSharedMem.m3:=
>29#1=3D3D> >8 0x0000000801211819 in XExtensions_=3D> >_InitXClient (M3_AQuu=
>ui_xclient=3D3D3DError=3D3D> > accessing memory address 0x=3D> >8000ffffd7f=
>8: Bad address.) at ../src/xvbt/X=3D3D> >Extensions.m3:14#19 0x000=3D> >000=
>08012467a4 in XClientF__Connect (M3_Bd56fi_inst=3D3D> >=3D3D3D0x1879b=3D3D2=
>C M=3D> >3_AQuuui_trsl=3D3D3D0x6) at ../src/xvbt/XClientF.m3:583---Typ=3D3D=
>> >e <return>=3D> > to continue=3D3D2C or q <return> to quit---(More stack =
>frames follow=3D3D> >..=3D> >.)(gdb)> >(* return TRUE if server and client =
>are on same host *)PROCEDURE =3D> >SameHost (=3D3D> >trsl: XClient.T): BOOL=
>EAN =3D3D3D VAR display :=3D3D3D DisplayH=3D> >=3D3D> >ost(trsl)=3D3D3B dis=
>playAddr: IP.Address=3D3D3B BEGIN IF display =3D3D3D NI=3D> >L THE=3D3D> >N=
> RETURN TRUE=3D3D3B END=3D3D3B> > TRY IF NOT IP.GetHostByName(displ=3D> >ay=
>=3D3D2C displayAddr) THEN RETURN FA=3D3D> >LSE=3D3D3B END=3D3D3B RETURN dis=
>playAd=3D> >dr =3D3D3D IP.GetHostAddr()=3D3D3B EXCEPT =3D3D> >| IP.Error =
>=3D3D3D> RETURN FALSE=3D> >=3D3D3B END=3D3D3B END SameHost=3D3D3B> >=3D3D20=
>> >Thoughts?> >=3D3D20> >Perhaps my n=3D> >etwork isn't setup well=3D3D2C l=
>ike I should add the local machine =3D3D> >to /=3D> >etc/hosts.I think this=
> can be made to fail gracefully though.It seems l=3D3D>=3D> > >ike it has n=
>othing to do with AMD64_FREEBSD=3D3D2C but could have to do wit=3D> >h Fr=
>=3D3D> >eeBSD.> >=3D3D20> >Seems like SocketPosix has nearly the exact same=
>=3D> > code but appearsmore forgi=3D3D> >ving.. IOError instead of Fatal?> =
>>=3D3D20> =3D> >>SocketPosix.m3:> >=3D3D20> >PROCEDURE GetHostAddr (): Addr=
>ess RAISES {OSErro=3D> >r.E} =3D3D3D VAR host : AR=3D3D> >RAY [0..255] OF C=
>HAR=3D3D3B info : Unetdb.struc=3D> >t_hostent_star=3D3D3B ua : U=3D3D> >in.=
>struct_in_addr=3D3D3B BEGIN IF Unix.gethos=3D> >tname (ADR (host[0])=3D3D2C=
> BYTESI=3D3D> >ZE (host)) # 0 THEN IOError (Unexpect=3D> >ed)=3D3D3B END=3D=
>3D3B> > info :=3D3D3D Unetdb.gethostbyname (ADR (host[0]))=3D3D3B =3D> >IF =
>info =3D3D3D NIL TH=3D3D> >EN IOError (Unexpected)=3D3D3B END=3D3D3B <* ASS=
>ERT i=3D> >nfo.h_length <=3D3D3D BYTESIZE =3D3D> >(Address) *>> > ua :=3D3D=
>3D LOOPHOLE(info.=3D> >h_addr_list=3D3D2C UNTRACED REF UNT=3D3D> >RACED REF=
> Uin.struct_in_addr)^^=3D3D3B=3D> > RETURN LOOPHOLE (ua.s_addr=3D3D2C Addre=
>ss=3D3D> >)=3D3D3B END GetHostAddr=3D3D3B> =3D> >>=3D3D20> >=3D3D20> >It is=
> again disappointing to see such code duplication.> >=3D> >=3D3D20> >=3D3D2=
>0> >I guess SameHost can duplicate the logic to predict the err=3D> >or sta=
>te and ret=3D3D> >urn false upon error?> >Duplicating the logic for a t=3D>=
> >hird time. :(> >=3D3D20> > - Jay=3D3D> >> >--_9e67232c-a064-417d-879e-227=
>a77e31=3D> >0f9_> >Content-Type: text/html=3D3B charset=3D3D"iso-8859-1"> >=
>Content-Transfer=3D> >-Encoding: quoted-printable> >> ><html>> ><head>> ><s=
>tyle>> >.hmmessage P> =3D> >>{> >margin:0px=3D3D3B> >padding:0px> >}> >body=
>.hmmessage> >{> >font-size: 10=3D> >pt=3D3D3B> >font-family:Verdana> >}> ><=
>/style>> ></head>> ><body class=3D3D3D'h=3D> >mmessage'>> >Hi. Unix network=
> programming question..<BR>> ><BR>AMD64_FREEBS=3D> >D:<BR>> ><BR>$DISPLAY i=
>s set to point back to Cygwin host.<BR>It works for =3D> >PPC_LINUX=3D3D> >=
>.<BR>> ><BR>[jay at fbsdamd64a /cm3/bin]$ ./Juno<BR>> ><BR>***<=3D> >BR>*** ru=
>ntime error:<BR>*** =3D3D3B =3D3D3B =3D3D3B Exception "IPE=3D> =
>>=3D3D> >rror.FatalError" not in RAISES list<BR>*** =3D3D3B =3D3D3B=
> =3D> >=3D3D3B file "..=3D3D> >/src/common/IPError.m3"=3D3D2C line 27<B=
>R>***<BR>> ><BR>A=3D> >bort trap: 6 (core dumped)<BR>[jay at fbsdamd64a /cm3/b=
>in]$<BR>> ><BR>IP.m3:<B=3D> >R>> > =3D3D3B<BR>> >PROCEDURE GetHostAddr(=
>): Address =3D3D3D<BR> =3D3D3B =3D> >VAR hname: ARRAY [0..255] =3D3D> O=
>F CHAR=3D3D3B<BR> =3D3D3B BEGIN<BR> =3D3D=3D> >3B =3D3D3B =
>=3D3D3B LOCK mu DO<BR>&nbs=3D3D> >p=3D3D3B =3D3D3B =3D3D3B&n=3D> >b=
>sp=3D3D3B =3D3D3B IF Unix.gethostname(ADR(hname[0])=3D3D2C B=3D3D> >YTE=
>SIZE(hn=3D> >ame)) # 0 THEN<BR> =3D3D3B =3D3D3B =3D3D3B =3D=
>3D3B =3D3D3B =3D> >=3D3D> >=3D3D3B =3D3D3B IPError.Die ()=3D3D3=
>B<BR> =3D3D3B =3D3D3B =3D3D3B=3D> > =3D3D3B =3D3D3B E=
>=3D3D> >ND=3D3D3B<BR> =3D3D3B =3D3D3B =3D3D3B =3D> >=3D3D3B=
> =3D3D3B VAR h :=3D3D3D Unetdb.gethost=3D3D> >byname(ADR(hname[0]))=3D3=
>D3B=3D> > BEGIN<BR> =3D3D3B =3D3D3B =3D3D3B =3D3D3B =3D=
>3D3B&=3D3D> >nbsp=3D3D3=3D> >B =3D3D3B IF h =3D3D3D NIL THEN IPError.Di=
>e()=3D3D3B END=3D3D3B<BR> =3D3D3B&n=3D> >bsp=3D3D> >=3D3D3B =3D3D3B=
> =3D3D3B =3D3D3B =3D3D3B =3D3D3B RETURN Get=3D> >Address(h)=
>=3D3D3B<BR>&nbs=3D3D> >p=3D3D3B =3D3D3B =3D3D3B =3D3D3B =3D=
>3D3B=3D> > END=3D3D3B<BR> =3D3D3B =3D3D3B =3D3D3B END=3D3D> >=
>=3D3D3B<BR> =3D3D3B EN=3D> >D GetHostAddr=3D3D3B<BR>> ><BR>PROCEDURE Ge=
>tAddress (ent: Unetdb.struct_hoste=3D> >nt_star): Address =3D3D3D<BR>=3D3D>=
> > =3D3D3B VAR ua: Uin.struct_in_addr=3D3D3B=3D> ><BR> =3D3D3B BEGI=
>N<BR> =3D3D3B =3D3D> >=3D3D3B =3D3D3B <=3D3D3B* ASSE=3D> >RT =
>ent.h_length <=3D3D3B=3D3D3D BYTESIZE(Address) *>=3D3D3B=3D3D> ><BR>&nb=
>sp=3D3D=3D> >3B =3D3D3B =3D3D3B ua :=3D3D3D LOOPHOLE(ent.h_addr_lis=
>t=3D3D2C<BR> =3D3D>=3D> > >=3D3D3B =3D3D3B =3D3D3B =3D3D3B&=
>nbsp=3D3D3B =3D3D3B =3D3D3B =3D3D=3D> >3B =3D3D3B =3D3D=
>3B=3D3D> > =3D3D3B =3D3D3B =3D3D3B =3D3D3B =3D> >=3D3D3=
>B =3D3D3B =3D3D3B =3D3D3B =3D3D3B UN=3D3D> >TRACED REF UNTR=
>ACED R=3D> >EF Uin.struct_in_addr)^^=3D3D3B<BR> =3D3D3B =3D3D3B&nbs=
>p=3D3D> >=3D3D3B RETUR=3D> >N LOOPHOLE(ua.s_addr=3D3D2C Address)=3D3D3B<BR>=
> =3D3D3B END GetAddress=3D3D3B<=3D> >=3D3D> >BR>> > =3D3D3B<BR>> >g=
>ethostbyname is failing.<BR>> ><BR> =3D3D3B=3D> ><BR>> >Analogous C cod=
>e also fails:<BR>> > =3D3D3B<BR>> ><BR>[jay at fbsdamd=3D> >64a /cm3/bin]$=
> cat ~/5.c<BR>#include <=3D3D3Bassert.h>=3D3D3B<B=3D3D> >R>#inc=3D> >lu=
>de <=3D3D3Bnetdb.h>=3D3D3B<BR>#include <=3D3D3Bstdio.h>=3D3D3B<BR>#=
>includ=3D> >e =3D3D> ><=3D3D3Berrno.h>=3D3D3B<BR>typedef struct hostent=
> hostent_t=3D3D3B<BR=3D> >>> > =3D3D3B<BR>> >int main()<BR>{<BR> =
>=3D3D3Bchar hostname[200]=3D3D3B<B=3D> >R> =3D3D3Bhostent_t* h=3D3D3B=
>=3D3D> ><BR> =3D3D3Bint i=3D3D3B<BR>> > =3D3D3=3D> >Bi =3D3D3D geth=
>ostname(hostname=3D3D2C 200)=3D3D3B<BR> =3D3D3Bassert(i =3D3D3D=3D3D=3D=
>> >3D 0)=3D3D> >=3D3D3B<BR> =3D3D3Bprintf("hostname: %s\n"=3D3D2C hostn=
>ame)=3D3D3B<B=3D> >R> =3D3D3Bh =3D3D3D get=3D3D> >hostbyname(hostname)=
>=3D3D3B<BR> =3D3D3Bherror(=3D> >"foo")=3D3D3B<BR> =3D3D3Bprintf("%p=
> %=3D3D> >d %d\n"=3D3D2C h=3D3D2C errno=3D3D2C h=3D> >_errno)=3D3D3B<BR>&nb=
>sp=3D3D3Bassert(h)=3D3D3B<BR> =3D3D3Bret=3D3D> >urn 0=3D3D3B<B=3D> >R>}=
><BR>> > =3D3D3B<BR>> >herror says "unknown host".<BR>> ><BR>Stack is:<=
>=3D> >BR>> > =3D3D3B =3D3D3B =3D3D3B at ../src/runtime/ex_frame=
>/RTExFrame.m=3D> >3:58<BR>#13 =3D3D> >0x0000000801a7f2b3 in RTHooks__Raise =
>(M3_AJWxb1_ex=3D3D3DEr=3D> >ror accessing memory=3D3D> > ad<BR>dress 0x8000=
>ffffd278: Bad address.<BR>)<BR=3D> >> =3D3D3B =3D3D3B =3D3D3B =
>=3D3D> >at ../src/runtime/common/RTHooks.m3:7=3D> >9<BR>#14 0x000000080169c=
>8d3 in IPError=3D3D> >__Die () at ../src/common/IPErr=3D> >or.m3:27<BR>#15 =
>0x0000000801698a3e in IP__Ge=3D3D> >tHostAddr (M3_BCxjPn__res=3D> ult=3D3D3=
>DError accessing mem<BR>ory address 0x8000fff=3D3D> >fd338: Bad addres=3D> =
>>s.<BR>)<BR> =3D3D3B =3D3D3B =3D3D3B at ../src/POSIX/IP.m3:=3D3=
>D> >82<BR=3D> >>#16 0x00000008012133d0 in XSharedMem__SameHost (M3_AQuuui_t=
>rsl=3D3D3DErro=3D3D=3D> >> >r accessing m<BR>emory address 0x8000ffffd4d8: =
>Bad address.<BR>)<BR>&nbs=3D> >p=3D3D> >=3D3D3B =3D3D3B =3D3D3B at =
>../src/xvbt/XSharedMem.m3:96<BR>#17 0x0=3D> >000000801212a=3D3D> >b7 in XSh=
>aredMem__InitXClient (M3_AQuuui_v=3D3D3DError acc=3D> >essing m<BR>emory ad=
>d=3D3D> >ress 0x8000ffffd648: Bad address.<BR>)<BR> =3D> >=3D3D3B =
>=3D3D3B =3D3D3B at ../sr=3D3D> >c/xvbt/XSharedMem.m3:29<BR>#18 0x00=3D>=
> >00000801211819 in XExtensions__InitXClie=3D3D> >nt (M3_AQuuui_xclient=3D3=
>D3DErr=3D> >or acce<BR>ssing memory address 0x8000ffffd7f8: =3D3D> >Bad add=
>ress.<BR>)<BR>=3D> > =3D3D3B =3D3D3B =3D3D3B at ../src/xvbt/XEx=
>tensions.m3=3D3D> >:14<BR>#1=3D> >9 0x00000008012467a4 in XClientF__Connect=
> (M3_Bd56fi_inst=3D3D3D0x1879=3D3D> >b=3D> >=3D3D2C<BR> =3D3D3B =3D=
>3D3B =3D3D3B M3_AQuuui_trsl=3D3D3D0x6) at ../src/x=3D> >vbt/XClie=3D3D>=
> >ntF.m3:583<BR>---Type <=3D3D3Breturn>=3D3D3B to continue=3D3D2=3D> >C=
> or q <=3D3D3Breturn&g=3D3D> >t=3D3D3B to quit---<BR>(More stack frames f=
>ollow=3D> >...)<BR>(gdb)<BR>> ><BR>(* return TRUE if server and client are =
>on same hos=3D> >t *)<BR>PROCEDURE Sa=3D3D> >meHost (trsl: XClient.T): BOOL=
>EAN =3D3D3D<BR> =3D> >=3D3D3B VAR<BR> =3D3D3B =3D3D3B&n=3D3D> >=
>bsp=3D3D3B display =3D3D3B =3D3D=3D> >3B =3D3D3B =3D3D3B&nb=
>sp=3D3D3B =3D3D3B =3D3D3B =3D3D> >=3D3D3B =3D> >=3D3D3B&nbs=
>p=3D3D3B =3D3D3B =3D3D3B =3D3D3B =3D3D3B =3D3D3B =
>=3D3D3B=3D> :=3D3D3D Di=3D3D> >splayHost(trsl)=3D3D3B<BR> =3D3D3B =
>=3D3D3B =3D3D3B disp=3D> >layAddr: IP.Address=3D3D3B<B=3D3D> >R> =
>=3D3D3B BEGIN<BR> =3D3D3B =3D3D3B&=3D> >nbsp=3D3D3B IF display =3D3=
>D3D NIL THEN RETURN=3D3D> > TRUE=3D3D3B END=3D3D3B<BR>> >&=3D> >nbsp=3D3D3B=
> =3D3D3B =3D3D3B TRY<BR> =3D3D3B =3D3D3B =3D3D3B =
>=3D3D=3D> >3B =3D3D3B IF=3D3D> > NOT IP.GetHostByName(display=3D3D2C di=
>splayAddr) THEN R=3D> >ETURN FALSE=3D3D3B END=3D3D3B<B=3D3D> >R> =3D3D3=
>B =3D3D3B =3D3D3B =3D3D3B=3D> > =3D3D3B RETURN displayAddr =
>=3D3D3D IP.GetHos=3D3D> >tAddr()=3D3D3B<BR> =3D3D=3D> >3B =3D3D3B&n=
>bsp=3D3D3B EXCEPT<BR> =3D3D3B =3D3D3B =3D3D3B |=3D3D> > IP.=3D>=
> >Error =3D3D3D>=3D3D3B RETURN FALSE=3D3D3B<BR> =3D3D3B =3D3D3B&n=
>bsp=3D3D3B END=3D> >=3D3D3B<BR>&=3D3D> >nbsp=3D3D3B END SameHost=3D3D3B<BR>=
>> > =3D3D3B<BR>> >Thoughts=3D> >?<BR>> > =3D3D3B<BR>> ><BR>Perhaps =
>my network isn't setup well=3D3D2C like =3D> >I should add the local mach=
>=3D3D> >ine to /etc/hosts.<BR>I think this can be =3D> >made to fail gracef=
>ully though.<B=3D3D> >R>It seems like it has nothing to do=3D> > with AMD64=
>_FREEBSD=3D3D2C but could have t=3D3D> >o do with FreeBSD.<BR>> ><BR=3D> >>=
> =3D3D3B<BR>> >Seems like SocketPosix has nearly the exact same code bu=
>t=3D> > appears<BR>more f=3D3D> >orgiving.. IOError instead of Fatal?<BR>> =
>> =3D3D=3D> >3B<BR>> ><BR>SocketPosix.m3:<BR>> > =3D3D3B<BR>> ><BR>=
>PROCEDURE GetHostAd=3D> >dr (): Address<BR> =3D3D3B RAISES {OSError.E} =
>=3D3D3D<BR=3D3D> >> =3D3D3B V=3D> >AR<BR> =3D3D3B =3D3D3B =
>=3D3D3B host : ARRAY [0..255] OF CHAR=3D3D3B<=3D3D=3D> >> >BR> =3D3D3B&=
>nbsp=3D3D3B =3D3D3B info : Unetdb.struct_hostent_star=3D3D3B=3D> ><BR>&=
>nbsp=3D3D> >=3D3D3B =3D3D3B =3D3D3B ua =3D3D3B =3D3D3B : Ui=
>n.struc=3D> >t_in_addr=3D3D3B<BR> =3D3D3B =3D3D> >BEGIN<BR> =3D3D3B=
> =3D3D3B =3D3D3B =3D> >IF Unix.gethostname (ADR (host[0])=3D3D2C BY=
>T=3D3D> >ESIZE (host)) # 0 THEN<BR>=3D> > =3D3D3B =3D3D3B =3D3D=
>3B =3D3D3B =3D3D3B IOError =3D3D> >(Unexpecte=3D> >d)=3D3D3B<BR>&nb=
>sp=3D3D3B =3D3D3B =3D3D3B END=3D3D3B<BR>> > =3D3D3B =3D3D=
>=3D> >3B =3D3D3B info :=3D3D3D Unetdb.gethostbyname (ADR (host[0]))=3D3=
>D3B<=3D3D> >BR=3D> >> =3D3D3B =3D3D3B =3D3D3B IF info =3D3D3D N=
>IL THEN IOError (Unexpected)=3D> >=3D3D3B EN=3D3D> >D=3D3D3B<BR> =3D3D3=
>B =3D3D3B =3D3D3B <=3D3D3B* ASSERT inf=3D> >o.h_length <=3D3D3B=
>=3D3D3D BYT=3D3D> >ESIZE (Address) *>=3D3D3B<BR>> > =3D3D3=3D> >B&nbs=
>p=3D3D3B =3D3D3B ua :=3D3D3D LOOPHOLE(info.h_addr_list=3D3D2C<BR> =
>=3D3D3=3D> >B&n=3D3D> >bsp=3D3D3B =3D3D3B =3D3D3B =3D3D3B =
>=3D3D3B =3D3D3B =3D3D=3D> >3B =3D3D3B =3D3D3B =3D3D> >=
>=3D3D3B =3D3D3B =3D3D3B =3D3D3B =3D> >=3D3D3B =3D3D3B&n=
>bsp=3D3D3B =3D3D3B UNTRACED REF UN=3D3D> >TRACED REF Uin.str=3D> >uct_i=
>n_addr)^^=3D3D3B<BR> =3D3D3B =3D3D3B =3D3D3B RETURN LOOP=3D3D> =
>>HOLE=3D> > (ua.s_addr=3D3D2C Address)=3D3D3B<BR> =3D3D3B END GetHostAd=
>dr=3D3D3B<BR>> >&nb=3D> >sp=3D3D3B<BR>> > =3D3D3B<BR>> >It is again dis=
>appointing to see such code d=3D> >uplication.<BR>> > =3D3D3B<BR>> >&nb=
>sp=3D3D3B<BR>> >I guess =3D3D3BSameHo=3D> >st can duplicate the logic t=
>o predict the error state =3D3D> >and return fals=3D> >e =3D3D3Bupon er=
>ror?<BR>> >Duplicating the logic for a third time. :(<BR>=3D> >> > =3D3=
>D3B<BR>> ><BR> =3D3D3B- Jay<BR><BR></body>> ></html>=3D3D> >> >--=3D> >=
>_9e67232c-a064-417d-879e-227a77e310f9_--=3D> >> >--_b00371fe-730b-4981-9051=
>-a874361296d7_> >Content-Type: text/html=3B charset=3D"iso-8859-1"> >Conten=
>t-Transfer-Encoding: quoted-printable> >> ><html>> ><head>> ><style>> >.hmm=
>essage P> >{> >margin:0px=3D3B> >padding:0px> >}> >body.hmmessage> >{> >fon=
>t-size: 10pt=3D3B> >font-family:Verdana> >}> ></style>> ></head>> ><body cl=
>ass=3D3D'hmmessage'>> >Do you know the right way?<BR>> > =3D3B<BR>> >PP=
>C_LINUX "just worked"=3D2C and I can check Solaris and Darwin.<BR>> > =
>=3D3B<BR>> >I don't want to edit /etc/hosts -- I use DHCP.<BR>> >Though DHC=
>P has been bothering me -- only for some of my machines do names =3D> >reso=
>lve=3D2C so I end using IP addresses=3D2C which change sometimes=3D2C and I=
> l=3D> >oop over them running ssh to all of them and "see what I get"=3D2C =
>not ideal.=3D> ><BR>> > =3D3B<BR>> > =3D3B- Jay<BR><BR><BR>>=3D3B=
> To: jay.krell at cornell.edu<BR>>=3D3B Date: S=3D> >un=3D2C 11 Jan 2009 08:=
>02:18 -0800<BR>>=3D3B From: mika at async.caltech.edu<BR>=3D> >>=3D3B CC: =
>m3devel at elegosoft.com<BR>>=3D3B Subject: Re: [M3devel] Juno (X) =3D> >net=
>working problem on AMD64_FREEBSD<BR>>=3D3B <BR>>=3D3B This is a screwy =
>t=3D> >hing in Modula-3. A bug I would call it.<BR>>=3D3B <BR>>=3D3B I'=
>ve noticed =3D> >a lot of networking M3 programs don't work right unless<BR=
>>>=3D3B the retur=3D> >n value of Unix's "hostname" maps to a real IP add=
>ress via<BR>>=3D3B gethos=3D> >tbyname. I accomplish it in practice by ad=
>ding my hostname<BR>>=3D3B to /et=3D> >c/hosts.<BR>>=3D3B <BR>>=3D3B =
>This is obviously not the right way to fix it=3D> >... <BR>>=3D3B <BR>>=
>=3D3B Mika<BR>>=3D3B <BR>>=3D3B Jay writes:<BR>>=3D3B &=3D> >gt=3D3B-=
>-_9e67232c-a064-417d-879e-227a77e310f9_<BR>>=3D3B >=3D3BContent-Type:=
>=3D> > text/plain=3D3B charset=3D3D"iso-8859-1"<BR>>=3D3B >=3D3BContent=
>-Transfer-Enco=3D> >ding: quoted-printable<BR>>=3D3B >=3D3B<BR>>=3D3B=
> >=3D3B<BR>>=3D3B >=3D3BHi=3D> >. Unix network programming question..=
><BR>>=3D3B >=3D3BAMD64_FREEBSD:<BR>>=3D> >=3D3B >=3D3B$DISPLAY is s=
>et to point back to Cygwin host.It works for PPC_LIN=3D> >UX.<BR>>=3D3B &=
>gt=3D3B[jay at fbsdamd64a /cm3/bin]$ ./Juno<BR>>=3D3B >=3D3B*****=3D> >* r=
>untime error:*** Exception "IPError.FatalError" not in RAISES li=3D3D<BR>&=
>=3D> >gt=3D3B >=3D3Bst*** file "../src/common/IPError.m3"=3D3D2C line 27*=
>**<BR>>=3D3B=3D> > >=3D3BAbort trap: 6 (core dumped)[jay at fbsdamd64a /cm=
>3/bin]$<BR>>=3D3B >=3D> >=3D3BIP.m3:<BR>>=3D3B >=3D3B=3D3D20<BR>>=
>=3D3B >=3D3BPROCEDURE GetHostAddr(): Ad=3D> >dress =3D3D3D VAR hname: ARR=
>AY [0..255] OF CHAR=3D3D3B =3D3D<BR>>=3D3B >=3D3B BEG=3D> >IN LOCK mu D=
>O IF Unix.gethostname(ADR(hname[0])=3D3D2C BYTESIZE(hna=3D3D<BR>>=3D> >=
>=3D3B >=3D3Bme)) # 0 THEN IPError.Die ()=3D3D3B END=3D3D3B VAR h :=3D3D3D=
> Unetdb.g=3D> >=3D3D<BR>>=3D3B >=3D3Bethostbyname(ADR(hname[0]))=3D3D3B=
> BEGIN IF h =3D3D3D NIL T=3D> >HEN IPError.Die()=3D3D<BR>>=3D3B >=3D3B=
>=3D3D3B END=3D3D3B RETURN GetAddress(h)=3D3D=3D> >3B END=3D3D3B END=3D3D3B =
>END GetHos=3D3D<BR>>=3D3B >=3D3BtAddr=3D3D3B<BR>>=3D3B >=3D> >=3D3B=
>PROCEDURE GetAddress (ent: Unetdb.struct_hostent_star): Address =3D3D3D VA=
>=3D> >R ua=3D3D<BR>>=3D3B >=3D3B: Uin.struct_in_addr=3D3D3B BEGIN <=
>=3D3B* ASSERT ent.=3D> >h_length <=3D3B=3D3D3D BYTESIZE(Addr=3D3D<BR>>=
>=3D3B >=3D3Bess) *>=3D3B ua :=3D3D3=3D> >D LOOPHOLE(ent.h_addr_list=3D3=
>D2C UNTRACED =3D3D<BR>>=3D3B >=3D3BREF UNTRACED R=3D> >EF Uin.struct_in=
>_addr)^^=3D3D3B RETURN LOOPHOLE(ua.s_addr=3D3D2C A=3D3D<BR>>=3D3B=3D> > &=
>gt=3D3Bddress)=3D3D3B END GetAddress=3D3D3B<BR>>=3D3B >=3D3B=3D3D20<BR>=
>>=3D3B >=3D> >=3D3Bgethostbyname is failing.<BR>>=3D3B >=3D3B=3D3D2=
>0<BR>>=3D3B >=3D3BAnalogou=3D> >s C code also fails:<BR>>=3D3B >=3D=
>3B=3D3D20<BR>>=3D3B >=3D3B[jay at fbsdamd64a =3D> >/cm3/bin]$ cat ~/5.c#in=
>clude <=3D3Bassert.h>=3D3B#include <=3D3Bnetdb.h>=3D> >=3D3B#i=3D3D=
><BR>>=3D3B >=3D3Bnclude <=3D3Bstdio.h>=3D3B#include <=3D3Berrno.h=
>&g=3D> >t=3D3Btypedef struct hostent hostent_t=3D3D3B<BR>>=3D3B >=3D3B=
>=3D3D20<BR>>=3D3B &=3D> >gt=3D3Bint main(){ char hostname[200]=3D3D3B hos=
>tent_t* h=3D3D3B int i=3D3D3B<BR>&g=3D> >t=3D3B >=3D3B i =3D3D3D gethostn=
>ame(hostname=3D3D2C 200)=3D3D3B assert(i =3D3D3D=3D3D3D=3D> > 0)=3D3D3B pri=
>ntf("hostna=3D3D<BR>>=3D3B >=3D3Bme: %s\n"=3D3D2C hostname)=3D3D3B h =
>=3D> >=3D3D3D gethostbyname(hostname)=3D3D3B herror("foo")=3D3D3B=3D3D<BR>&=
>gt=3D3B >=3D3B p=3D> >rintf("%p %d %d\n"=3D3D2C h=3D3D2C errno=3D3D2C h_e=
>rrno)=3D3D3B assert(h)=3D3D3B retu=3D> >rn 0=3D3D3B}<BR>>=3D3B >=3D3B=
>=3D3D20<BR>>=3D3B >=3D3Bherror says "unknown host"=3D> >.<BR>>=3D3B &=
>gt=3D3BStack is:<BR>>=3D3B >=3D3B at ../src/runtime/ex_frame/RTE=3D> >x=
>Frame.m3:58#13 0x0000000801a7f2b3 in RTH=3D3D<BR>>=3D3B >=3D3Books__Rai=
>se (M=3D> >3_AJWxb1_ex=3D3D3DError accessing memory address 0x8000ffffd278:=
> =3D3D<BR>>=3D> >=3D3B >=3D3BBad address.) at ../src/runtime/common/RTH=
>ooks.m3:79#14 0x0000000=3D> >80169c8=3D3D<BR>>=3D3B >=3D3Bd3 in IPError=
>__Die () at ../src/common/IPError.m=3D> >3:27#15 0x0000000801698a3e =3D3D<B=
>R>>=3D3B >=3D3Bin IP__GetHostAddr (M3_BCxjP=3D> >n__result=3D3D3DError =
>accessing memory address 0x80=3D3D<BR>>=3D3B >=3D3B00ffff=3D> >d338: Ba=
>d address.) at ../src/POSIX/IP.m3:82#16 0x00000008012133d0=3D3D<BR>&g=3D> >=
>t=3D3B >=3D3B in XSharedMem__SameHost (M3_AQuuui_trsl=3D3D3DError accessi=
>ng mem=3D> >ory address 0=3D3D<BR>>=3D3B >=3D3Bx8000ffffd4d8: Bad addre=
>ss.) at ../src/xvb=3D> >t/XSharedMem.m3:96#17 0x000000=3D3D<BR>>=3D3B >=
>=3D3B0801212ab7 in XSharedMem_=3D> >_InitXClient (M3_AQuuui_v=3D3D3DError a=
>ccessing memory=3D3D<BR>>=3D3B >=3D3B ad=3D> >dress 0x8000ffffd648: Bad=
> address.) at ../src/xvbt/XSharedMem.m3:29#1=3D3D<BR=3D> >>>=3D3B >=3D3=
>B8 0x0000000801211819 in XExtensions__InitXClient (M3_AQuuui_x=3D> >client=
>=3D3D3DError=3D3D<BR>>=3D3B >=3D3B accessing memory address 0x8000ffffd=
>7f=3D> >8: Bad address.) at ../src/xvbt/X=3D3D<BR>>=3D3B >=3D3BExtensio=
>ns.m3:14#19 0x=3D> >00000008012467a4 in XClientF__Connect (M3_Bd56fi_inst=
>=3D3D<BR>>=3D3B >=3D3B=3D> >=3D3D3D0x1879b=3D3D2C M3_AQuuui_trsl=3D3D3D=
>0x6) at ../src/xvbt/XClientF.m3:583---=3D> >Typ=3D3D<BR>>=3D3B >=3D3Be =
><=3D3Breturn>=3D3B to continue=3D3D2C or q <=3D3Bret=3D> >urn>=3D3B=
> to quit---(More stack frames follow=3D3D<BR>>=3D3B >=3D3B...)(gdb)<=3D=
>> >BR>>=3D3B >=3D3B(* return TRUE if server and client are on same host=
> *)PROC=3D> >EDURE SameHost (=3D3D<BR>>=3D3B >=3D3Btrsl: XClient.T): BO=
>OLEAN =3D3D3D VAR dis=3D> >play :=3D3D3D DisplayH=3D3D<BR>>=3D3B >=3D3B=
>ost(trsl)=3D3D3B displayAddr: IP.Addr=3D> >ess=3D3D3B BEGIN IF display =3D3=
>D3D NIL THE=3D3D<BR>>=3D3B >=3D3BN RETURN TRUE=3D3D=3D> >3B END=3D3D3B<=
>BR>>=3D3B >=3D3B TRY IF NOT IP.GetHostByName(display=3D3D2C displ=3D> >=
>ayAddr) THEN RETURN FA=3D3D<BR>>=3D3B >=3D3BLSE=3D3D3B END=3D3D3B RETUR=
>N displayA=3D> >ddr =3D3D3D IP.GetHostAddr()=3D3D3B EXCEPT =3D3D<BR>>=3D3=
>B >=3D3B| IP.Error =3D3D3D=3D> >>=3D3B RETURN FALSE=3D3D3B END=3D3D3B E=
>ND SameHost=3D3D3B<BR>>=3D3B >=3D3B=3D3D20<B=3D> >R>>=3D3B >=3D3BTh=
>oughts?<BR>>=3D3B >=3D3B=3D3D20<BR>>=3D3B >=3D3BPerhaps my n=3D> >e=
>twork isn't setup well=3D3D2C like I should add the local machine =3D3D<BR>=
>>=3D> >=3D3B >=3D3Bto /etc/hosts.I think this can be made to fail grace=
>fully though.=3D> >It seems l=3D3D<BR>>=3D3B >=3D3Bike it has nothing t=
>o do with AMD64_FREEBSD=3D> >=3D3D2C but could have to do with Fr=3D3D<BR>&=
>gt=3D3B >=3D3BeeBSD.<BR>>=3D3B >=3D> >=3D3B=3D3D20<BR>>=3D3B >=3D=
>3BSeems like SocketPosix has nearly the exact same c=3D> >ode but appearsmo=
>re forgi=3D3D<BR>>=3D3B >=3D3Bving.. IOError instead of Fata=3D> >l?<BR=
>>>=3D3B >=3D3B=3D3D20<BR>>=3D3B >=3D3BSocketPosix.m3:<BR>>=3D3B &=
>gt=3D3B=3D> >=3D3D20<BR>>=3D3B >=3D3BPROCEDURE GetHostAddr (): Address =
>RAISES {OSError.E} =3D> >=3D3D3D VAR host : AR=3D3D<BR>>=3D3B >=3D3BRAY=
> [0..255] OF CHAR=3D3D3B info : Une=3D> >tdb.struct_hostent_star=3D3D3B ua =
>: U=3D3D<BR>>=3D3B >=3D3Bin.struct_in_addr=3D3D=3D> >3B BEGIN IF Unix.g=
>ethostname (ADR (host[0])=3D3D2C BYTESI=3D3D<BR>>=3D3B >=3D3B=3D> >ZE (=
>host)) # 0 THEN IOError (Unexpected)=3D3D3B END=3D3D3B<BR>>=3D3B >=3D3B=
> inf=3D> >o :=3D3D3D Unetdb.gethostbyname (ADR (host[0]))=3D3D3B IF info =
>=3D3D3D NIL TH=3D3D<=3D> >BR>>=3D3B >=3D3BEN IOError (Unexpected)=3D3D3=
>B END=3D3D3B <=3D3B* ASSERT info.h=3D> >_length <=3D3B=3D3D3D BYTESIZE =
>=3D3D<BR>>=3D3B >=3D3B(Address) *>=3D3B<BR>>=3D> >=3D3B >=3D3B ua=
> :=3D3D3D LOOPHOLE(info.h_addr_list=3D3D2C UNTRACED REF UNT=3D3D<BR>=3D> >&=
>gt=3D3B >=3D3BRACED REF Uin.struct_in_addr)^^=3D3D3B RETURN LOOPHOLE (ua.=
>s_add=3D> >r=3D3D2C Address=3D3D<BR>>=3D3B >=3D3B)=3D3D3B END GetHostAd=
>dr=3D3D3B<BR>>=3D3B >=3D> >=3D3B=3D3D20<BR>>=3D3B >=3D3B=3D3D20<BR>=
>>=3D3B >=3D3BIt is again disappointing to=3D> > see such code duplicati=
>on.<BR>>=3D3B >=3D3B=3D3D20<BR>>=3D3B >=3D3B=3D3D20<BR>=3D> >>=3D=
>3B >=3D3BI guess SameHost can duplicate the logic to predict the error =
>=3D> >state and ret=3D3D<BR>>=3D3B >=3D3Burn false upon error?<BR>>=
>=3D3B >=3D3BDupl=3D> >icating the logic for a third time. :(<BR>>=3D3B =
>>=3D3B=3D3D20<BR>>=3D3B >=3D> >=3D3B - Jay=3D3D<BR>>=3D3B >=3D3B<=
>BR>>=3D3B >=3D3B--_9e67232c-a064-417d-879e-22=3D> >7a77e310f9_<BR>>=
>=3D3B >=3D3BContent-Type: text/html=3D3B charset=3D3D"iso-8859-=3D> >1"<B=
>R>>=3D3B >=3D3BContent-Transfer-Encoding: quoted-printable<BR>>=3D3B =
>&g=3D> >t=3D3B<BR>>=3D3B >=3D3B<=3D3Bhtml>=3D3B<BR>>=3D3B >=3D3=
>B<=3D3Bhead>=3D3B<BR>&=3D> >gt=3D3B >=3D3B<=3D3Bstyle>=3D3B<BR>&g=
>t=3D3B >=3D3B.hmmessage P<BR>>=3D3B >=3D3B=3D> >{<BR>>=3D3B >=3D3=
>Bmargin:0px=3D3D3B<BR>>=3D3B >=3D3Bpadding:0px<BR>>=3D3B >=3D> >=3D=
>3B}<BR>>=3D3B >=3D3Bbody.hmmessage<BR>>=3D3B >=3D3B{<BR>>=3D3B &g=
>t=3D3Bfont-=3D> >size: 10pt=3D3D3B<BR>>=3D3B >=3D3Bfont-family:Verdana<=
>BR>>=3D3B >=3D3B}<BR>&g=3D> >t=3D3B >=3D3B<=3D3B/style>=3D3B<BR>&=
>gt=3D3B >=3D3B<=3D3B/head>=3D3B<BR>>=3D3B &=3D> >gt=3D3B<=3D3Bbod=
>y class=3D3D3D'hmmessage'>=3D3B<BR>>=3D3B >=3D3BHi. Unix networ=3D> >=
>k programming question..<=3D3BBR>=3D3B<BR>>=3D3B >=3D3B<=3D3BBR&g=
>t=3D3BAMD64_=3D> >FREEBSD:<=3D3BBR>=3D3B<BR>>=3D3B >=3D3B<=3D3BBR=
>>=3D3B$DISPLAY is set to poi=3D> >nt back to Cygwin host.<=3D3BBR>=3D=
>3BIt works for PPC_LINUX=3D3D<BR>>=3D3B &g=3D> >t=3D3B.<=3D3BBR>=3D3B=
><BR>>=3D3B >=3D3B<=3D3BBR>=3D3B[jay at fbsdamd64a /cm3/bin]=3D> >$ ./J=
>uno<=3D3BBR>=3D3B<BR>>=3D3B >=3D3B<=3D3BBR>=3D3B***<=3D3BBR&g=
>t=3D3B*** r=3D> >untime error:<=3D3BBR>=3D3B***&=3D3Bnbsp=3D3D3B&=
>=3D3Bnbsp=3D3D3B&=3D3Bnbsp=3D> >=3D3D3B Exception "IPE=3D3D<BR>>=3D3B =
>>=3D3Brror.FatalError" not in RAISES list=3D> ><=3D3BBR>=3D3B***&=
>=3D3Bnbsp=3D3D3B&=3D3Bnbsp=3D3D3B&=3D3Bnbsp=3D3D3B file "..=3D> >=3D3=
>D<BR>>=3D3B >=3D3B/src/common/IPError.m3"=3D3D2C line 27<=3D3BBR>=
>=3D3B***&l=3D> >t=3D3BBR>=3D3B<BR>>=3D3B >=3D3B<=3D3BBR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3D> >p=3D3D=
>3B&=3D3Bnbsp=3D3D<BR>>=3D3B >=3D3B=3D3D3B RETURN LOOPHOLE(ua.s_addr=
>=3D3D2C A=3D> >ddress)=3D3D3B<=3D3BBR>=3D3B&=3D3Bnbsp=3D3D3B END Get=
>Address=3D3D3B<=3D3B=3D3D<BR>=3D> >>=3D3B >=3D3BBR>=3D3B<BR>>=3D3=
>B >=3D3B&=3D3Bnbsp=3D3D3B<=3D3BBR>=3D3B<BR>>=3D> >=3D3B >=3D3B=
>gethostbyname is failing.<=3D3BBR>=3D3B<BR>>=3D3B >=3D3B<=3D3BBR&=
>=3D> >gt=3D3B&=3D3Bnbsp=3D3D3B<=3D3BBR>=3D3B<BR>>=3D3B >=3D3BAna=
>logous C code also f=3D> >ails:<=3D3BBR>=3D3B<BR>>=3D3B >=3D3B&=
>=3D3Bnbsp=3D3D3B<=3D3BBR>=3D3B<BR>>=3D> >=3D3B >=3D3B<=3D3BBR>=
>=3D3B[jay at fbsdamd64a /cm3/bin]$ cat ~/5.c<=3D3BBR>=3D3B#=3D> >include &=
>amp=3D3Blt=3D3D3Bassert.h&=3D3Bgt=3D3D3B<=3D3BB=3D3D<BR>>=3D3B >=
>=3D3BR>=3D> >=3D3B#include &=3D3Blt=3D3D3Bnetdb.h&=3D3Bgt=3D3D3B<=
>=3D3BBR>=3D3B#include &=3D> >=3D3Blt=3D3D3Bstdio.h&=3D3Bgt=3D3D3B&l=
>t=3D3BBR>=3D3B#include =3D3D<BR>>=3D3B >=3D3B&=3D> >amp=3D3Blt=3D3D3B=
>errno.h&=3D3Bgt=3D3D3B<=3D3BBR>=3D3Btypedef struct hostent host=3D> =
>>ent_t=3D3D3B<=3D3BBR>=3D3B<BR>>=3D3B >=3D3B&=3D3Bnbsp=3D3D3B<=
>=3D3BBR>=3D3B<BR>=3D> >>=3D3B >=3D3Bint main()<=3D3BBR>=3D3B{<=
>=3D3BBR>=3D3B&=3D3Bnbsp=3D3D3Bchar ho=3D> >stname[200]=3D3D3B<=3D3BB=
>R>=3D3B&=3D3Bnbsp=3D3D3Bhostent_t* h=3D3D3B=3D3D<BR>>=3D> >=3D3B >=
>=3D3B<=3D3BBR>=3D3B&=3D3Bnbsp=3D3D3Bint i=3D3D3B<=3D3BBR>=3D3B<B=
>R>>=3D3B =3D> >>=3D3B&=3D3Bnbsp=3D3D3Bi =3D3D3D gethostname(hostname=
>=3D3D2C 200)=3D3D3B<=3D3BBR&g=3D> >t=3D3B&=3D3Bnbsp=3D3D3Bassert(i =3D=
>3D3D=3D3D3D 0)=3D3D<BR>>=3D3B >=3D3B=3D3D3B<=3D3BBR=3D> >>=3D3B&=
>=3D3Bnbsp=3D3D3Bprintf("hostname: %s\n"=3D3D2C hostname)=3D3D3B<=3D3BBR&g=
>=3D> >t=3D3B&=3D3Bnbsp=3D3D3Bh =3D3D3D get=3D3D<BR>>=3D3B >=3D3Bhost=
>byname(hostname)=3D3D3=3D> >B<=3D3BBR>=3D3B&=3D3Bnbsp=3D3D3Bherror("=
>foo")=3D3D3B<=3D3BBR>=3D3B&=3D3Bnbsp=3D> >=3D3D3Bprintf("%p %=3D3D<B=
>R>>=3D3B >=3D3Bd %d\n"=3D3D2C h=3D3D2C errno=3D3D2C h_errno=3D> >)=3D3D=
>3B<=3D3BBR>=3D3B&=3D3Bnbsp=3D3D3Bassert(h)=3D3D3B<=3D3BBR>=3D3B&=
>amp=3D3Bnbsp=3D> >=3D3D3Bret=3D3D<BR>>=3D3B >=3D3Burn 0=3D3D3B<=3D3BB=
>R>=3D3B}<=3D3BBR>=3D3B<BR>>=3D> >=3D3B >=3D3B&=3D3Bnbsp=3D3D3B=
><=3D3BBR>=3D3B<BR>>=3D3B >=3D3Bherror says "unkno=3D> >wn host".<=
>=3D3BBR>=3D3B<BR>>=3D3B >=3D3B<=3D3BBR>=3D3BStack is:<=3D3BBR&g=
>t=3D> >=3D3B<BR>>=3D3B >=3D3B&=3D3Bnbsp=3D3D3B&=3D3Bnbsp=3D3D3B&a=
>mp=3D3Bnbsp=3D3D3B at ../=3D> >src/runtime/ex_frame/RTExFrame.m3:58<=3D3B=
>BR>=3D3B#13 =3D3D<BR>>=3D3B >=3D3B0=3D> >x0000000801a7f2b3 in RTHooks=
>__Raise (M3_AJWxb1_ex=3D3D3DError accessing memor=3D> >y=3D3D<BR>>=3D3B &=
>gt=3D3B ad<=3D3BBR>=3D3Bdress 0x8000ffffd278: Bad address.<=3D> >=3D3=
>BBR>=3D3B)<=3D3BBR>=3D3B&=3D3Bnbsp=3D3D3B&=3D3Bnbsp=3D3D3B&=
>=3D3Bnbsp=3D3D3B =3D> >=3D3D<BR>>=3D3B >=3D3Bat ../src/runtime/common/R=
>THooks.m3:79<=3D3BBR>=3D3B#14=3D> > 0x000000080169c8d3 in IPError=3D3D<=
>BR>>=3D3B >=3D3B__Die () at ../src/common=3D> >/IPError.m3:27<=3D3BBR=
>>=3D3B#15 0x0000000801698a3e in IP__Ge=3D3D<BR>>=3D3B &=3D> >gt=3D3BtHo=
>stAddr (M3_BCxjPn__result=3D3D3DError accessing mem<=3D3BBR>=3D3Bory =
>=3D> >address 0x8000fff=3D3D<BR>>=3D3B >=3D3Bfd338: Bad address.<=3D3=
>BBR>=3D3B)<=3D> >=3D3BBR>=3D3B&=3D3Bnbsp=3D3D3B&=3D3Bnbsp=3D3D3=
>B&=3D3Bnbsp=3D3D3B at ../src/POSIX=3D> >/IP.m3:=3D3D<BR>>=3D3B >=3D3=
>B82<=3D3BBR>=3D3B#16 0x00000008012133d0 in XShare=3D> >dMem__SameHost (=
>M3_AQuuui_trsl=3D3D3DErro=3D3D<BR>>=3D3B >=3D3Br accessing m<=3D> >=
>=3D3BBR>=3D3Bemory address 0x8000ffffd4d8: Bad address.<=3D3BBR>=3D3B=
>)<=3D3BB=3D> >R>=3D3B&=3D3Bnbsp=3D3D<BR>>=3D3B >=3D3B=3D3D3B&=
>=3D3Bnbsp=3D3D3B&=3D3Bnbsp=3D3D3B=3D> > at ../src/xvbt/XSharedMem.m3:96&=
>lt=3D3BBR>=3D3B#17 0x0000000801212a=3D3D<BR>&g=3D> >t=3D3B >=3D3Bb7 in =
>XSharedMem__InitXClient (M3_AQuuui_v=3D3D3DError accessing m=3D> ><=3D3BB=
>R>=3D3Bemory add=3D3D<BR>>=3D3B >=3D3Bress 0x8000ffffd648: Bad addres=
>s=3D> >.<=3D3BBR>=3D3B)<=3D3BBR>=3D3B&=3D3Bnbsp=3D3D3B&=3D3Bn=
>bsp=3D3D3B&=3D3Bnbsp=3D> >=3D3D3B at ../sr=3D3D<BR>>=3D3B >=3D3Bc/xv=
>bt/XSharedMem.m3:29<=3D3BBR>=3D3B#18 =3D> >0x0000000801211819 in XExten=
>sions__InitXClie=3D3D<BR>>=3D3B >=3D3Bnt (M3_AQuu=3D> >ui_xclient=3D3D3=
>DError acce<=3D3BBR>=3D3Bssing memory address 0x8000ffffd7f8:=3D> > =3D=
>3D<BR>>=3D3B >=3D3BBad address.<=3D3BBR>=3D3B)<=3D3BBR>=3D3B&am=
>p=3D3Bnbsp=3D> >=3D3D3B&=3D3Bnbsp=3D3D3B&=3D3Bnbsp=3D3D3B at ../src/x=
>vbt/XExtensions.m3=3D3D<BR>&=3D> >gt=3D3B >=3D3B:14<=3D3BBR>=3D3B#19 =
>0x00000008012467a4 in XClientF__Connect (M=3D> >3_Bd56fi_inst=3D3D3D0x1879=
>=3D3D<BR>>=3D3B >=3D3Bb=3D3D2C<=3D3BBR>=3D3B&=3D3Bnbsp=3D> >=3D3=
>D3B&=3D3Bnbsp=3D3D3B&=3D3Bnbsp=3D3D3B M3_AQuuui_trsl=3D3D3D0x6) at ..=
>/src/xvb=3D> >t/XClie=3D3D<BR>>=3D3B >=3D3BntF.m3:583<=3D3BBR>=3D3B=
>---Type &=3D3Blt=3D3D3Bre=3D> >turn&=3D3Bgt=3D3D3B to continue=3D3D2C=
> or q &=3D3Blt=3D3D3Breturn&=3D3Bg=3D3D<BR=3D> >>>=3D3B >=3D3Bt=
>=3D3D3B to quit---<=3D3BBR>=3D3B(More stack frames follow...)&=3D> >lt=
>=3D3BBR>=3D3B(gdb)<=3D3BBR>=3D3B<BR>>=3D3B >=3D3B<=3D3BBR>=3D=
>3B(* return TR=3D> >UE if server and client are on same host *)<=3D3BBR&g=
>t=3D3BPROCEDURE Sa=3D3D<BR=3D> >>>=3D3B >=3D3BmeHost (trsl: XClient.T):=
> BOOLEAN =3D3D3D<=3D3BBR>=3D3B&=3D3Bn=3D> >bsp=3D3D3B VAR<=3D3BBR&=
>gt=3D3B&=3D3Bnbsp=3D3D3B&=3D3Bnbsp=3D3D3B&=3D3Bn=3D3D<BR>&g=3D> >t=
>=3D3B >=3D3Bbsp=3D3D3B display&=3D3Bnbsp=3D3D3B&=3D3Bnbsp=3D3D3B&am=
>p=3D3Bnbsp=3D3D3B=3D> >&=3D3Bnbsp=3D3D3B&=3D3Bnbsp=3D3D3B&=3D3Bnbs=
>p=3D3D3B&=3D3Bnbsp=3D3D3B&=3D3Bnbsp=3D> >=3D3D<BR>>=3D3B >=3D3B=
>=3D3D3B&=3D3Bnbsp=3D3D3B&=3D3Bnbsp=3D3D3B&=3D3Bnbsp=3D3D3B&a=3D> >=
>mp=3D3Bnbsp=3D3D3B&=3D3Bnbsp=3D3D3B&=3D3Bnbsp=3D3D3B&=3D3Bnbsp=3D3=
>D3B&=3D3Bnbsp=3D> >=3D3D3B :=3D3D3D Di=3D3D<BR>>=3D3B >=3D3BsplayHos=
>t(trsl)=3D3D3B<=3D3BBR>=3D3B&=3D> >=3D3Bnbsp=3D3D3B&=3D3Bnbsp=3D3=
>D3B&=3D3Bnbsp=3D3D3B displayAddr: IP.Address=3D3D3B&l=3D> >t=3D3BB=3D3D<=
>BR>>=3D3B >=3D3BR>=3D3B&=3D3Bnbsp=3D3D3B BEGIN<=3D3BBR>=3D3B&a=
>mp=3D3B=3D> >nbsp=3D3D3B&=3D3Bnbsp=3D3D3B&=3D3Bnbsp=3D3D3B IF display=
> =3D3D3D NIL THEN RETURN=3D> >=3D3D<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ts?<=3D3BBR>=3D3B<BR>>=3D3B >=
>=3D3B&=3D3Bnbsp=3D3D3=3D> >B<=3D3BBR>=3D3B<BR>>=3D3B >=3D3B<=
>=3D3BBR>=3D3BPerhaps my network isn't setu=3D> >p well=3D3D2C like I shou=
>ld add the local mach=3D3D<BR>>=3D3B >=3D3Bine to /etc=3D> >/hosts.<=
>=3D3BBR>=3D3BI think this can be made to fail gracefully though.<=3D> >=
>=3D3BB=3D3D<BR>>=3D3B >=3D3BR>=3D3BIt seems like it has nothing to do=
> with AMD6=3D> >4_FREEBSD=3D3D2C but could have t=3D3D<BR>>=3D3B >=3D3B=
>o do with FreeBSD.<=3D3B=3D> >BR>=3D3B<BR>>=3D3B >=3D3B<=3D3BBR&g=
>t=3D3B&=3D3Bnbsp=3D3D3B<=3D3BBR>=3D3B<BR>&g=3D> >t=3D3B >=3D3BSeem=
>s like SocketPosix has nearly the exact same code but appear=3D> >s<=3D3B=
>BR>=3D3Bmore f=3D3D<BR>>=3D3B >=3D3Borgiving.. IOError instead of Fat=
>a=3D> >l?<=3D3BBR>=3D3B<BR>>=3D3B >=3D3B&=3D3Bnbsp=3D3D3B<=3D3=
>BBR>=3D3B<BR>>=3D3B &=3D> >gt=3D3B<=3D3BBR>=3D3BSocketPosix.m3:<=
>=3D3BBR>=3D3B<BR>>=3D3B >=3D3B&=3D3Bnbs=3D> >p=3D3D3B<=3D3BBR>=
>=3D3B<BR>>=3D3B >=3D3B<=3D3BBR>=3D3BPROCEDURE GetHostAddr ()=3D> >:=
> Address<=3D3BBR>=3D3B&=3D3Bnbsp=3D3D3B RAISES {OSError.E} =3D3D3D&l=
>t=3D3BBR=3D3D=3D> ><BR>>=3D3B >=3D3B>=3D3B&=3D3Bnbsp=3D3D3B VAR<=
>=3D3BBR>=3D3B&=3D3Bnbsp=3D3D3B&a=3D> >mp=3D3Bnbsp=3D3D3B&=3D3Bnbsp=
>=3D3D3B host : ARRAY [0..255] OF CHAR=3D3D3B<=3D3B=3D3D<=3D> >BR>>=3D3B=
> >=3D3BBR>=3D3B&=3D3Bnbsp=3D3D3B&=3D3Bnbsp=3D3D3B&=3D3Bnbsp=3D=
>3D3B in=3D> >fo : Unetdb.struct_hostent_star=3D3D3B<=3D3BBR>=3D3B&=
>=3D3Bnbsp=3D3D<BR>>=3D3B =3D> >>=3D3B=3D3D3B&=3D3Bnbsp=3D3D3B&=3D=
>3Bnbsp=3D3D3B ua&=3D3Bnbsp=3D3D3B&=3D3Bnbsp=3D> >=3D3D3B : Uin.struct=
>_in_addr=3D3D3B<=3D3BBR>=3D3B&=3D3Bnbsp=3D3D3B =3D3D<BR>>=3D3B=3D>=
> > >=3D3BBEGIN<=3D3BBR>=3D3B&=3D3Bnbsp=3D3D3B&=3D3Bnbsp=3D3D3B&=
>amp=3D3Bnbsp=3D3D3B =3D> >IF Unix.gethostname (ADR (host[0])=3D3D2C BYT=3D3=
>D<BR>>=3D3B >=3D3BESIZE (host)=3D> >) # 0 THEN<=3D3BBR>=3D3B&=3D=
>3Bnbsp=3D3D3B&=3D3Bnbsp=3D3D3B&=3D3Bnbsp=3D3D3B&am=3D> >p=3D3Bnbsp=3D=
>3D3B&=3D3Bnbsp=3D3D3B IOError =3D3D<BR>>=3D3B >=3D3B(Unexpected)=3D3=
>D3B=3D> ><=3D3BBR>=3D3B&=3D3Bnbsp=3D3D3B&=3D3Bnbsp=3D3D3B&=3D3=
>Bnbsp=3D3D3B END=3D3D3B<=3D> >=3D3BBR>=3D3B<BR>>=3D3B >=3D3B&=3D=
>3Bnbsp=3D3D3B&=3D3Bnbsp=3D3D3B&=3D3Bnbsp=3D3D3=3D> >B info :=3D3D3D U=
>netdb.gethostbyname (ADR (host[0]))=3D3D3B<=3D3B=3D3D<BR>>=3D3B =3D> >&=
>gt=3D3BBR>=3D3B&=3D3Bnbsp=3D3D3B&=3D3Bnbsp=3D3D3B&=3D3Bnbsp=3D3D=
>3B IF info =3D3D3=3D> >D NIL THEN IOError (Unexpected)=3D3D3B EN=3D3D<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END GetHostAddr=3D3D3B<=3D3BBR>=3D3=
>B<BR>&=3D> >gt=3D3B >=3D3B&=3D3Bnbsp=3D3D3B<=3D3BBR>=3D3B<BR>>=
>=3D3B >=3D3B&=3D3Bnbsp=3D3D3B=3D> ><=3D3BBR>=3D3B<BR>>=3D3B >=
>=3D3BIt is again disappointing to see such code d=3D> >uplication.<=3D3BB=
>R>=3D3B<BR>>=3D3B >=3D3B&=3D3Bnbsp=3D3D3B<=3D3BBR>=3D3B<BR=3D>=
> >>>=3D3B >=3D3B&=3D3Bnbsp=3D3D3B<=3D3BBR>=3D3B<BR>>=3D3B >=
>=3D3BI guess&=3D3B=3D> >nbsp=3D3D3BSameHost can duplicate the logic to p=
>redict the error state =3D3D<BR=3D> >>>=3D3B >=3D3Band return false&=
>=3D3Bnbsp=3D3D3Bupon error?<=3D3BBR>=3D3B<BR>=3D> >>=3D3B >=3D3BDup=
>licating the logic for a third time. :(<=3D3BBR>=3D3B<BR>&g=3D> >t=3D3B=
> >=3D3B&=3D3Bnbsp=3D3D3B<=3D3BBR>=3D3B<BR>>=3D3B >=3D3B<=3D3=
>BBR>=3D3B&am=3D> >p=3D3Bnbsp=3D3D3B- Jay<=3D3BBR>=3D3B<=3D3BBR>=
>=3D3B<=3D3B/body>=3D3B<BR>>=3D3B &=3D> >gt=3D3B<=3D3B/html>=3D3B=
>=3D3D<BR>>=3D3B >=3D3B<BR>>=3D3B >=3D3B--_9e67232c-a064=3D> >-417d-=
>879e-227a77e310f9_--<BR><BR></body>> ></html>=3D> >> >--_b00371fe-730b-4981=
>-9051-a874361296d7_--=
>
>--_b0c10337-0e1c-414e-aae5-e611dcd4be8a_
>Content-Type: text/html; charset="iso-8859-1"
>Content-Transfer-Encoding: quoted-printable
>
><html>
><head>
><style>
>.hmmessage P
>{
>margin:0px=3B
>padding:0px
>}
>body.hmmessage
>{
>font-size: 10pt=3B
>font-family:Verdana
>}
></style>
></head>
><body class=3D'hmmessage'>
>PPC_LINUX not PPC_DARWIN.<BR>
>I think.<BR>
>And at one point AMD64_LINUX (same machine as AMD64_FREEBSD=2C multiboot).<=
>BR>I think I tested I386_OPENBSD Juno too and it worked=2C<BR>I don't remem=
>ber. Oh=2C but that was in a VM=2C so different networking setup.<BR>
><BR>This is Trestle startup=2C seeing if there might<BR>be shared memory av=
>ailable between the X client and server.<BR>
><BR>If $DISPLAY is set=2C to specify the server=2C it wants to compare<BR>t=
>hat against "current"=2C the client.<BR>You know=2C if I set DISPLAY=3D:0.0=
> or localhost:0.0=2C don't penalize perf=2C<BR>but if it really is remote=
>=2C then do penalize perf.<BR>
><BR>/Something/ like that.<BR>
>I hardly read the code..<BR>
><BR> =3B- Jay<BR><BR>>=3B To: jay.krell at cornell.edu<BR>>=3B Date: M=
>on=2C 12 Jan 2009 01:06:30 -0800<BR>>=3B From: mika at async.caltech.edu<BR>=
>>=3B CC: m3devel at elegosoft.com<BR>>=3B Subject: Re: [M3devel] Juno (X) =
>networking problem on AMD64_FREEBSD<BR>>=3B <BR>>=3B Jay=2C<BR>>=3B <=
>BR>>=3B I think the problem here is actually in the caller. Why does a<BR=
>>>=3B caller need "GetHostAddr()"? It is probably doing this for the<BR>&=
>gt=3B purpose of calling listen() or some such thing. What the caller<BR>&g=
>t=3B probably *really* wants is INADDR_ANY=2C and not the IP address of<BR>=
>>=3B some arbitrarily chosen interface on the host.<BR>>=3B <BR>>=3B =
>I'm guessing it works on the Mac because the Mac libraries do<BR>>=3B som=
>ething complicated when you ask for the host's name (i.e.=2C they<BR>>=3B=
> somehow generate a hostname that always maps to the IP address of<BR>>=
>=3B an interface on the computer).<BR>>=3B <BR>>=3B Mika<BR>>=3B <BR>=
>>=3B Jay writes:<BR>>=3B >=3B--_b00371fe-730b-4981-9051-a874361296d7_=
><BR>>=3B >=3BContent-Type: text/plain=3B charset=3D"iso-8859-1"<BR>>=
>=3B >=3BContent-Transfer-Encoding: quoted-printable<BR>>=3B >=3B<BR>&=
>gt=3B >=3B<BR>>=3B >=3BDo you know the right way?<BR>>=3B >=3B=3D=
>20<BR>>=3B >=3BPPC_LINUX "just worked"=3D2C and I can check Solaris and=
> Darwin.<BR>>=3B >=3B=3D20<BR>>=3B >=3BI don't want to edit /etc/ho=
>sts -- I use DHCP.<BR>>=3B >=3BThough DHCP has been bothering me -- onl=
>y for some of my machines do names =3D<BR>>=3B >=3Bresolve=3D2C so I en=
>d using IP addresses=3D2C which change sometimes=3D2C and I l=3D<BR>>=3B =
>>=3Boop over them running ssh to all of them and "see what I get"=3D2C no=
>t ideal.<BR>>=3B >=3B=3D20<BR>>=3B >=3B - Jay>=3B To: jay.krell at c=
>ornell.edu>=3B Date: Sun=3D2C 11 Jan 2009 08:02:18 -0800>=3B=3D<BR>>=
>=3B >=3B From: mika at async.caltech.edu>=3B CC: m3devel at elegosoft.com>=
>=3B Subject: Re: [M3d=3D<BR>>=3B >=3Bevel] Juno (X) networking problem =
>on AMD64_FREEBSD>=3B >=3B This is a screwy thin=3D<BR>>=3B >=3Bg in=
> Modula-3. A bug I would call it.>=3B >=3B I've noticed a lot of networ=
>king M=3D<BR>>=3B >=3B3 programs don't work right unless>=3B the retu=
>rn value of Unix's "hostname" m=3D<BR>>=3B >=3Baps to a real IP address=
> via>=3B gethostbyname. I accomplish it in practice by=3D<BR>>=3B >=
>=3B adding my hostname>=3B to /etc/hosts.>=3B >=3B This is obviously =
>not the right way =3D<BR>>=3B >=3Bto fix it... >=3B >=3B Mika>=3B=
> >=3B Jay writes:>=3B >=3B--_9e67232c-a064-417d-879e-227a77e31=3D<BR>=
>>=3B >=3B0f9_>=3B >=3BContent-Type: text/plain=3D3B charset=3D3D"is=
>o-8859-1">=3B >=3BContent-Transfe=3D<BR>>=3B >=3Br-Encoding: quoted=
>-printable>=3B >=3B>=3B >=3B>=3B >=3BHi. Unix network programmi=
>ng question.=3D<BR>>=3B >=3B.>=3B >=3BAMD64_FREEBSD:>=3B >=3B$D=
>ISPLAY is set to point back to Cygwin host.It works =3D<BR>>=3B >=3Bfor=
> PPC_LINUX.>=3B >=3B[jay at fbsdamd64a /cm3/bin]$ ./Juno>=3B >=3B*****=
>* runtime error:*=3D<BR>>=3B >=3B** Exception "IPError.FatalError" not =
>in RAISES li=3D3D>=3B >=3Bst*** file "../src/=3D<BR>>=3B >=3Bcommon=
>/IPError.m3"=3D3D2C line 27***>=3B >=3BAbort trap: 6 (core dumped)[jay@=
>fbsdam=3D<BR>>=3B >=3Bd64a /cm3/bin]$>=3B >=3BIP.m3:>=3B >=3B=
>=3D3D20>=3B >=3BPROCEDURE GetHostAddr(): Address =3D3D3D V=3D<BR>>=3B=
> >=3BAR hname: ARRAY [0..255] OF CHAR=3D3D3B =3D3D>=3B >=3B BEGIN LOC=
>K mu DO IF Unix.getho=3D<BR>>=3B >=3Bstname(ADR(hname[0])=3D3D2C BYTESI=
>ZE(hna=3D3D>=3B >=3Bme)) # 0 THEN IPError.Die ()=3D3D=3D<BR>>=3B >=
>=3B3B END=3D3D3B VAR h :=3D3D3D Unetdb.g=3D3D>=3B >=3Bethostbyname(ADR(=
>hname[0]))=3D3D3B BEG=3D<BR>>=3B >=3BIN IF h =3D3D3D NIL THEN IPError.D=
>ie()=3D3D>=3B >=3B=3D3D3B END=3D3D3B RETURN GetAddress(=3D<BR>>=3B &g=
>t=3Bh)=3D3D3B END=3D3D3B END=3D3D3B END GetHos=3D3D>=3B >=3BtAddr=3D3D3=
>B>=3B >=3BPROCEDURE GetAddress=3D<BR>>=3B >=3B (ent: Unetdb.struct_=
>hostent_star): Address =3D3D3D VAR ua=3D3D>=3B >=3B: Uin.struct_=3D<BR>=
>>=3B >=3Bin_addr=3D3D3B BEGIN <=3B* ASSERT ent.h_length <=3B=3D3D3D=
> BYTESIZE(Addr=3D3D>=3B >=3Bess) *>=3B=3D<BR>>=3B >=3B ua :=3D3D3=
>D LOOPHOLE(ent.h_addr_list=3D3D2C UNTRACED =3D3D>=3B >=3BREF UNTRACED R=
>EF Ui=3D<BR>>=3B >=3Bn.struct_in_addr)^^=3D3D3B RETURN LOOPHOLE(ua.s_ad=
>dr=3D3D2C A=3D3D>=3B >=3Bddress)=3D3D3B=3D<BR>>=3B >=3B END GetAddr=
>ess=3D3D3B>=3B >=3B=3D3D20>=3B >=3Bgethostbyname is failing.>=3B =
>>=3B=3D3D20>=3B >=3BAnalogou=3D<BR>>=3B >=3Bs C code also fails:&=
>gt=3B >=3B=3D3D20>=3B >=3B[jay at fbsdamd64a /cm3/bin]$ cat ~/5.c#includ=
>e=3D<BR>>=3B >=3B <=3Bassert.h>=3B#include <=3Bnetdb.h>=3B#i=3D=
>3D>=3B >=3Bnclude <=3Bstdio.h>=3B#include <=3Berrno.h>=3Btype=
>=3D<BR>>=3B >=3Bdef struct hostent hostent_t=3D3D3B>=3B >=3B=3D3D20=
>>=3B >=3Bint main(){ char hostname[200]=3D<BR>>=3B >=3B=3D3D3B host=
>ent_t* h=3D3D3B int i=3D3D3B>=3B >=3B i =3D3D3D gethostname(hostname=3D=
>3D2C 200=3D<BR>>=3B >=3B)=3D3D3B assert(i =3D3D3D=3D3D3D 0)=3D3D3B prin=
>tf("hostna=3D3D>=3B >=3Bme: %s\n"=3D3D2C hostn=3D<BR>>=3B >=3Bame)=
>=3D3D3B h =3D3D3D gethostbyname(hostname)=3D3D3B herror("foo")=3D3D3B=3D3D&=
>gt=3B >=3B pri=3D<BR>>=3B >=3Bntf("%p %d %d\n"=3D3D2C h=3D3D2C errno=
>=3D3D2C h_errno)=3D3D3B assert(h)=3D3D3B return=3D<BR>>=3B >=3B 0=3D3D3=
>B}>=3B >=3B=3D3D20>=3B >=3Bherror says "unknown host".>=3B >=3B=
>Stack is:>=3B >=3B at ../src/run=3D<BR>>=3B >=3Btime/ex_frame/RTExF=
>rame.m3:58#13 0x0000000801a7f2b3 in RTH=3D3D>=3B >=3Books__Raise=3D<BR>=
>>=3B >=3B (M3_AJWxb1_ex=3D3D3DError accessing memory address 0x8000ffff=
>d278: =3D3D>=3B >=3BBad=3D<BR>>=3B >=3B address.) at ../src/runtime=
>/common/RTHooks.m3:79#14 0x000000080169c8=3D3D>=3B >=3B=3D<BR>>=3B &g=
>t=3Bd3 in IPError__Die () at ../src/common/IPError.m3:27#15 0x0000000801698=
>a3e =3D<BR>>=3B >=3B=3D3D>=3B >=3Bin IP__GetHostAddr (M3_BCxjPn__re=
>sult=3D3D3DError accessing memory addr=3D<BR>>=3B >=3Bess 0x80=3D3D>=
>=3B >=3B00ffffd338: Bad address.) at ../src/POSIX/IP.m3:82#16 0x00000=3D<=
>BR>>=3B >=3B008012133d0=3D3D>=3B >=3B in XSharedMem__SameHost (M3_A=
>Quuui_trsl=3D3D3DError accessi=3D<BR>>=3B >=3Bng memory address 0=3D3D&=
>gt=3B >=3Bx8000ffffd4d8: Bad address.) at ../src/xvbt/XShare=3D<BR>>=3B=
> >=3BdMem.m3:96#17 0x000000=3D3D>=3B >=3B0801212ab7 in XSharedMem__In=
>itXClient (M3_AQuuu=3D<BR>>=3B >=3Bi_v=3D3D3DError accessing memory=3D3=
>D>=3B >=3B address 0x8000ffffd648: Bad address.) =3D<BR>>=3B >=3Bat=
> ../src/xvbt/XSharedMem.m3:29#1=3D3D>=3B >=3B8 0x0000000801211819 in XE=
>xtensions_=3D<BR>>=3B >=3B_InitXClient (M3_AQuuui_xclient=3D3D3DError=
>=3D3D>=3B >=3B accessing memory address 0x=3D<BR>>=3B >=3B8000ffffd=
>7f8: Bad address.) at ../src/xvbt/X=3D3D>=3B >=3BExtensions.m3:14#19 0x=
>000=3D<BR>>=3B >=3B00008012467a4 in XClientF__Connect (M3_Bd56fi_inst=
>=3D3D>=3B >=3B=3D3D3D0x1879b=3D3D2C M=3D<BR>>=3B >=3B3_AQuuui_trsl=
>=3D3D3D0x6) at ../src/xvbt/XClientF.m3:583---Typ=3D3D>=3B >=3Be <=3Br=
>eturn>=3B=3D<BR>>=3B >=3B to continue=3D3D2C or q <=3Breturn>=3B =
>to quit---(More stack frames follow=3D3D>=3B >=3B..=3D<BR>>=3B >=3B=
>.)(gdb)>=3B >=3B(* return TRUE if server and client are on same host *)=
>PROCEDURE =3D<BR>>=3B >=3BSameHost (=3D3D>=3B >=3Btrsl: XClient.T):=
> BOOLEAN =3D3D3D VAR display :=3D3D3D DisplayH=3D<BR>>=3B >=3B=3D3D>=
>=3B >=3Bost(trsl)=3D3D3B displayAddr: IP.Address=3D3D3B BEGIN IF display =
>=3D3D3D NI=3D<BR>>=3B >=3BL THE=3D3D>=3B >=3BN RETURN TRUE=3D3D3B E=
>ND=3D3D3B>=3B >=3B TRY IF NOT IP.GetHostByName(displ=3D<BR>>=3B >=
>=3Bay=3D3D2C displayAddr) THEN RETURN FA=3D3D>=3B >=3BLSE=3D3D3B END=3D=
>3D3B RETURN displayAd=3D<BR>>=3B >=3Bdr =3D3D3D IP.GetHostAddr()=3D3D3B=
> EXCEPT =3D3D>=3B >=3B| IP.Error =3D3D3D>=3B RETURN FALSE=3D<BR>>=
>=3B >=3B=3D3D3B END=3D3D3B END SameHost=3D3D3B>=3B >=3B=3D3D20>=3B =
>>=3BThoughts?>=3B >=3B=3D3D20>=3B >=3BPerhaps my n=3D<BR>>=3B &=
>gt=3Betwork isn't setup well=3D3D2C like I should add the local machine =3D=
>3D>=3B >=3Bto /=3D<BR>>=3B >=3Betc/hosts.I think this can be made t=
>o fail gracefully though.It seems l=3D3D>=3B=3D<BR>>=3B >=3B >=3Bik=
>e it has nothing to do with AMD64_FREEBSD=3D3D2C but could have to do wit=
>=3D<BR>>=3B >=3Bh Fr=3D3D>=3B >=3BeeBSD.>=3B >=3B=3D3D20>=3B =
>>=3BSeems like SocketPosix has nearly the exact same=3D<BR>>=3B >=3B =
>code but appearsmore forgi=3D3D>=3B >=3Bving.. IOError instead of Fatal=
>?>=3B >=3B=3D3D20>=3B =3D<BR>>=3B >=3B>=3BSocketPosix.m3:>=3B=
> >=3B=3D3D20>=3B >=3BPROCEDURE GetHostAddr (): Address RAISES {OSErro=
>=3D<BR>>=3B >=3Br.E} =3D3D3D VAR host : AR=3D3D>=3B >=3BRAY [0..255=
>] OF CHAR=3D3D3B info : Unetdb.struc=3D<BR>>=3B >=3Bt_hostent_star=3D3D=
>3B ua : U=3D3D>=3B >=3Bin.struct_in_addr=3D3D3B BEGIN IF Unix.gethos=3D=
><BR>>=3B >=3Btname (ADR (host[0])=3D3D2C BYTESI=3D3D>=3B >=3BZE (ho=
>st)) # 0 THEN IOError (Unexpect=3D<BR>>=3B >=3Bed)=3D3D3B END=3D3D3B>=
>=3B >=3B info :=3D3D3D Unetdb.gethostbyname (ADR (host[0]))=3D3D3B =3D<BR=
>>>=3B >=3BIF info =3D3D3D NIL TH=3D3D>=3B >=3BEN IOError (Unexpecte=
>d)=3D3D3B END=3D3D3B <=3B* ASSERT i=3D<BR>>=3B >=3Bnfo.h_length <=
>=3B=3D3D3D BYTESIZE =3D3D>=3B >=3B(Address) *>=3B>=3B >=3B ua :=
>=3D3D3D LOOPHOLE(info.=3D<BR>>=3B >=3Bh_addr_list=3D3D2C UNTRACED REF U=
>NT=3D3D>=3B >=3BRACED REF Uin.struct_in_addr)^^=3D3D3B=3D<BR>>=3B >=
>=3B RETURN LOOPHOLE (ua.s_addr=3D3D2C Address=3D3D>=3B >=3B)=3D3D3B END=
> GetHostAddr=3D3D3B>=3B =3D<BR>>=3B >=3B>=3B=3D3D20>=3B >=3B=3D=
>3D20>=3B >=3BIt is again disappointing to see such code duplication.>=
>=3B >=3B=3D<BR>>=3B >=3B=3D3D20>=3B >=3B=3D3D20>=3B >=3BI gue=
>ss SameHost can duplicate the logic to predict the err=3D<BR>>=3B >=3Bo=
>r state and ret=3D3D>=3B >=3Burn false upon error?>=3B >=3BDuplicat=
>ing the logic for a t=3D<BR>>=3B >=3Bhird time. :(>=3B >=3B=3D3D20&=
>gt=3B >=3B - Jay=3D3D>=3B >=3B>=3B >=3B--_9e67232c-a064-417d-879e=
>-227a77e31=3D<BR>>=3B >=3B0f9_>=3B >=3BContent-Type: text/html=3D3B=
> charset=3D3D"iso-8859-1">=3B >=3BContent-Transfer=3D<BR>>=3B >=3B-=
>Encoding: quoted-printable>=3B >=3B>=3B >=3B<=3Bhtml>=3B>=3B =
>>=3B<=3Bhead>=3B>=3B >=3B<=3Bstyle>=3B>=3B >=3B.hmmessage=
> P>=3B =3D<BR>>=3B >=3B>=3B{>=3B >=3Bmargin:0px=3D3D3B>=3B &g=
>t=3Bpadding:0px>=3B >=3B}>=3B >=3Bbody.hmmessage>=3B >=3B{>=
>=3B >=3Bfont-size: 10=3D<BR>>=3B >=3Bpt=3D3D3B>=3B >=3Bfont-famil=
>y:Verdana>=3B >=3B}>=3B >=3B<=3B/style>=3B>=3B >=3B<=3B/h=
>ead>=3B>=3B >=3B<=3Bbody class=3D3D3D'h=3D<BR>>=3B >=3Bmmessage=
>'>=3B>=3B >=3BHi. Unix network programming question..<=3BBR>=3B&g=
>t=3B >=3B<=3BBR>=3BAMD64_FREEBS=3D<BR>>=3B >=3BD:<=3BBR>=3B&g=
>t=3B >=3B<=3BBR>=3B$DISPLAY is set to point back to Cygwin host.<=
>=3BBR>=3BIt works for =3D<BR>>=3B >=3BPPC_LINUX=3D3D>=3B >=3B.<=
>=3BBR>=3B>=3B >=3B<=3BBR>=3B[jay at fbsdamd64a /cm3/bin]$ ./Juno<=
>=3BBR>=3B>=3B >=3B<=3BBR>=3B***<=3B=3D<BR>>=3B >=3BBR>=3B=
>*** runtime error:<=3BBR>=3B***&=3Bnbsp=3D3D3B&=3Bnbsp=3D3D3B&=
>=3Bnbsp=3D3D3B Exception "IPE=3D<BR>>=3B >=3B=3D3D>=3B >=3Brror.Fat=
>alError" not in RAISES list<=3BBR>=3B***&=3Bnbsp=3D3D3B&=3Bnbsp=
>=3D3D3B&=3Bnbsp=3D<BR>>=3B >=3B=3D3D3B file "..=3D3D>=3B >=3B/sr=
>c/common/IPError.m3"=3D3D2C line 27<=3BBR>=3B***<=3BBR>=3B>=3B &g=
>t=3B<=3BBR>=3BA=3D<BR>>=3B >=3Bbort trap: 6 (core dumped)<=3BBR&g=
>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C code also fails:<=3BBR>=3B>=3B >=3B&=
>=3Bnbsp=3D3D3B<=3BBR>=3B>=3B >=3B<=3BBR>=3B[jay at fbsdamd=3D<BR>&=
>gt=3B >=3B64a /cm3/bin]$ cat ~/5.c<=3BBR>=3B#include &=3Blt=3D3D3B=
>assert.h&=3Bgt=3D3D3B<=3BB=3D3D>=3B >=3BR>=3B#inc=3D<BR>>=3B &=
>gt=3Blude &=3Blt=3D3D3Bnetdb.h&=3Bgt=3D3D3B<=3BBR>=3B#include &am=
>p=3Blt=3D3D3Bstdio.h&=3Bgt=3D3D3B<=3BBR>=3B#includ=3D<BR>>=3B >=
>=3Be =3D3D>=3B >=3B&=3Blt=3D3D3Berrno.h&=3Bgt=3D3D3B<=3BBR>=
>=3Btypedef struct hostent hostent_t=3D3D3B<=3BBR=3D<BR>>=3B >=3B>=
>=3B>=3B >=3B&=3Bnbsp=3D3D3B<=3BBR>=3B>=3B >=3Bint main()<=
>=3BBR>=3B{<=3BBR>=3B&=3Bnbsp=3D3D3Bchar hostname[200]=3D3D3B<=3B=
>B=3D<BR>>=3B >=3BR>=3B&=3Bnbsp=3D3D3Bhostent_t* h=3D3D3B=3D3D>=
>=3B >=3B<=3BBR>=3B&=3Bnbsp=3D3D3Bint i=3D3D3B<=3BBR>=3B>=3B =
>>=3B&=3Bnbsp=3D3D3=3D<BR>>=3B >=3BBi =3D3D3D gethostname(hostname=
>=3D3D2C 200)=3D3D3B<=3BBR>=3B&=3Bnbsp=3D3D3Bassert(i =3D3D3D=3D3D=3D=
><BR>>=3B >=3B3D 0)=3D3D>=3B >=3B=3D3D3B<=3BBR>=3B&=3Bnbsp=3D=
>3D3Bprintf("hostname: %s\n"=3D3D2C hostname)=3D3D3B<=3BB=3D<BR>>=3B >=
>=3BR>=3B&=3Bnbsp=3D3D3Bh =3D3D3D get=3D3D>=3B >=3Bhostbyname(hostn=
>ame)=3D3D3B<=3BBR>=3B&=3Bnbsp=3D3D3Bherror(=3D<BR>>=3B >=3B"foo"=
>)=3D3D3B<=3BBR>=3B&=3Bnbsp=3D3D3Bprintf("%p %=3D3D>=3B >=3Bd %d\=
>n"=3D3D2C h=3D3D2C errno=3D3D2C h=3D<BR>>=3B >=3B_errno)=3D3D3B<=3BBR=
>>=3B&=3Bnbsp=3D3D3Bassert(h)=3D3D3B<=3BBR>=3B&=3Bnbsp=3D3D3Bret=
>=3D3D>=3B >=3Burn 0=3D3D3B<=3BB=3D<BR>>=3B >=3BR>=3B}<=3BBR&g=
>t=3B>=3B >=3B&=3Bnbsp=3D3D3B<=3BBR>=3B>=3B >=3Bherror says "=
>unknown host".<=3BBR>=3B>=3B >=3B<=3BBR>=3BStack is:<=3B=3D<B=
>R>>=3B >=3BBR>=3B>=3B >=3B&=3Bnbsp=3D3D3B&=3Bnbsp=3D3D3B&am=
>p=3Bnbsp=3D3D3B at ../src/runtime/ex_frame/RTExFrame.m=3D<BR>>=3B >=3B3=
>:58<=3BBR>=3B#13 =3D3D>=3B >=3B0x0000000801a7f2b3 in RTHooks__Raise=
> (M3_AJWxb1_ex=3D3D3DEr=3D<BR>>=3B >=3Bror accessing memory=3D3D>=3B =
>>=3B ad<=3BBR>=3Bdress 0x8000ffffd278: Bad address.<=3BBR>=3B)<=
>=3BBR=3D<BR>>=3B >=3B>=3B&=3Bnbsp=3D3D3B&=3Bnbsp=3D3D3B&=3Bn=
>bsp=3D3D3B =3D3D>=3B >=3Bat ../src/runtime/common/RTHooks.m3:7=3D<BR>&g=
>t=3B >=3B9<=3BBR>=3B#14 0x000000080169c8d3 in IPError=3D3D>=3B >=
>=3B__Die () at ../src/common/IPErr=3D<BR>>=3B >=3Bor.m3:27<=3BBR>=
>=3B#15 0x0000000801698a3e in IP__Ge=3D3D>=3B >=3BtHostAddr (M3_BCxjPn__=
>res=3D<BR>>=3B ult=3D3D3DError accessing mem<=3BBR>=3Bory address 0x8=
>000fff=3D3D>=3B >=3Bfd338: Bad addres=3D<BR>>=3B >=3Bs.<=3BBR>=
>=3B)<=3BBR>=3B&=3Bnbsp=3D3D3B&=3Bnbsp=3D3D3B&=3Bnbsp=3D3D3B at=
> ../src/POSIX/IP.m3:=3D3D>=3B >=3B82<=3BBR=3D<BR>>=3B >=3B>=3B#=
>16 0x00000008012133d0 in XSharedMem__SameHost (M3_AQuuui_trsl=3D3D3DErro=3D=
>3D=3D<BR>>=3B >=3B>=3B >=3Br accessing m<=3BBR>=3Bemory address=
> 0x8000ffffd4d8: Bad address.<=3BBR>=3B)<=3BBR>=3B&=3Bnbs=3D<BR>=
>>=3B >=3Bp=3D3D>=3B >=3B=3D3D3B&=3Bnbsp=3D3D3B&=3Bnbsp=3D3D3B=
> at ../src/xvbt/XSharedMem.m3:96<=3BBR>=3B#17 0x0=3D<BR>>=3B >=3B00=
>0000801212a=3D3D>=3B >=3Bb7 in XSharedMem__InitXClient (M3_AQuuui_v=3D3=
>D3DError acc=3D<BR>>=3B >=3Bessing m<=3BBR>=3Bemory add=3D3D>=3B =
>>=3Bress 0x8000ffffd648: Bad address.<=3BBR>=3B)<=3BBR>=3B&=3B=
>nbsp=3D<BR>>=3B >=3B=3D3D3B&=3Bnbsp=3D3D3B&=3Bnbsp=3D3D3B at ../s=
>r=3D3D>=3B >=3Bc/xvbt/XSharedMem.m3:29<=3BBR>=3B#18 0x00=3D<BR>>=
>=3B >=3B00000801211819 in XExtensions__InitXClie=3D3D>=3B >=3Bnt (M3_=
>AQuuui_xclient=3D3D3DErr=3D<BR>>=3B >=3Bor acce<=3BBR>=3Bssing memo=
>ry address 0x8000ffffd7f8: =3D3D>=3B >=3BBad address.<=3BBR>=3B)<=
>=3BBR>=3B=3D<BR>>=3B >=3B&=3Bnbsp=3D3D3B&=3Bnbsp=3D3D3B&=3Bn=
>bsp=3D3D3B at ../src/xvbt/XExtensions.m3=3D3D>=3B >=3B:14<=3BBR>=3B=
>#1=3D<BR>>=3B >=3B9 0x00000008012467a4 in XClientF__Connect (M3_Bd56fi_=
>inst=3D3D3D0x1879=3D3D>=3B >=3Bb=3D<BR>>=3B >=3B=3D3D2C<=3BBR>=
>=3B&=3Bnbsp=3D3D3B&=3Bnbsp=3D3D3B&=3Bnbsp=3D3D3B M3_AQuuui_trsl=3D=
>3D3D0x6) at ../src/x=3D<BR>>=3B >=3Bvbt/XClie=3D3D>=3B >=3BntF.m3:5=
>83<=3BBR>=3B---Type &=3Blt=3D3D3Breturn&=3Bgt=3D3D3B to continue=
>=3D3D2=3D<BR>>=3B >=3BC or q &=3Blt=3D3D3Breturn&=3Bg=3D3D>=3B =
>>=3Bt=3D3D3B to quit---<=3BBR>=3B(More stack frames follow=3D<BR>>=
>=3B >=3B...)<=3BBR>=3B(gdb)<=3BBR>=3B>=3B >=3B<=3BBR>=3B(=
>* return TRUE if server and client are on same hos=3D<BR>>=3B >=3Bt *)&=
>lt=3BBR>=3BPROCEDURE Sa=3D3D>=3B >=3BmeHost (trsl: XClient.T): BOOLEA=
>N =3D3D3D<=3BBR>=3B&=3Bnbsp=3D<BR>>=3B >=3B=3D3D3B VAR<=3BBR&g=
>t=3B&=3Bnbsp=3D3D3B&=3Bnbsp=3D3D3B&=3Bn=3D3D>=3B >=3Bbsp=3D3D3=
>B display&=3Bnbsp=3D3D3B&=3Bnbsp=3D3D=3D<BR>>=3B >=3B3B&=3Bnbs=
>p=3D3D3B&=3Bnbsp=3D3D3B&=3Bnbsp=3D3D3B&=3Bnbsp=3D3D3B&=3Bnbsp=
>=3D3D3B&=3Bnbsp=3D3D>=3B >=3B=3D3D3B&=3Bnbsp=3D<BR>>=3B >=3B=
>=3D3D3B&=3Bnbsp=3D3D3B&=3Bnbsp=3D3D3B&=3Bnbsp=3D3D3B&=3Bnbsp=3D=
>3D3B&=3Bnbsp=3D3D3B&=3Bnbsp=3D3D3B&=3Bnbsp=3D3D3B=3D<BR>>=3B :=
>=3D3D3D Di=3D3D>=3B >=3BsplayHost(trsl)=3D3D3B<=3BBR>=3B&=3Bnbsp=
>=3D3D3B&=3Bnbsp=3D3D3B&=3Bnbsp=3D3D3B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=3D3D3B<=3BBR>=3B>=3B >=3B&=3B=
>nbsp=3D3D3B<=3BBR>=3B>=3B >=3BThoughts=3D<BR>>=3B >=3B?<=3BBR=
>>=3B>=3B >=3B&=3Bnbsp=3D3D3B<=3BBR>=3B>=3B >=3B<=3BBR>=
>=3BPerhaps my network isn't setup well=3D3D2C like =3D<BR>>=3B >=3BI sh=
>ould add the local mach=3D3D>=3B >=3Bine to /etc/hosts.<=3BBR>=3BI =
>think this can be =3D<BR>>=3B >=3Bmade to fail gracefully though.<=3B=
>B=3D3D>=3B >=3BR>=3BIt seems like it has nothing to do=3D<BR>>=3B &=
>gt=3B with AMD64_FREEBSD=3D3D2C but could have t=3D3D>=3B >=3Bo do with=
> FreeBSD.<=3BBR>=3B>=3B >=3B<=3BBR=3D<BR>>=3B >=3B>=3B&=
>=3Bnbsp=3D3D3B<=3BBR>=3B>=3B >=3BSeems like SocketPosix has nearly =
>the exact same code but=3D<BR>>=3B >=3B appears<=3BBR>=3Bmore f=3D3=
>D>=3B >=3Borgiving.. IOError instead of Fatal?<=3BBR>=3B>=3B >=
>=3B&=3Bnbsp=3D3D=3D<BR>>=3B >=3B3B<=3BBR>=3B>=3B >=3B<=3BB=
>R>=3BSocketPosix.m3:<=3BBR>=3B>=3B >=3B&=3Bnbsp=3D3D3B<=3BBR=
>>=3B>=3B >=3B<=3BBR>=3BPROCEDURE GetHostAd=3D<BR>>=3B >=3Bdr =
>(): Address<=3BBR>=3B&=3Bnbsp=3D3D3B RAISES {OSError.E} =3D3D3D<=
>=3BBR=3D3D>=3B >=3B>=3B&=3Bnbsp=3D3D3B V=3D<BR>>=3B >=3BAR<=
>=3BBR>=3B&=3Bnbsp=3D3D3B&=3Bnbsp=3D3D3B&=3Bnbsp=3D3D3B host : AR=
>RAY [0..255] OF CHAR=3D3D3B<=3B=3D3D=3D<BR>>=3B >=3B>=3B >=3BBR&g=
>t=3B&=3Bnbsp=3D3D3B&=3Bnbsp=3D3D3B&=3Bnbsp=3D3D3B info :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R>=3B>=3B >=3BI guess&=3Bnbsp=3D3D3BSameHo=3D=
><BR>>=3B >=3Bst can duplicate the logic to predict the error state =3D3=
>D>=3B >=3Band return fals=3D<BR>>=3B >=3Be&=3Bnbsp=3D3D3Bupon er=
>ror?<=3BBR>=3B>=3B >=3BDuplicating the logic for a third time. :(&l=
>t=3BBR>=3B=3D<BR>>=3B >=3B>=3B >=3B&=3Bnbsp=3D3D3B<=3BBR>=
>=3B>=3B >=3B<=3BBR>=3B&=3Bnbsp=3D3D3B- Jay<=3BBR>=3B<=3BBR=
>>=3B<=3B/body>=3B>=3B >=3B<=3B/html>=3B=3D3D>=3B >=3B>=
>=3B >=3B--=3D<BR>>=3B >=3B_9e67232c-a064-417d-879e-227a77e310f9_--=3D=
><BR>>=3B >=3B<BR>>=3B >=3B--_b00371fe-730b-4981-9051-a874361296d7_<=
>BR>>=3B >=3BContent-Type: text/html=3B charset=3D"iso-8859-1"<BR>>=3B=
> >=3BContent-Transfer-Encoding: quoted-printable<BR>>=3B >=3B<BR>>=
>=3B >=3B<=3Bhtml>=3B<BR>>=3B >=3B<=3Bhead>=3B<BR>>=3B >=
>=3B<=3Bstyle>=3B<BR>>=3B >=3B.hmmessage P<BR>>=3B >=3B{<BR>>=
>=3B >=3Bmargin:0px=3D3B<BR>>=3B >=3Bpadding:0px<BR>>=3B >=3B}<BR>=
>>=3B >=3Bbody.hmmessage<BR>>=3B >=3B{<BR>>=3B >=3Bfont-size: 10=
>pt=3D3B<BR>>=3B >=3Bfont-family:Verdana<BR>>=3B >=3B}<BR>>=3B >=
>=3B<=3B/style>=3B<BR>>=3B >=3B<=3B/head>=3B<BR>>=3B >=3B<=
>=3Bbody class=3D3D'hmmessage'>=3B<BR>>=3B >=3BDo you know the right w=
>ay?<=3BBR>=3B<BR>>=3B >=3B&=3Bnbsp=3D3B<=3BBR>=3B<BR>>=3B =
>>=3BPPC_LINUX "just worked"=3D2C and I can check Solaris and Darwin.<=
>=3BBR>=3B<BR>>=3B >=3B&=3Bnbsp=3D3B<=3BBR>=3B<BR>>=3B >=3B=
>I don't want to edit /etc/hosts -- I use DHCP.<=3BBR>=3B<BR>>=3B >=
>=3BThough DHCP has been bothering me -- only for some of my machines do nam=
>es =3D<BR>>=3B >=3Bresolve=3D2C so I end using IP addresses=3D2C which =
>change sometimes=3D2C and I l=3D<BR>>=3B >=3Boop over them running ssh =
>to all of them and "see what I get"=3D2C not ideal.=3D<BR>>=3B >=3B<=
>=3BBR>=3B<BR>>=3B >=3B&=3Bnbsp=3D3B<=3BBR>=3B<BR>>=3B >=3B=
>&=3Bnbsp=3D3B- Jay<=3BBR>=3B<=3BBR>=3B<=3BBR>=3B&=3Bgt=3D=
>3B To: jay.krell at cornell.edu<=3BBR>=3B&=3Bgt=3D3B Date: S=3D<BR>>=
>=3B >=3Bun=3D2C 11 Jan 2009 08:02:18 -0800<=3BBR>=3B&=3Bgt=3D3B Fr=
>om: mika at async.caltech.edu<=3BBR>=3B=3D<BR>>=3B >=3B&=3Bgt=3D3B =
>CC: m3devel at elegosoft.com<=3BBR>=3B&=3Bgt=3D3B Subject: Re: [M3devel=
>] Juno (X) =3D<BR>>=3B >=3Bnetworking problem on AMD64_FREEBSD<=3BBR&=
>gt=3B&=3Bgt=3D3B <=3BBR>=3B&=3Bgt=3D3B This is a screwy t=3D<BR>&=
>gt=3B >=3Bhing in Modula-3. A bug I would call it.<=3BBR>=3B&=3Bgt=
>=3D3B <=3BBR>=3B&=3Bgt=3D3B I've noticed =3D<BR>>=3B >=3Ba lot o=
>f networking M3 programs don't work right unless<=3BBR>=3B&=3Bgt=3D3=
>B the retur=3D<BR>>=3B >=3Bn value of Unix's "hostname" maps to a real =
>IP address via<=3BBR>=3B&=3Bgt=3D3B gethos=3D<BR>>=3B >=3Btbynam=
>e. I accomplish it in practice by adding my hostname<=3BBR>=3B&=3Bgt=
>=3D3B to /et=3D<BR>>=3B >=3Bc/hosts.<=3BBR>=3B&=3Bgt=3D3B <=3B=
>BR>=3B&=3Bgt=3D3B This is obviously not the right way to fix it=3D<BR>=
>>=3B >=3B... <=3BBR>=3B&=3Bgt=3D3B <=3BBR>=3B&=3Bgt=3D3B =
>Mika<=3BBR>=3B&=3Bgt=3D3B <=3BBR>=3B&=3Bgt=3D3B Jay writes:&l=
>t=3BBR>=3B&=3Bgt=3D3B &=3B=3D<BR>>=3B >=3Bgt=3D3B--_9e67232c-a0=
>64-417d-879e-227a77e310f9_<=3BBR>=3B&=3Bgt=3D3B &=3Bgt=3D3BConten=
>t-Type:=3D<BR>>=3B >=3B text/plain=3D3B charset=3D3D"iso-8859-1"<=3BB=
>R>=3B&=3Bgt=3D3B &=3Bgt=3D3BContent-Transfer-Enco=3D<BR>>=3B >=
>=3Bding: quoted-printable<=3BBR>=3B&=3Bgt=3D3B &=3Bgt=3D3B<=3BB=
>R>=3B&=3Bgt=3D3B &=3Bgt=3D3B<=3BBR>=3B&=3Bgt=3D3B &=3Bgt=
>=3D3BHi=3D<BR>>=3B >=3B. Unix network programming question..<=3BBR>=
>=3B&=3Bgt=3D3B &=3Bgt=3D3BAMD64_FREEBSD:<=3BBR>=3B&=3Bgt=3D<BR=
>>>=3B >=3B=3D3B &=3Bgt=3D3B$DISPLAY is set to point back to Cygwin h=
>ost.It works for PPC_LIN=3D<BR>>=3B >=3BUX.<=3BBR>=3B&=3Bgt=3D3B=
> &=3Bgt=3D3B[jay at fbsdamd64a /cm3/bin]$ ./Juno<=3BBR>=3B&=3Bgt=3D3=
>B &=3Bgt=3D3B*****=3D<BR>>=3B >=3B* runtime error:*** Exception "IPE=
>rror.FatalError" not in RAISES li=3D3D<=3BBR>=3B&=3B=3D<BR>>=3B &g=
>t=3Bgt=3D3B &=3Bgt=3D3Bst*** file "../src/common/IPError.m3"=3D3D2C line=
> 27***<=3BBR>=3B&=3Bgt=3D3B=3D<BR>>=3B >=3B &=3Bgt=3D3BAbort =
>trap: 6 (core dumped)[jay at fbsdamd64a /cm3/bin]$<=3BBR>=3B&=3Bgt=3D3B=
> &=3Bgt=3D<BR>>=3B >=3B=3D3BIP.m3:<=3BBR>=3B&=3Bgt=3D3B &=
>=3Bgt=3D3B=3D3D20<=3BBR>=3B&=3Bgt=3D3B &=3Bgt=3D3BPROCEDURE GetHo=
>stAddr(): Ad=3D<BR>>=3B >=3Bdress =3D3D3D VAR hname: ARRAY [0..255] OF =
>CHAR=3D3D3B =3D3D<=3BBR>=3B&=3Bgt=3D3B &=3Bgt=3D3B BEG=3D<BR>>=
>=3B >=3BIN LOCK mu DO IF Unix.gethostname(ADR(hname[0])=3D3D2C BYTESIZE(h=
>na=3D3D<=3BBR>=3B&=3Bgt=3D<BR>>=3B >=3B=3D3B &=3Bgt=3D3Bme)) =
># 0 THEN IPError.Die ()=3D3D3B END=3D3D3B VAR h :=3D3D3D Unetdb.g=3D<BR>>=
>=3B >=3B=3D3D<=3BBR>=3B&=3Bgt=3D3B &=3Bgt=3D3Bethostbyname(ADR(=
>hname[0]))=3D3D3B BEGIN IF h =3D3D3D NIL T=3D<BR>>=3B >=3BHEN IPError.D=
>ie()=3D3D<=3BBR>=3B&=3Bgt=3D3B &=3Bgt=3D3B=3D3D3B END=3D3D3B RETU=
>RN GetAddress(h)=3D3D=3D<BR>>=3B >=3B3B END=3D3D3B END=3D3D3B END GetHo=
>s=3D3D<=3BBR>=3B&=3Bgt=3D3B &=3Bgt=3D3BtAddr=3D3D3B<=3BBR>=3B=
>&=3Bgt=3D3B &=3Bgt=3D<BR>>=3B >=3B=3D3BPROCEDURE GetAddress (ent:=
> Unetdb.struct_hostent_star): Address =3D3D3D VA=3D<BR>>=3B >=3BR ua=3D=
>3D<=3BBR>=3B&=3Bgt=3D3B &=3Bgt=3D3B: Uin.struct_in_addr=3D3D3B BE=
>GIN &=3Blt=3D3B* ASSERT ent.=3D<BR>>=3B >=3Bh_length &=3Blt=3D3B=
>=3D3D3D BYTESIZE(Addr=3D3D<=3BBR>=3B&=3Bgt=3D3B &=3Bgt=3D3Bess) *=
>&=3Bgt=3D3B ua :=3D3D3=3D<BR>>=3B >=3BD LOOPHOLE(ent.h_addr_list=3D3=
>D2C UNTRACED =3D3D<=3BBR>=3B&=3Bgt=3D3B &=3Bgt=3D3BREF UNTRACED R=
>=3D<BR>>=3B >=3BEF Uin.struct_in_addr)^^=3D3D3B RETURN LOOPHOLE(ua.s_ad=
>dr=3D3D2C A=3D3D<=3BBR>=3B&=3Bgt=3D3B=3D<BR>>=3B >=3B &=3Bgt=
>=3D3Bddress)=3D3D3B END GetAddress=3D3D3B<=3BBR>=3B&=3Bgt=3D3B &=
>=3Bgt=3D3B=3D3D20<=3BBR>=3B&=3Bgt=3D3B &=3Bgt=3D<BR>>=3B >=3B=
>=3D3Bgethostbyname is failing.<=3BBR>=3B&=3Bgt=3D3B &=3Bgt=3D3B=
>=3D3D20<=3BBR>=3B&=3Bgt=3D3B &=3Bgt=3D3BAnalogou=3D<BR>>=3B >=
>=3Bs C code also fails:<=3BBR>=3B&=3Bgt=3D3B &=3Bgt=3D3B=3D3D20&l=
>t=3BBR>=3B&=3Bgt=3D3B &=3Bgt=3D3B[jay at fbsdamd64a =3D<BR>>=3B >=
>=3B/cm3/bin]$ cat ~/5.c#include &=3Blt=3D3Bassert.h&=3Bgt=3D3B#includ=
>e &=3Blt=3D3Bnetdb.h&=3Bgt=3D<BR>>=3B >=3B=3D3B#i=3D3D<=3BBR>=
>=3B&=3Bgt=3D3B &=3Bgt=3D3Bnclude &=3Blt=3D3Bstdio.h&=3Bgt=3D3B#=
>include &=3Blt=3D3Berrno.h&=3Bg=3D<BR>>=3B >=3Bt=3D3Btypedef stru=
>ct hostent hostent_t=3D3D3B<=3BBR>=3B&=3Bgt=3D3B &=3Bgt=3D3B=3D3D=
>20<=3BBR>=3B&=3Bgt=3D3B &=3B=3D<BR>>=3B >=3Bgt=3D3Bint main()=
>{ char hostname[200]=3D3D3B hostent_t* h=3D3D3B int i=3D3D3B<=3BBR>=3B&=
>amp=3Bg=3D<BR>>=3B >=3Bt=3D3B &=3Bgt=3D3B i =3D3D3D gethostname(host=
>name=3D3D2C 200)=3D3D3B assert(i =3D3D3D=3D3D3D=3D<BR>>=3B >=3B 0)=3D3D=
>3B printf("hostna=3D3D<=3BBR>=3B&=3Bgt=3D3B &=3Bgt=3D3Bme: %s\n"=
>=3D3D2C hostname)=3D3D3B h =3D<BR>>=3B >=3B=3D3D3D gethostbyname(hostna=
>me)=3D3D3B herror("foo")=3D3D3B=3D3D<=3BBR>=3B&=3Bgt=3D3B &=3Bgt=
>=3D3B p=3D<BR>>=3B >=3Brintf("%p %d %d\n"=3D3D2C h=3D3D2C errno=3D3D2C =
>h_errno)=3D3D3B assert(h)=3D3D3B retu=3D<BR>>=3B >=3Brn 0=3D3D3B}<=3B=
>BR>=3B&=3Bgt=3D3B &=3Bgt=3D3B=3D3D20<=3BBR>=3B&=3Bgt=3D3B &a=
>mp=3Bgt=3D3Bherror says "unknown host"=3D<BR>>=3B >=3B.<=3BBR>=3B&a=
>mp=3Bgt=3D3B &=3Bgt=3D3BStack is:<=3BBR>=3B&=3Bgt=3D3B &=3Bgt=
>=3D3B at ../src/runtime/ex_frame/RTE=3D<BR>>=3B >=3BxFrame.m3:58#13 0x0=
>000000801a7f2b3 in RTH=3D3D<=3BBR>=3B&=3Bgt=3D3B &=3Bgt=3D3Books_=
>_Raise (M=3D<BR>>=3B >=3B3_AJWxb1_ex=3D3D3DError accessing memory addre=
>ss 0x8000ffffd278: =3D3D<=3BBR>=3B&=3Bgt=3D<BR>>=3B >=3B=3D3B &a=
>mp=3Bgt=3D3BBad address.) at ../src/runtime/common/RTHooks.m3:79#14 0x00000=
>00=3D<BR>>=3B >=3B80169c8=3D3D<=3BBR>=3B&=3Bgt=3D3B &=3Bgt=3D=
>3Bd3 in IPError__Die () at ../src/common/IPError.m=3D<BR>>=3B >=3B3:27#=
>15 0x0000000801698a3e =3D3D<=3BBR>=3B&=3Bgt=3D3B &=3Bgt=3D3Bin IP=
>__GetHostAddr (M3_BCxjP=3D<BR>>=3B >=3Bn__result=3D3D3DError accessing =
>memory address 0x80=3D3D<=3BBR>=3B&=3Bgt=3D3B &=3Bgt=3D3B00ffff=
>=3D<BR>>=3B >=3Bd338: Bad address.) at ../src/POSIX/IP.m3:82#16 0x00000=
>008012133d0=3D3D<=3BBR>=3B&=3Bg=3D<BR>>=3B >=3Bt=3D3B &=3Bgt=
>=3D3B in XSharedMem__SameHost (M3_AQuuui_trsl=3D3D3DError accessing mem=3D<=
>BR>>=3B >=3Bory address 0=3D3D<=3BBR>=3B&=3Bgt=3D3B &=3Bgt=3D=
>3Bx8000ffffd4d8: Bad address.) at ../src/xvb=3D<BR>>=3B >=3Bt/XSharedMe=
>m.m3:96#17 0x000000=3D3D<=3BBR>=3B&=3Bgt=3D3B &=3Bgt=3D3B0801212a=
>b7 in XSharedMem_=3D<BR>>=3B >=3B_InitXClient (M3_AQuuui_v=3D3D3DError =
>accessing memory=3D3D<=3BBR>=3B&=3Bgt=3D3B &=3Bgt=3D3B ad=3D<BR>&=
>gt=3B >=3Bdress 0x8000ffffd648: Bad address.) at ../src/xvbt/XSharedMem.m=
>3:29#1=3D3D<=3BBR=3D<BR>>=3B >=3B>=3B&=3Bgt=3D3B &=3Bgt=3D3B8=
> 0x0000000801211819 in XExtensions__InitXClient (M3_AQuuui_x=3D<BR>>=3B &=
>gt=3Bclient=3D3D3DError=3D3D<=3BBR>=3B&=3Bgt=3D3B &=3Bgt=3D3B acc=
>essing memory address 0x8000ffffd7f=3D<BR>>=3B >=3B8: Bad address.) at =
>../src/xvbt/X=3D3D<=3BBR>=3B&=3Bgt=3D3B &=3Bgt=3D3BExtensions.m3:=
>14#19 0x=3D<BR>>=3B >=3B00000008012467a4 in XClientF__Connect (M3_Bd56f=
>i_inst=3D3D<=3BBR>=3B&=3Bgt=3D3B &=3Bgt=3D3B=3D<BR>>=3B >=3B=
>=3D3D3D0x1879b=3D3D2C M3_AQuuui_trsl=3D3D3D0x6) at ../src/xvbt/XClientF.m3:=
>583---=3D<BR>>=3B >=3BTyp=3D3D<=3BBR>=3B&=3Bgt=3D3B &=3Bgt=3D=
>3Be &=3Blt=3D3Breturn&=3Bgt=3D3B to continue=3D3D2C or q &=3Blt=3D=
>3Bret=3D<BR>>=3B >=3Burn&=3Bgt=3D3B to quit---(More stack frames fol=
>low=3D3D<=3BBR>=3B&=3Bgt=3D3B &=3Bgt=3D3B...)(gdb)<=3B=3D<BR>&g=
>t=3B >=3BBR>=3B&=3Bgt=3D3B &=3Bgt=3D3B(* return TRUE if server an=
>d client are on same host *)PROC=3D<BR>>=3B >=3BEDURE SameHost (=3D3D&l=
>t=3BBR>=3B&=3Bgt=3D3B &=3Bgt=3D3Btrsl: XClient.T): BOOLEAN =3D3D3D =
>VAR dis=3D<BR>>=3B >=3Bplay :=3D3D3D DisplayH=3D3D<=3BBR>=3B&=3B=
>gt=3D3B &=3Bgt=3D3Bost(trsl)=3D3D3B displayAddr: IP.Addr=3D<BR>>=3B &g=
>t=3Bess=3D3D3B BEGIN IF display =3D3D3D NIL THE=3D3D<=3BBR>=3B&=3Bgt=
>=3D3B &=3Bgt=3D3BN RETURN TRUE=3D3D=3D<BR>>=3B >=3B3B END=3D3D3B<=
>=3BBR>=3B&=3Bgt=3D3B &=3Bgt=3D3B TRY IF NOT IP.GetHostByName(displa=
>y=3D3D2C displ=3D<BR>>=3B >=3BayAddr) THEN RETURN FA=3D3D<=3BBR>=3B=
>&=3Bgt=3D3B &=3Bgt=3D3BLSE=3D3D3B END=3D3D3B RETURN displayA=3D<BR>&g=
>t=3B >=3Bddr =3D3D3D IP.GetHostAddr()=3D3D3B EXCEPT =3D3D<=3BBR>=3B&a=
>mp=3Bgt=3D3B &=3Bgt=3D3B| IP.Error =3D3D3D=3D<BR>>=3B >=3B&=3Bgt=
>=3D3B RETURN FALSE=3D3D3B END=3D3D3B END SameHost=3D3D3B<=3BBR>=3B&=
>=3Bgt=3D3B &=3Bgt=3D3B=3D3D20<=3BB=3D<BR>>=3B >=3BR>=3B&=3Bgt=
>=3D3B &=3Bgt=3D3BThoughts?<=3BBR>=3B&=3Bgt=3D3B &=3Bgt=3D3B=3D=
>3D20<=3BBR>=3B&=3Bgt=3D3B &=3Bgt=3D3BPerhaps my n=3D<BR>>=3B &g=
>t=3Betwork isn't setup well=3D3D2C like I should add the local machine =3D3=
>D<=3BBR>=3B&=3Bgt=3D<BR>>=3B >=3B=3D3B &=3Bgt=3D3Bto /etc/hos=
>ts.I think this can be made to fail gracefully though.=3D<BR>>=3B >=3BI=
>t seems l=3D3D<=3BBR>=3B&=3Bgt=3D3B &=3Bgt=3D3Bike it has nothing=
> to do with AMD64_FREEBSD=3D<BR>>=3B >=3B=3D3D2C but could have to do w=
>ith Fr=3D3D<=3BBR>=3B&=3Bgt=3D3B &=3Bgt=3D3BeeBSD.<=3BBR>=3B&=
>amp=3Bgt=3D3B &=3Bgt=3D<BR>>=3B >=3B=3D3B=3D3D20<=3BBR>=3B&=
>=3Bgt=3D3B &=3Bgt=3D3BSeems like SocketPosix has nearly the exact same c=
>=3D<BR>>=3B >=3Bode but appearsmore forgi=3D3D<=3BBR>=3B&=3Bgt=
>=3D3B &=3Bgt=3D3Bving.. IOError instead of Fata=3D<BR>>=3B >=3Bl?<=
>=3BBR>=3B&=3Bgt=3D3B &=3Bgt=3D3B=3D3D20<=3BBR>=3B&=3Bgt=3D3B=
> &=3Bgt=3D3BSocketPosix.m3:<=3BBR>=3B&=3Bgt=3D3B &=3Bgt=3D3B=
>=3D<BR>>=3B >=3B=3D3D20<=3BBR>=3B&=3Bgt=3D3B &=3Bgt=3D3BPROCE=
>DURE GetHostAddr (): Address RAISES {OSError.E} =3D<BR>>=3B >=3B=3D3D3D=
> VAR host : AR=3D3D<=3BBR>=3B&=3Bgt=3D3B &=3Bgt=3D3BRAY [0..255] =
>OF CHAR=3D3D3B info : Une=3D<BR>>=3B >=3Btdb.struct_hostent_star=3D3D3B=
> ua : U=3D3D<=3BBR>=3B&=3Bgt=3D3B &=3Bgt=3D3Bin.struct_in_addr=3D=
>3D=3D<BR>>=3B >=3B3B BEGIN IF Unix.gethostname (ADR (host[0])=3D3D2C BY=
>TESI=3D3D<=3BBR>=3B&=3Bgt=3D3B &=3Bgt=3D3B=3D<BR>>=3B >=3BZE =
>(host)) # 0 THEN IOError (Unexpected)=3D3D3B END=3D3D3B<=3BBR>=3B&=
>=3Bgt=3D3B &=3Bgt=3D3B inf=3D<BR>>=3B >=3Bo :=3D3D3D Unetdb.gethostb=
>yname (ADR (host[0]))=3D3D3B IF info =3D3D3D NIL TH=3D3D<=3B=3D<BR>>=3B=
> >=3BBR>=3B&=3Bgt=3D3B &=3Bgt=3D3BEN IOError (Unexpected)=3D3D3B =
>END=3D3D3B &=3Blt=3D3B* ASSERT info.h=3D<BR>>=3B >=3B_length &=3B=
>lt=3D3B=3D3D3D BYTESIZE =3D3D<=3BBR>=3B&=3Bgt=3D3B &=3Bgt=3D3B(Ad=
>dress) *&=3Bgt=3D3B<=3BBR>=3B&=3Bgt=3D<BR>>=3B >=3B=3D3B &=
>=3Bgt=3D3B ua :=3D3D3D LOOPHOLE(info.h_addr_list=3D3D2C UNTRACED REF UNT=3D=
>3D<=3BBR>=3B=3D<BR>>=3B >=3B&=3Bgt=3D3B &=3Bgt=3D3BRACED REF =
>Uin.struct_in_addr)^^=3D3D3B RETURN LOOPHOLE (ua.s_add=3D<BR>>=3B >=3Br=
>=3D3D2C Address=3D3D<=3BBR>=3B&=3Bgt=3D3B &=3Bgt=3D3B)=3D3D3B END=
> GetHostAddr=3D3D3B<=3BBR>=3B&=3Bgt=3D3B &=3Bgt=3D<BR>>=3B >=
>=3B=3D3B=3D3D20<=3BBR>=3B&=3Bgt=3D3B &=3Bgt=3D3B=3D3D20<=3BBR&g=
>t=3B&=3Bgt=3D3B &=3Bgt=3D3BIt is again disappointing to=3D<BR>>=3B =
>>=3B see such code duplication.<=3BBR>=3B&=3Bgt=3D3B &=3Bgt=3D3=
>B=3D3D20<=3BBR>=3B&=3Bgt=3D3B &=3Bgt=3D3B=3D3D20<=3BBR>=3B=3D=
><BR>>=3B >=3B&=3Bgt=3D3B &=3Bgt=3D3BI guess SameHost can duplicat=
>e the logic to predict the error =3D<BR>>=3B >=3Bstate and ret=3D3D<=
>=3BBR>=3B&=3Bgt=3D3B &=3Bgt=3D3Burn false upon error?<=3BBR>=3B=
>&=3Bgt=3D3B &=3Bgt=3D3BDupl=3D<BR>>=3B >=3Bicating the logic for =
>a third time. :(<=3BBR>=3B&=3Bgt=3D3B &=3Bgt=3D3B=3D3D20<=3BBR&=
>gt=3B&=3Bgt=3D3B &=3Bgt=3D<BR>>=3B >=3B=3D3B - Jay=3D3D<=3BBR&g=
>t=3B&=3Bgt=3D3B &=3Bgt=3D3B<=3BBR>=3B&=3Bgt=3D3B &=3Bgt=3D3=
>B--_9e67232c-a064-417d-879e-22=3D<BR>>=3B >=3B7a77e310f9_<=3BBR>=3B=
>&=3Bgt=3D3B &=3Bgt=3D3BContent-Type: text/html=3D3B charset=3D3D"iso-=
>8859-=3D<BR>>=3B >=3B1"<=3BBR>=3B&=3Bgt=3D3B &=3Bgt=3D3BConte=
>nt-Transfer-Encoding: quoted-printable<=3BBR>=3B&=3Bgt=3D3B &=3Bg=
>=3D<BR>>=3B >=3Bt=3D3B<=3BBR>=3B&=3Bgt=3D3B &=3Bgt=3D3B&=
>=3Blt=3D3Bhtml&=3Bgt=3D3B<=3BBR>=3B&=3Bgt=3D3B &=3Bgt=3D3B&=
>=3Blt=3D3Bhead&=3Bgt=3D3B<=3BBR>=3B&=3B=3D<BR>>=3B >=3Bgt=3D3=
>B &=3Bgt=3D3B&=3Blt=3D3Bstyle&=3Bgt=3D3B<=3BBR>=3B&=3Bgt=3D=
>3B &=3Bgt=3D3B.hmmessage P<=3BBR>=3B&=3Bgt=3D3B &=3Bgt=3D3B=3D=
><BR>>=3B >=3B{<=3BBR>=3B&=3Bgt=3D3B &=3Bgt=3D3Bmargin:0px=3D3=
>D3B<=3BBR>=3B&=3Bgt=3D3B &=3Bgt=3D3B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14=3D<BR>>=3B >=3B 0x000000080169c8d3 in IPError=3D3=
>D<=3BBR>=3B&=3Bgt=3D3B &=3Bgt=3D3B__Die () at ../src/common=3D<BR=
>>>=3B >=3B/IPError.m3:27&=3Blt=3D3BBR&=3Bgt=3D3B#15 0x00000008016=
>98a3e in IP__Ge=3D3D<=3BBR>=3B&=3Bgt=3D3B &=3B=3D<BR>>=3B >=
>=3Bgt=3D3BtHostAddr (M3_BCxjPn__result=3D3D3DError accessing mem&=3Blt=
>=3D3BBR&=3Bgt=3D3Bory =3D<BR>>=3B >=3Baddress 0x8000fff=3D3D<=3BBR=
>>=3B&=3Bgt=3D3B &=3Bgt=3D3Bfd338: Bad address.&=3Blt=3D3BBR&=
>=3Bgt=3D3B)&=3Blt=3D<BR>>=3B >=3B=3D3BBR&=3Bgt=3D3B&=3Bamp=3D3=
>Bnbsp=3D3D3B&=3Bamp=3D3Bnbsp=3D3D3B&=3Bamp=3D3Bnbsp=3D3D3B at ../src/=
>POSIX=3D<BR>>=3B >=3B/IP.m3:=3D3D<=3BBR>=3B&=3Bgt=3D3B &=3Bgt=
>=3D3B82&=3Blt=3D3BBR&=3Bgt=3D3B#16 0x00000008012133d0 in XShare=3D<BR=
>>>=3B >=3BdMem__SameHost (M3_AQuuui_trsl=3D3D3DErro=3D3D<=3BBR>=3B&=
>amp=3Bgt=3D3B &=3Bgt=3D3Br accessing m&=3Blt=3D<BR>>=3B >=3B=3D3B=
>BR&=3Bgt=3D3Bemory address 0x8000ffffd4d8: Bad address.&=3Blt=3D3BBR&=
>amp=3Bgt=3D3B)&=3Blt=3D3BB=3D<BR>>=3B >=3BR&=3Bgt=3D3B&=3Bamp=
>=3D3Bnbsp=3D3D<=3BBR>=3B&=3Bgt=3D3B &=3Bgt=3D3B=3D3D3B&=3Bamp=
>=3D3Bnbsp=3D3D3B&=3Bamp=3D3Bnbsp=3D3D3B=3D<BR>>=3B >=3B at ../src/xv=
>bt/XSharedMem.m3:96&=3Blt=3D3BBR&=3Bgt=3D3B#17 0x0000000801212a=3D3D&=
>lt=3BBR>=3B&=3Bg=3D<BR>>=3B >=3Bt=3D3B &=3Bgt=3D3Bb7 in XShared=
>Mem__InitXClient (M3_AQuuui_v=3D3D3DError accessing m=3D<BR>>=3B >=3B&a=
>mp=3Blt=3D3BBR&=3Bgt=3D3Bemory add=3D3D<=3BBR>=3B&=3Bgt=3D3B &=
>=3Bgt=3D3Bress 0x8000ffffd648: Bad address=3D<BR>>=3B >=3B.&=3Blt=3D=
>3BBR&=3Bgt=3D3B)&=3Blt=3D3BBR&=3Bgt=3D3B&=3Bamp=3D3Bnbsp=3D3D3B=
>&=3Bamp=3D3Bnbsp=3D3D3B&=3Bamp=3D3Bnbsp=3D<BR>>=3B >=3B=3D3D3B at=
> ../sr=3D3D<=3BBR>=3B&=3Bgt=3D3B &=3Bgt=3D3Bc/xvbt/XSharedMem.m3:=
>29&=3Blt=3D3BBR&=3Bgt=3D3B#18 =3D<BR>>=3B >=3B0x0000000801211819 =
>in XExtensions__InitXClie=3D3D<=3BBR>=3B&=3Bgt=3D3B &=3Bgt=3D3Bnt=
> (M3_AQuu=3D<BR>>=3B >=3Bui_xclient=3D3D3DError acce&=3Blt=3D3BBR&am=
>p=3Bgt=3D3Bssing memory address 0x8000ffffd7f8:=3D<BR>>=3B >=3B =3D3D&l=
>t=3BBR>=3B&=3Bgt=3D3B &=3Bgt=3D3BBad address.&=3Blt=3D3BBR&=
>=3Bgt=3D3B)&=3Blt=3D3BBR&=3Bgt=3D3B&=3Bamp=3D3Bnbsp=3D<BR>>=3B &=
>gt=3B=3D3D3B&=3Bamp=3D3Bnbsp=3D3D3B&=3Bamp=3D3Bnbsp=3D3D3B at ../src/=
>xvbt/XExtensions.m3=3D3D<=3BBR>=3B&=3B=3D<BR>>=3B >=3Bgt=3D3B &a=
>mp=3Bgt=3D3B:14&=3Blt=3D3BBR&=3Bgt=3D3B#19 0x00000008012467a4 in XCli=
>entF__Connect (M=3D<BR>>=3B >=3B3_Bd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=3D3BIt seems like it has nothing to do with AMD6=3D<BR>>=3B >=
>=3B4_FREEBSD=3D3D2C but could have t=3D3D<=3BBR>=3B&=3Bgt=3D3B &=
>=3Bgt=3D3Bo do with FreeBSD.&=3Blt=3D3B=3D<BR>>=3B >=3BBR&=3Bgt=
>=3D3B<=3BBR>=3B&=3Bgt=3D3B &=3Bgt=3D3B&=3Blt=3D3BBR&=3Bgt=
>=3D3B&=3Bamp=3D3Bnbsp=3D3D3B&=3Blt=3D3BBR&=3Bgt=3D3B<=3BBR>=3B=
>&=3Bg=3D<BR>>=3B >=3Bt=3D3B &=3Bgt=3D3BSeems like SocketPosix has=
> nearly the exact same code but appear=3D<BR>>=3B >=3Bs&=3Blt=3D3BBR=
>&=3Bgt=3D3Bmore f=3D3D<=3BBR>=3B&=3Bgt=3D3B &=3Bgt=3D3Borgivin=
>g.. IOError instead of Fata=3D<BR>>=3B >=3Bl?&=3Blt=3D3BBR&=3Bgt=
>=3D3B<=3BBR>=3B&=3Bgt=3D3B &=3Bgt=3D3B&=3Bamp=3D3Bnbsp=3D3D3B&=
>amp=3Blt=3D3BBR&=3Bgt=3D3B<=3BBR>=3B&=3Bgt=3D3B &=3B=3D<BR>>=
>=3B >=3Bgt=3D3B&=3Blt=3D3BBR&=3Bgt=3D3BSocketPosix.m3:&=3Blt=3D3=
>BBR&=3Bgt=3D3B<=3BBR>=3B&=3Bgt=3D3B &=3Bgt=3D3B&=3Bamp=3D3B=
>nbs=3D<BR>>=3B >=3Bp=3D3D3B&=3Blt=3D3BBR&=3Bgt=3D3B<=3BBR>=3B=
>&=3Bgt=3D3B &=3Bgt=3D3B&=3Blt=3D3BBR&=3Bgt=3D3BPROCEDURE GetHos=
>tAddr ()=3D<BR>>=3B >=3B: Address&=3Blt=3D3BBR&=3Bgt=3D3B&=3Ba=
>mp=3D3Bnbsp=3D3D3B RAISES {OSError.E} =3D3D3D&=3Blt=3D3BBR=3D3D=3D<BR>&g=
>t=3B >=3B<=3BBR>=3B&=3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amp=3D3Bnbsp=3D3D3B&=3Bamp=3D3Bnbsp=3D3D3B&a=
>mp=3Bam=3D<BR>>=3B >=3Bp=3D3Bnbsp=3D3D3B RETURN LOOP=3D3D<=3BBR>=3B=
>&=3Bgt=3D3B &=3Bgt=3D3BHOLE (ua.s_addr=3D3D2C Address)=3D<BR>>=3B &=
>gt=3B=3D3D3B&=3Blt=3D3BBR&=3Bgt=3D3B&=3Bamp=3D3Bnbsp=3D3D3B END Ge=
>tHostAddr=3D3D3B&=3Blt=3D3BBR&=3Bgt=3D3B<=3BBR>=3B&=3B=3D<BR>&=
>gt=3B >=3Bgt=3D3B &=3Bgt=3D3B&=3Bamp=3D3Bnbsp=3D3D3B&=3Blt=3D3BB=
>R&=3Bgt=3D3B<=3BBR>=3B&=3Bgt=3D3B &=3Bgt=3D3B&=3Bamp=3D3Bnb=
>sp=3D3D3B=3D<BR>>=3B >=3B&=3Blt=3D3BBR&=3Bgt=3D3B<=3BBR>=3B&a=
>mp=3Bgt=3D3B &=3Bgt=3D3BIt is again disappointing to see such code d=3D<=
>BR>>=3B >=3Buplication.&=3Blt=3D3BBR&=3Bgt=3D3B<=3BBR>=3B&=
>=3Bgt=3D3B &=3Bgt=3D3B&=3Bamp=3D3Bnbsp=3D3D3B&=3Blt=3D3BBR&=3Bg=
>t=3D3B<=3BBR=3D<BR>>=3B >=3B>=3B&=3Bgt=3D3B &=3Bgt=3D3B&=
>=3Bamp=3D3Bnbsp=3D3D3B&=3Blt=3D3BBR&=3Bgt=3D3B<=3BBR>=3B&=3Bgt=
>=3D3B &=3Bgt=3D3BI guess&=3Bamp=3D3B=3D<BR>>=3B >=3Bnbsp=3D3D3BSa=
>meHost can duplicate the logic to predict the error state =3D3D<=3BBR=3D<=
>BR>>=3B >=3B>=3B&=3Bgt=3D3B &=3Bgt=3D3Band return false&=3Ba=
>mp=3D3Bnbsp=3D3D3Bupon error?&=3Blt=3D3BBR&=3Bgt=3D3B<=3BBR>=3B=
>=3D<BR>>=3B >=3B&=3Bgt=3D3B &=3Bgt=3D3BDuplicating the logic for =
>a third time. :(&=3Blt=3D3BBR&=3Bgt=3D3B<=3BBR>=3B&=3Bg=3D<BR>=
>>=3B >=3Bt=3D3B &=3Bgt=3D3B&=3Bamp=3D3Bnbsp=3D3D3B&=3Blt=3D3BB=
>R&=3Bgt=3D3B<=3BBR>=3B&=3Bgt=3D3B &=3Bgt=3D3B&=3Blt=3D3BBR&=
>amp=3Bgt=3D3B&=3Bam=3D<BR>>=3B >=3Bp=3D3Bnbsp=3D3D3B- Jay&=3Blt=
>=3D3BBR&=3Bgt=3D3B&=3Blt=3D3BBR&=3Bgt=3D3B&=3Blt=3D3B/body&=
>=3Bgt=3D3B<=3BBR>=3B&=3Bgt=3D3B &=3B=3D<BR>>=3B >=3Bgt=3D3B&a=
>mp=3Blt=3D3B/html&=3Bgt=3D3B=3D3D<=3BBR>=3B&=3Bgt=3D3B &=3Bgt=
>=3D3B<=3BBR>=3B&=3Bgt=3D3B &=3Bgt=3D3B--_9e67232c-a064=3D<BR>>=
>=3B >=3B-417d-879e-227a77e310f9_--<=3BBR>=3B<=3BBR>=3B<=3B/body=
>>=3B<BR>>=3B >=3B<=3B/html>=3B=3D<BR>>=3B >=3B<BR>>=3B >=
>=3B--_b00371fe-730b-4981-9051-a874361296d7_--<BR><BR></body>
></html>=
>
>--_b0c10337-0e1c-414e-aae5-e611dcd4be8a_--
More information about the M3devel
mailing list