Re: pkg_add "signify: write to stdout: Broken pipe"

2016-11-23 Thread Martin Natano
On Tue, Nov 22, 2016 at 04:21:58PM +0100, Marc Espie wrote:
> I'm pretty sure you have something funky in your shell,
> I've been able to reproduce this finally.
>
> $ trap "" PIPE
> $ $ pkg_add -nuix screen-- 
> quirks-2.270 signed on 2016-11-21T13:44:48Z
> Error from 
> http://ftp.fr.openbsd.org/pub/OpenBSD/snapshots/packages/amd64/screen-4.0.3p6.tgz
> signify: write to stdout: Broken pipe
> Error from 
> http://ftp.fr.openbsd.org/pub/OpenBSD/snapshots/packages/amd64/screen-4.0.3p6-shm.tgz
> signify: write to stdout: Broken pipe
> 
> which is more or less what you see...
> 
> somehow you've got a shell with PIPE deleted, and perl inherits it...
> 

Thank you for investigating! I believe this is not caused by my shell
config, but the X window manager I use (spectrwm). My .profile is
standard except for setting PS1, EDITOR, PAGER, HISTFILE and some
aliases. Spectrwm on the other hand does signal(SIGPIPE, SIG_IGN) and
doesn't reset the signal handlers before spawning a terminal with
execvp(). That would explain why SIGPIPE is ignored in a plain xterm,
but not in the console and in tmux, which does clear the signals before
spawning a new process. Oh my.

> 
> So, let's make sure the signal is set correctly where it matters...
> 
> Martin, tell me whether this fixes your issue.

Yes, it does, thanks.


> 
> Index: OpenBSD/PackageRepository.pm
> ===
> RCS file: 
> /build/data/openbsd/cvs/src/usr.sbin/pkg_add/OpenBSD/PackageRepository.pm,v
> retrieving revision 1.138
> diff -u -p -r1.138 PackageRepository.pm
> --- OpenBSD/PackageRepository.pm  5 Oct 2016 13:50:20 -   1.138
> +++ OpenBSD/PackageRepository.pm  22 Nov 2016 15:15:29 -
> @@ -239,6 +239,7 @@ sub open
>  
>   # kill old files if too many
>   my $already = $self->make_room;
> + local $SIG{'PIPE'} = 'DEFAULT';
>   my $fh = $self->open_pipe($object);
>   if (!defined $fh) {
>   return;



Re: pkg_add "signify: write to stdout: Broken pipe"

2016-10-12 Thread Martin Natano
On Wed, Oct 12, 2016 at 11:21:51AM +0200, Marc Espie wrote:
> 
> Hum, what does it say if you remove the signify step, e.g.,
> pkg_add -Dunsigned ?

natano@watschnbaum:~$ pkg_add -Dunsigned -nuix vim
natano@watschnbaum:~$ ^D



Re: pkg_add "signify: write to stdout: Broken pipe"

2016-10-12 Thread Marc Espie
On Wed, Oct 12, 2016 at 10:24:25AM +0100, Stuart Henderson wrote:
> On 2016/10/12 11:09, Marc Espie wrote:
> > On Wed, Oct 12, 2016 at 10:51:59AM +0200, Martin Natano wrote:
> > > I've seen this since the new signing method has been implemented. I
> > > blamed it on something being out of date/sync on my machine, but after
> > > updating to the latest snapshot yesterday (the one from ftp.fr) it
> > > becomes clear that either something is seriously hosed on my system or
> > > there is an issue in pkg_add or signify.
> > > 
> > > I see this when calling pkg_add directly in xterm or script, but not
> > > when called inside tmux.
> > > 
> > > 
> > > xterm/script:
> > > 
> > > natano@watschnbaum:~$ pkg_add -nuix vim
> > > quirks-2.261 signed on 2016-10-11T14:06:48Z
> > > Error from 
> > > http://ftp.fr.openbsd.org/pub/OpenBSD/snapshots/packages/amd64/vim-8.0.0004-gtk2-perl-python3-ruby.tgz
> > > signify: write to stdout: Broken pipe
> > 
> > I don't see any of this here.
> > 
> 
> I've seen it sometimes with some packages, but not in the last few updates.
> 
> There's cvs:~sthen/ktrace.out.gz from one failing run. This one was from
> ftp.fr but I've seen it from other servers (including ftp.openbsd.org)
> too.
> 
> The EPIPE to signify occured after this:
> 
>  29287 perl CALL  write(1,0x8e2d000,0x39)
>  29287 perl GIO   fd 1 wrote 57 bytes
>"\rChecking packages|No change in calc-2.12.5.4 (1/2)\^[[K\^[[K"
>  29287 perl RET   write 57/0x39
>  29287 perl CALL  lseek(6,0x9647,SEEK_SET)
>  29287 perl RET   lseek -1 errno 29 Illegal seek
>  29287 perl CALL  close(6)
>  29287 perl RET   close 0
>  29287 perl CALL  wait4(53158,0x7f7ddd44,0<>,0)

Hum... there might be a seek somewhere within the unpacking code, because
it's definitely not in pkg_add proper.



Re: pkg_add "signify: write to stdout: Broken pipe"

2016-10-12 Thread Stuart Henderson
On 2016/10/12 11:09, Marc Espie wrote:
> On Wed, Oct 12, 2016 at 10:51:59AM +0200, Martin Natano wrote:
> > I've seen this since the new signing method has been implemented. I
> > blamed it on something being out of date/sync on my machine, but after
> > updating to the latest snapshot yesterday (the one from ftp.fr) it
> > becomes clear that either something is seriously hosed on my system or
> > there is an issue in pkg_add or signify.
> > 
> > I see this when calling pkg_add directly in xterm or script, but not
> > when called inside tmux.
> > 
> > 
> > xterm/script:
> > 
> > natano@watschnbaum:~$ pkg_add -nuix vim
> > quirks-2.261 signed on 2016-10-11T14:06:48Z
> > Error from 
> > http://ftp.fr.openbsd.org/pub/OpenBSD/snapshots/packages/amd64/vim-8.0.0004-gtk2-perl-python3-ruby.tgz
> > signify: write to stdout: Broken pipe
> 
> I don't see any of this here.
> 

I've seen it sometimes with some packages, but not in the last few updates.

There's cvs:~sthen/ktrace.out.gz from one failing run. This one was from
ftp.fr but I've seen it from other servers (including ftp.openbsd.org)
too.

The EPIPE to signify occured after this:

 29287 perl CALL  write(1,0x8e2d000,0x39)
 29287 perl GIO   fd 1 wrote 57 bytes
   "\rChecking packages|No change in calc-2.12.5.4 (1/2)\^[[K\^[[K"
 29287 perl RET   write 57/0x39
 29287 perl CALL  lseek(6,0x9647,SEEK_SET)
 29287 perl RET   lseek -1 errno 29 Illegal seek
 29287 perl CALL  close(6)
 29287 perl RET   close 0
 29287 perl CALL  wait4(53158,0x7f7ddd44,0<>,0)



Re: pkg_add "signify: write to stdout: Broken pipe"

2016-10-12 Thread Marc Espie
On Wed, Oct 12, 2016 at 11:09:30AM +0200, Marc Espie wrote:
> On Wed, Oct 12, 2016 at 10:51:59AM +0200, Martin Natano wrote:
> > I've seen this since the new signing method has been implemented. I
> > blamed it on something being out of date/sync on my machine, but after
> > updating to the latest snapshot yesterday (the one from ftp.fr) it
> > becomes clear that either something is seriously hosed on my system or
> > there is an issue in pkg_add or signify.
> > 
> > I see this when calling pkg_add directly in xterm or script, but not
> > when called inside tmux.
> > 
> > 
> > xterm/script:
> > 
> > natano@watschnbaum:~$ pkg_add -nuix vim
> > quirks-2.261 signed on 2016-10-11T14:06:48Z
> > Error from 
> > http://ftp.fr.openbsd.org/pub/OpenBSD/snapshots/packages/amd64/vim-8.0.0004-gtk2-perl-python3-ruby.tgz
> > signify: write to stdout: Broken pipe
> 
> I don't see any of this here.

Hum, what does it say if you remove the signify step, e.g.,
pkg_add -Dunsigned ?



Re: pkg_add "signify: write to stdout: Broken pipe"

2016-10-12 Thread Marc Espie
On Wed, Oct 12, 2016 at 10:51:59AM +0200, Martin Natano wrote:
> I've seen this since the new signing method has been implemented. I
> blamed it on something being out of date/sync on my machine, but after
> updating to the latest snapshot yesterday (the one from ftp.fr) it
> becomes clear that either something is seriously hosed on my system or
> there is an issue in pkg_add or signify.
> 
> I see this when calling pkg_add directly in xterm or script, but not
> when called inside tmux.
> 
> 
> xterm/script:
> 
> natano@watschnbaum:~$ pkg_add -nuix vim
> quirks-2.261 signed on 2016-10-11T14:06:48Z
> Error from 
> http://ftp.fr.openbsd.org/pub/OpenBSD/snapshots/packages/amd64/vim-8.0.0004-gtk2-perl-python3-ruby.tgz
> signify: write to stdout: Broken pipe

I don't see any of this here.



pkg_add "signify: write to stdout: Broken pipe"

2016-10-12 Thread Martin Natano
I've seen this since the new signing method has been implemented. I
blamed it on something being out of date/sync on my machine, but after
updating to the latest snapshot yesterday (the one from ftp.fr) it
becomes clear that either something is seriously hosed on my system or
there is an issue in pkg_add or signify.

I see this when calling pkg_add directly in xterm or script, but not
when called inside tmux.


xterm/script:

natano@watschnbaum:~$ pkg_add -nuix vim
quirks-2.261 signed on 2016-10-11T14:06:48Z
Error from 
http://ftp.fr.openbsd.org/pub/OpenBSD/snapshots/packages/amd64/vim-8.0.0004-gtk2-perl-python3-ruby.tgz
signify: write to stdout: Broken pipe
Error from 
http://ftp.fr.openbsd.org/pub/OpenBSD/snapshots/packages/amd64/vim-8.0.0004-gtk2-lua.tgz
signify: write to stdout: Broken pipe
Error from 
http://ftp.fr.openbsd.org/pub/OpenBSD/snapshots/packages/amd64/vim-8.0.0004-no_x11-lua.tgz
signify: write to stdout: Broken pipe
Error from 
http://ftp.fr.openbsd.org/pub/OpenBSD/snapshots/packages/amd64/vim-8.0.0004-no_x11-perl-python3-ruby.tgz
signify: write to stdout: Broken pipe
Error from 
http://ftp.fr.openbsd.org/pub/OpenBSD/snapshots/packages/amd64/vim-8.0.0004-no_x11-ruby.tgz
signify: write to stdout: Broken pipe
Error from 
http://ftp.fr.openbsd.org/pub/OpenBSD/snapshots/packages/amd64/vim-8.0.0004-gtk2-perl-python-ruby.tgz
signify: write to stdout: Broken pipe
Error from 
http://ftp.fr.openbsd.org/pub/OpenBSD/snapshots/packages/amd64/vim-8.0.0004-no_x11.tgz
signify: write to stdout: Broken pipe
Error from 
http://ftp.fr.openbsd.org/pub/OpenBSD/snapshots/packages/amd64/vim-8.0.0004-no_x11-perl-python-ruby.tgz
signify: write to stdout: Broken pipe
Error from 
http://ftp.fr.openbsd.org/pub/OpenBSD/snapshots/packages/amd64/vim-8.0.0004-gtk2.tgz
signify: write to stdout: Broken pipe
natano@watschnbaum:~$ ^D

The same errors are shown when called without -inx by root.


tmux:

natano@watschnbaum:~$ pkg_add -nui vim 
quirks-2.261 signed on 2016-10-11T14:06:48Z
natano@watschnbaum:~$ ^D


I tried to look into this myself, but got stuck due to my non-existent
perl skills.

natano


pkg.conf:
installpath = http://ftp.fr.openbsd.org/pub/OpenBSD/snapshots/packages/%a/


BUILDINFO:
Build date: 1476119003 - Mon Oct 10 17:03:23 UTC 2016