Bug#819365: assword gui fails to start when stderr is closed

2016-03-27 Thread Joey Hess
The reason my WM did not have stderr/stdout available is, I had started
it from a terminal, disowned it, and then closed the terminal. So,
stderr was pointing at /dev/pts/2, which had been deallocated.

That's probably not an entirely original way to shoot oneself in the
foot; I'm sure I've done that plenty of times before and just didn't try
to run anything from the WM that expected to be able to write to stderr.

-- 
see shy jo


signature.asc
Description: PGP signature


Bug#819365: assword gui fails to start when stderr is closed

2016-03-27 Thread Jameson Graef Rollins
On Sun, Mar 27 2016, Joey Hess  wrote:
> Had a weird thing where my window manager's hotkey to start assword gui
> stopped doing anything. Apparently assword is trying to print out a warning
> (WARNING: could not validate OpenPGP signature on db file) and for some reason
> stderr is closed, so it crashes
>
> write(2, "print >>sys.stderr, \"WARNING: co"..., 80) = -1 EIO (Input/output 
> error)
> close(4)= 0
> munmap(0x7fea62219000, 4096)= 0
> write(2, "IOError", 7)  = -1 EIO (Input/output error)
> write(2, ": ", 2)   = -1 EIO (Input/output error)
> write(2, "[Errno 5] Input/output error", 28) = -1 EIO (Input/output error)
> write(2, "\n", 1)   = -1 EIO (Input/output error)
>
> I have no idea why my window manager is suddenly running the program with a
> closed or unwritable stderr, but probably crashing in this situation is not
> useful, so how about you catch this exception so that the gui can still
> display. Especially since the gui helpfully displays the same warning..

Hey, Joey.  I'm trying to decide how reasonable it is for a program to
expect that stderr be available, and what exactly it should do if it's
not.  Having to wrap all stderr write attempts with catches for this
kind of thing seems a bit onerous to me, even for guis.  Are we sure
this isn't just a issue that should be addressed with the window
manager?

To be clear, I'm open to catching this in assword as you suggest, but I
would like to understand the expectation for stderr (or stdout for that
matter) availability.

Just out of curiosity, what window manager are you using?

jamie.


signature.asc
Description: PGP signature


Bug#819365: assword gui fails to start when stderr is closed

2016-03-27 Thread Joey Hess
Package: assword
Version: 0.8-2.1
Severity: normal

Had a weird thing where my window manager's hotkey to start assword gui
stopped doing anything. Apparently assword is trying to print out a warning
(WARNING: could not validate OpenPGP signature on db file) and for some reason
stderr is closed, so it crashes

write(2, "print >>sys.stderr, \"WARNING: co"..., 80) = -1 EIO (Input/output 
error)
close(4)= 0
munmap(0x7fea62219000, 4096)= 0
write(2, "IOError", 7)  = -1 EIO (Input/output error)
write(2, ": ", 2)   = -1 EIO (Input/output error)
write(2, "[Errno 5] Input/output error", 28) = -1 EIO (Input/output error)
write(2, "\n", 1)   = -1 EIO (Input/output error)

I have no idea why my window manager is suddenly running the program with a
closed or unwritable stderr, but probably crashing in this situation is not
useful, so how about you catch this exception so that the gui can still
display. Especially since the gui helpfully displays the same warning..

To reproduce:

joey@darkstar:~>assword gui 2>/dev/full
- exit 1

-- System Information:
Debian Release: stretch/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.4.0-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.utf8, LC_CTYPE=en_US.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages assword depends on:
ii  python2.7.11-1
ii  python-gpgme  0.3-1.1+b1
ii  python-gtk2   2.24.0-4
ii  python-pkg-resources  20.1.1-1

Versions of packages assword recommends:
ii  python-xdo  0.2-2
ii  xclip   0.12+svn84-4

assword suggests no packages.

-- no debconf information

-- 
see shy jo


signature.asc
Description: PGP signature