NetBSD Problem Report #55857

From wiz@yt.nih.at  Fri Dec 11 10:43:25 2020
Return-Path: <wiz@yt.nih.at>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 071B51A9217
	for <gnats-bugs@gnats.NetBSD.org>; Fri, 11 Dec 2020 10:43:25 +0000 (UTC)
Message-Id: <20201211104320.AE7B21CB6AA6@yt.nih.at>
Date: Fri, 11 Dec 2020 11:43:20 +0100 (CET)
From: Thomas Klausner <wiz@NetBSD.org>
Reply-To: Thomas Klausner <wiz@NetBSD.org>
To: gnats-bugs@NetBSD.org
Subject: ftp -q does not work
X-Send-Pr-Version: 3.95

>Number:         55857
>Category:       bin
>Synopsis:       ftp -q does not work
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    lukem
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Dec 11 10:45:00 +0000 2020
>Closed-Date:    Sun Jan 10 00:06:54 +0000 2021
>Last-Modified:  Fri Jan 29 21:00:02 +0000 2021
>Originator:     Thomas Klausner
>Release:        NetBSD 9.99.77
>Organization:
>Environment:


Architecture: x86_64
Machine: amd64
>Description:
ftp -q does not work.
The progressbar code also uses the SIGALRM handler but with SA_RESTART.

This needs to be changed to fix ftp -q; the code needs to handle EINTR.

The change to progressbar.c might also affect other code that also
includes this code fragment.
>How-To-Repeat:
ftp -q 60 some-ruby-server
and see that 30kB might take weeks and not finish.
>Fix:
Not provided.

>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: bin-bug-people->lukem
Responsible-Changed-By: lukem@NetBSD.org
Responsible-Changed-When: Tue, 05 Jan 2021 22:29:58 +0000
Responsible-Changed-Why:
take


State-Changed-From-To: open->feedback
State-Changed-By: lukem@NetBSD.org
State-Changed-When: Wed, 06 Jan 2021 04:45:09 +0000
State-Changed-Why:
I've refactored the ftp:// transfers to not rely upon restartable signals
(the http:// and https:// already did not), and disabled using SA_RESTART.
Please try HEAD with ftp "20210106".


From: "Luke Mewburn" <lukem@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/55857 CVS commit: src/usr.bin/ftp
Date: Wed, 6 Jan 2021 04:43:15 +0000

 Module Name:	src
 Committed By:	lukem
 Date:		Wed Jan  6 04:43:14 UTC 2021

 Modified Files:
 	src/usr.bin/ftp: ftp.c progressbar.c progressbar.h ssl.c version.h

 Log Message:
 ftp: don't use restartable signals

 Refactor to not rely upon restartable signals (SA_RESTART),
 possibly fixing intermittent failures with -q QUITTIME.

 ftp transfers: handle EINTR/EAGAIN in copy_bytes(),
 instead of relying upon restartable signals.

 http/https transfers: Explicitly print an error similar to
 progressmeter() when timing-out for -Q QUITTIME in fetch_wait(),
 and set errno to ETIMEDOUT so that the warn() in fetch_url()
 prints a more accurate error message.

 PR/55857


 To generate a diff of this commit:
 cvs rdiff -u -r1.170 -r1.171 src/usr.bin/ftp/ftp.c
 cvs rdiff -u -r1.23 -r1.24 src/usr.bin/ftp/progressbar.c
 cvs rdiff -u -r1.8 -r1.9 src/usr.bin/ftp/progressbar.h src/usr.bin/ftp/ssl.c
 cvs rdiff -u -r1.91 -r1.92 src/usr.bin/ftp/version.h

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: feedback->closed
State-Changed-By: wiz@NetBSD.org
State-Changed-When: Sun, 10 Jan 2021 00:06:54 +0000
State-Changed-Why:
Thanks for the fix!

The previously misbehaving servers are nice right now. I'll
come back to this if I find another troublesome one.


From: "Martin Husemann" <martin@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/55857 CVS commit: [netbsd-9] src/usr.bin/ftp
Date: Fri, 29 Jan 2021 20:58:19 +0000

 Module Name:	src
 Committed By:	martin
 Date:		Fri Jan 29 20:58:19 UTC 2021

 Modified Files:
 	src/usr.bin/ftp [netbsd-9]: ftp.c progressbar.c progressbar.h ssl.c
 	    version.h

 Log Message:
 Pull up following revision(s) (requested by lukem in ticket #1190):

 	usr.bin/ftp/progressbar.c: revision 1.24
 	usr.bin/ftp/ssl.c: revision 1.9
 	usr.bin/ftp/progressbar.h: revision 1.9
 	usr.bin/ftp/ftp.c: revision 1.171
 	usr.bin/ftp/version.h: revision 1.92

 ftp: don't use restartable signals

 Refactor to not rely upon restartable signals (SA_RESTART),
 possibly fixing intermittent failures with -q QUITTIME.
 ftp transfers: handle EINTR/EAGAIN in copy_bytes(),
 instead of relying upon restartable signals.

 http/https transfers: Explicitly print an error similar to
 progressmeter() when timing-out for -Q QUITTIME in fetch_wait(),
 and set errno to ETIMEDOUT so that the warn() in fetch_url()
 prints a more accurate error message.

 PR/55857


 To generate a diff of this commit:
 cvs rdiff -u -r1.168 -r1.168.2.1 src/usr.bin/ftp/ftp.c
 cvs rdiff -u -r1.23 -r1.23.2.1 src/usr.bin/ftp/progressbar.c
 cvs rdiff -u -r1.8 -r1.8.48.1 src/usr.bin/ftp/progressbar.h
 cvs rdiff -u -r1.8 -r1.8.2.1 src/usr.bin/ftp/ssl.c
 cvs rdiff -u -r1.87 -r1.87.18.1 src/usr.bin/ftp/version.h

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.46 2020/01/03 16:35:01 leot Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2020 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.