develooper Front page | perl.perl5.porters | Postings from June 2008

Re: [PATCH] pp_sys.c: gethostbyaddr

Thread Previous | Thread Next
From:
H.Merijn Brand
Date:
June 19, 2008 01:16
Subject:
Re: [PATCH] pp_sys.c: gethostbyaddr
Message ID:
20080619101624.39ed2e48@pc09.procura.nl
On Mon, 21 May 2007 07:45:20 -0400, Jarkko Hietaniemi <jhi@iki.fi>
wrote:

> H.Merijn Brand wrote:
> > On Mon, 21 May 2007 00:02:38 -0400, Jarkko Hietaniemi <jhi@iki.fi> wrote:
> > 
> >> The below patch (inlined and attached) fixes a crash and burn in
> >> gethostbyaddr() when Netdb_host_t is a 32-bit integer (which it is if it
> >> is in_addr_t, which is pretty much mandated to be an int if the system
> >> is UNIX/POSIX), but if pointers are 64-bit (those following at home have
> >> probably already guessed that I'm talking about Tru64 here).  (The core
> >> dumping tests: lib/Net/hostent.t -- and t/op/ver.t!)
> >>
> >> For some reason I've yet to figure out this didn't crash in blead for
> >> either cc or gcc or g++, but did crash in maint (Nick, *wink* *wink*
> > 
> > Did you create this against the maint branch?
> 
> Ooops, yes.  Madeit easier to verify that the core dump went away.
> 
> > patching file perl/pp_sys.c
> > Hunk #1 succeeded at 4655 (offset 45 lines).
> > 
> > Thanks, applied as change #31248
> > Maybe it's the same as my failures on HP-UX 11.23
> 
> That would be cool.

No, it still fails.
Installed a brand new HP-UX 11.31 yesterday, and that fails too
Definitely needs more work

> >> *nudge* *nudge*) with g++ (not cc or gcc).  Maybe g++ managed to arrange
> >> code differently enough so that the address truncation became too hot to
> >> handle.  Me, I'm just guessing.
> >>
> >> --- pp_sys.c.dist       2007-05-21 06:25:22.000000000 +0300
> >> +++ pp_sys.c    2007-05-21 06:50:21.000000000 +0300
> >> @@ -4610,7 +4610,7 @@
> >>         const int addrtype = POPi;
> >>         SV * const addrsv = POPs;
> >>         STRLEN addrlen;
> >> -       Netdb_host_t addr = (Netdb_host_t) SvPVbyte(addrsv, addrlen);
> >> +       UV addr = PTR2UV(SvPVbyte(addrsv, addrlen));
> >>
> >>         hent = PerlSock_gethostbyaddr((const char*)addr, (Netdb_hlen_t)
> >> addrlen, addrtype);
> >>  #else

-- 
H.Merijn Brand          Amsterdam Perl Mongers  http://amsterdam.pm.org/
using & porting perl 5.6.2, 5.8.x, 5.10.x, 5.11.x on HP-UX 10.20, 11.00,
11.11, 11.23, and 11.31, SuSE 10.1, 10.2, and 10.3, AIX 5.2, and Cygwin.
http://mirrors.develooper.com/hpux/           http://www.test-smoke.org/
http://qa.perl.org      http://www.goldmark.org/jeff/stupid-disclaimers/

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About