NetBSD Problem Report #43316

From www@NetBSD.org  Sun May 16 22:09:04 2010
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by www.NetBSD.org (Postfix) with ESMTP id 2F75963C34A
	for <gnats-bugs@gnats.NetBSD.org>; Sun, 16 May 2010 22:09:04 +0000 (UTC)
Message-Id: <20100516220903.E16A263BC69@www.NetBSD.org>
Date: Sun, 16 May 2010 22:09:03 +0000 (UTC)
From: panos@panix.eu
Reply-To: panos@panix.eu
To: gnats-bugs@NetBSD.org
Subject: tnftp on HP-UX broken
X-Send-Pr-Version: www-1.0

>Number:         43316
>Category:       pkg
>Synopsis:       tnftp on HP-UX broken
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    hpux-pkg-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun May 16 22:10:00 +0000 2010
>Last-Modified:  Thu Apr 26 13:46:34 +0000 2012
>Originator:     Panos Lampropoulos
>Release:        HP-UX
>Organization:
Kapteyn Astronomical institute
>Environment:
HP-UX vaduz B.11.11 U 9000/785 2015436932 unlimited-user license
>Description:
tnftp gives the following error:

ftp: Unable to get default rcvbuf size: Bad addres

This is due to:
getsockopt(s, SOL_SOCKET, SO_SNDBUF,
	    (void *)&sndbuf_size, &slen) == -1)
		err(1, "Unable to get default sndbuf size"

>How-To-Repeat:

>Fix:

>Release-Note:

>Audit-Trail:
From: David Holland <dholland-pbugs@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/43316: tnftp on HP-UX broken
Date: Mon, 17 May 2010 04:05:43 +0000

 On Sun, May 16, 2010 at 10:10:00PM +0000, panos@panix.eu wrote:
  > tnftp gives the following error:
  > 
  > ftp: Unable to get default rcvbuf size: Bad addres
  > 
  > This is due to:
  > getsockopt(s, SOL_SOCKET, SO_SNDBUF,
  > 	    (void *)&sndbuf_size, &slen) == -1)
  > 		err(1, "Unable to get default sndbuf size"

 Well, more likely it's the rcvbuf case four lines further up... but as
 they're basically the same it shouldn't make much difference.

 "Bad address" is strange though, because that normally means EFAULT,
 i.e., a bad pointer, and the two pointers passed to getsockopt are
 generated with & and are therefore more or less necessarily valid.

 Can you run it in truss?

 -- 
 David A. Holland
 dholland@netbsd.org

From: christos@zoulas.com (Christos Zoulas)
To: gnats-bugs@NetBSD.org, pkg-manager@netbsd.org, gnats-admin@netbsd.org, 
	pkgsrc-bugs@netbsd.org
Cc: 
Subject: Re: pkg/43316: tnftp on HP-UX broken
Date: Mon, 17 May 2010 08:52:55 -0400

 On May 16, 10:10pm, panos@panix.eu (panos@panix.eu) wrote:
 -- Subject: pkg/43316: tnftp on HP-UX broken

 This is probably because hp-ux does not make socklen_t visible unless.

 #define _XOPEN_SOURCE_EXTENDED 

 christos

 | This is due to:
 | getsockopt(s, SOL_SOCKET, SO_SNDBUF,
 | 	    (void *)&sndbuf_size, &slen) == -1)
 | 		err(1, "Unable to get default sndbuf size"
 | 
 | >How-To-Repeat:
 | 
 | >Fix:
 -- End of excerpt from panos@panix.eu


From: "OBATA Akio" <obache@netbsd.org>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: pkg/43316: tnftp on HP-UX broken
Date: Thu, 15 Jul 2010 22:37:59 +0900

 On Mon, 17 May 2010 21:55:02 +0900, Christos Zoulas <christos@zoulas.com> wrote:

 >  This is probably because hp-ux does not make socklen_t visible unless.
 > #define _XOPEN_SOURCE_EXTENDED

 Then putting following to tnftp/Makefile avoid this issue?

 CFLAGS.HPUX+= -D_OPEN_SOURCE_EXTENDED

From: Joerg Sonnenberger <joerg@britannica.bec.de>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/43316: tnftp on HP-UX broken
Date: Thu, 15 Jul 2010 16:00:19 +0200

 On Thu, Jul 15, 2010 at 01:40:04PM +0000, OBATA Akio wrote:
 >  >  This is probably because hp-ux does not make socklen_t visible unless.
 >  > #define _XOPEN_SOURCE_EXTENDED
 >  
 >  Then putting following to tnftp/Makefile avoid this issue?
 >  
 >  CFLAGS.HPUX+= -D_OPEN_SOURCE_EXTENDED
                    ^_XOPEN_...

 If it does, please talk with Luke about including it by default.

 Joerg

From: David Holland <dholland-pbugs@netbsd.org>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: pkg/43316: tnftp on HP-UX broken
Date: Sun, 26 Sep 2010 23:52:08 +0000

 (not sent to gnats)

    ------

 From: Wojciech Galazka <wojciech.galazka@gmail.com>
 To: pkgsrc-bugs@NetBSD.org
 Subject: Re: pkg/43316: tnftp on HP-UX broken
 Date: Tue, 14 Sep 2010 22:09:13 +0000 (UTC)

 Hi,
 I'm writing to tell you that simply putting the following to tnftp/Makefile does
 not solve this issue of non working tnftp

  CFLAGS.HPUX+= -D_XOPEN_SOURCE_EXTENDE

 Actually the problem is a bit different and I found the solution reading 
 http://www.mail-archive.com/gsoap@yahoogroups.com/msg01711.html

 The key sentence is 

 "It turns out that in this version of HPUX, the last argument to 
 getsockopt really has to be an int pointer, EVEN THOUGH it appears that the 
 function prototype is a socklen_t pointer.  Merely  changing the type of 'k' (in
 tnftp code this would be snlen) ... will solve this problem"

 The advice works on HP-UX 11.11 as well as I tested it a while ago.
 The connect() is affected too.

 Of course simply changing the variable type breaks potability of the code
 because other systems still expect socklen_t pointer :(

 At least main.c and util.c need tweaking

Responsible-Changed-From-To: pkg-manager->hpux-pkg-people
Responsible-Changed-By: obache@NetBSD.org
Responsible-Changed-When: Thu, 26 Apr 2012 13:46:34 +0000
Responsible-Changed-Why:
problem on HP-UX


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.