FS#44073 - [arch-install-scripts] arch-chroot crashes if using zsh inside the chroot

Attached to Project: Arch Linux
Opened by John (graysky) - Friday, 06 March 2015, 19:31 GMT
Last edited by Dave Reisner (falconindy) - Saturday, 07 March 2015, 17:15 GMT
Task Type Bug Report
Category Arch Projects
Status Closed
Assigned To Dave Reisner (falconindy)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

When using this script to chroot into an Arch partition where any user (root or otherwise) is using zsh within the chroot, hitting ctrl+c causes the script to break and quit resulting in the following output and leaving /target/dev/pts /target/dev mounted.

Note when using bash, I cannot get this error so I believe it's related to using zsh.
% sudo arch-chroot /mnt/mini /bin/zsh
#
<<hit ctrl-c>>
# umount: /mnt/mini/dev/pts: target is busy
(In some cases useful info about processes that
use the device is found by lsof(8) or fuser(1).)
umount: /mnt/mini/dev: target is busy
(In some cases useful info about processes that
use the device is found by lsof(8) or fuser(1).)
%
zsh: error on TTY read: Input/output error


Steps to reproduce:
1) Mount an Arch partition and install 'zsh' and 'grml-zsh-config' within it
2) Execute the chroot command from another Arch env: sudo arch-chroot /mnt/mini /bin/zsh
3) Hit ctrl+c in the chroot
This task depends upon

Closed by  Dave Reisner (falconindy)
Saturday, 07 March 2015, 17:15 GMT
Reason for closing:  Upstream
Additional comments about closing:  Needs to be fixed in ZSH proper, not papered over in arch-install-scripts.
Comment by Dave Reisner (falconindy) - Saturday, 07 March 2015, 16:36 GMT
Not a bug in arch-install-scripts -- any sane shell should be capable of defending itself against SIGINT. You can boil this down to:

# unshare --fork --pid /bin/zsh
# ^C

I tried several other shells: mksh, bash, dash, fish, and tcsh. None of them suffer from this deficiency.

Please file a bug upstream to ZSH.
Comment by John (graysky) - Saturday, 07 March 2015, 16:39 GMT
Thanks for the troubleshooting. Can you provide me when a little more info so I can open a more descriptive bug upstream zsh?
Comment by Dave Reisner (falconindy) - Saturday, 07 March 2015, 16:44 GMT
I guess ZSH doesn't like being PID 1. I don't know anything more than that.

Loading...