SIGQUIT kills the child SSH process

Bug #162502 reported by John A Meinel
2
Affects Status Importance Assigned to Milestone
Bazaar
Fix Released
Medium
Martin Packman

Bug Description

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I've been seeing some odd operations when using bzr+ssh. I haven't been able to
figure out all of it, but something about doing way to much work for a simple
'bzr pull' into a bound branch.

Anyway, I tried using ^| (SIGQUIT) to debug what was going on. And it dropped
me into the debugger as expected. However, I also noticed:

/ [== ] Pull phase 0/2
^\Killed by signal 3.
** SIGQUIT received, entering debugger
** Type 'c' to continue or 'q' to stop the process

And at this point, the ssh connection has closed. If I use 'c' to continue, it
spins indefinitely expecting more data. Which is a bug in itself (if it isn't
getting any data, it should be failing with ConnectionClosed, not spinning
endlessly with 100% CPU.)

So 2 fixes:

a) SIGQUIT should be trapped for the child (I think we do this for SIGINT to
allow better cleanup.)

b) The smart server needs a bit better handling of when it gets a zero-length read.

  affects bzr
  importance medium
  status triaged

John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHOhBXJdeBCYSNAAMRAjADAKCydmPQhJrwAuhHuHkOFu9Pyjwe0gCdG3rx
7HuasNdR8PEhyHpIlPJKts8=
=gcv7
-----END PGP SIGNATURE-----

Related branches

Revision history for this message
Martin Pool (mbp) wrote :

This was related to bug 341535 which now has a patch, but this issue still exists.

Revision history for this message
Martin Packman (gz) wrote :

Seems a simple change to make this work, before:

** SIGQUIT received, entering debuggerns:Get stream source
** Type 'c' to continue or 'q' to stop the process
** Or SIGQUIT again to quit (and possibly dump core)
> /usr/lib/python2.5/site-packages/bzrlib/breakin.py(41)_debug()
-> signal.signal(_breakin_signal_number, _debug)
(Pdb) c
bzr: ERROR: Connection closed: Unexpected end of message. Please check connectivity and permissions, and report a bug if problems persist.

After:

** SIGQUIT received, entering debuggerns:Inserting stream
** Type 'c' to continue or 'q' to stop the process
** Or SIGQUIT again to quit (and possibly dump core)
> /home/martin/tmpbzr/bzrlib/breakin.py(41)_debug()
-> signal.signal(_breakin_signal_number, _debug)
(Pdb) c

** SIGQUIT received, entering debuggerns:Inserting stream
** Type 'c' to continue or 'q' to stop the process
** Or SIGQUIT again to quit (and possibly dump core)
> /home/martin/tmpbzr/bzrlib/breakin.py(41)_debug()
-> signal.signal(_breakin_signal_number, _debug)
(Pdb) c
bzr: interrupted

Changed in bzr:
assignee: nobody → Martin [gz] (gz)
Revision history for this message
Martin Packman (gz) wrote :

Seperate change that addresses the same problem on windows, by detaching the child process from the parent console. I don't think this should cause the sort of problems (like bug 40508) that setting the process group did on nix, as prompts are currently broken anyway (as in 414743). However, it does cause a change in how the progress is displayed - it loses the 'bar' bit - for reasons I haven't had a chance to try and understand yet.

Martin Pool (mbp)
Changed in bzr:
milestone: none → 2.2.0b1
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.