On Sat, Aug 06, 2016 at 08:42:35PM -0400, Michael Reed wrote:
> >Synopsis: Resizing terminal during "pkg_add -u" causes package to not be
> >updated
> >Category: user
> >Environment:
> System : OpenBSD 6.0
> Details : OpenBSD 6.0-current (GENERIC.MP) #2323: Fri Aug 5
> 16:08:20 MDT 2016
>
> [email protected]:/usr/src/sys/arch/amd64/compile/GENERIC.MP
>
> Architecture: OpenBSD.amd64
> Machine : amd64
> >Description:
> When running "pkg_add -u" in a terminal, resizing the terminal causes
> the the
> current package being checked by pkg_add to be skipped. For example,
> let's say
> I have 25 packages installed, one of which is x11/st; when I run
> "pkg_add -u",
> pkg_add iterates through that list of 25 packages, checking each local
> package
> against a remote version for updates. If I resize the terminal while
> pkg_add is
> checking x11/st for updates, two error messages should be printed:
>
> Error from
> http://example.mirrror.org/pub/OpenBSD/snapshots/packages/amd64/st-0.6p1.tgz
> ftp: connect: Address already in use
>
> If an update was available, it won't be installed; that will require
> running
> "pkg_add -u st" after the first command invocation finishes.
>
> >How-To-Repeat:
> - Open an X11 session; I use Xfce, but I can reproduce the problem in
> i3, too
> - Open terminal emulator; I tested with x11/xfce4/terminal and x11/st
> - Run the command "pkg_add -u" as root
> - Once the package updating process has started, resize the terminal a
> few times,
> which should print error messages like these (ignore the Ctrl-C at
> the end):
>
> $ doas pkg_add -u
> doas ([email protected]) password:
> quirks-2.241 signed on 2016-08-06T12:28:03Z
> Error from
> http://mirror.jmu.edu/pub/OpenBSD/snapshots/packages/amd64/claws-mail-3.13.2p2.tgz
> ftp: connect: Address already in use
> Error from
> http://mirror.jmu.edu/pub/OpenBSD/snapshots/packages/amd64/consolekit2-1.0.2.tgz
> ftp: connect: Address already in use
> Fatal error: Caught SIGINT
> at /usr/libdata/perl5/OpenBSD/AddDelete.pm line 40.
> $
>
> >Fix:
> Not known.
>
Not pkg_add's fault.
It's ftp that fucks up.
Thanks to natano@ for looking. It seems connect does not restart correctly.
Relevant ktrace dump
79798 ftp CALL connect(3,0x112fbf436eb0,16)
79798 ftp STRU struct sockaddr { AF_INET, 137.208.8.135:80 }
79798 ftp PSIG SIGWINCH caught handler=0x112d4211a680 mask=0<>
79798 ftp RET connect -1 errno 4 Interrupted system call
79798 ftp CALL ioctl(1,TIOCGWINSZ,0x7f7ffffe2580)
79798 ftp RET ioctl 0
79798 ftp CALL sigreturn(0x7f7ffffe25a0)
79798 ftp RET sigreturn JUSTRETURN
79798 ftp CALL connect(3,0x112fbf436eb0,16)
79798 ftp STRU struct sockaddr { AF_INET, 137.208.8.135:80 }
79798 ftp RET connect -1 errno 48 Address already in use
*BOOM*