all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Sean McAfee <eefacm@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: Weird interaction between chroot jail and shell-mode
Date: Mon, 01 Nov 2010 12:29:00 -0700	[thread overview]
Message-ID: <bp8aalskflv.fsf@usca1uw-JZWWPM1.sanmateo.corp.akamai.com> (raw)
In-Reply-To: m2iq0j1llv.fsf@gmail.com

Sean McAfee <eefacm@gmail.com> writes:
> This is probably the most perplexing Emacs issue I've ever
> encountered...
>
> I've been trying to build the debian "apt" package in a shell-mode bash
> shell, inside of which I've entered a chroot jail.  The build process
> (initiated with the command "dpkg-buildpackage") would reach a point
> where it executes the command:
>
>   po4a --previous --no-backups po4a.conf
>
> ...whereupon the command hangs, consuming 100% of the CPU until I kill
> it.

Well, I guess this is pretty much solved...

On investigating the po4a command, which is a Perl program, I found that
the hanging was occuring in a call to a function called "wrap_msg."
Ultimately this routine uses the terminal size reported by the
GetTerminalSize function in the standard Term::ReadKey module, which in
a shell-mode shell explicitly reports a screen width and height of zero.
Small wonder that a trusting wrapping function would get stuck in an
infinite loop...

But then, why would I still be able to build successfully in a
shell-mode shell outside of a chroot jail?  Because wrap_msg will check
the COLUMNS environment variable, and use that if it's set instead of
calling Term::ReadKey::GetTerminalSize.  Outside of the chroot, my
COLUMNS variable is set correctly.  Inside, however it is that the root
user's shell environment gets set up, COLUMNS is set as a shell
variable, but it is not exported as an environment variable.  Adding an
"export COLUMNS" to the end of the chrooted root user's .bashrc file
fixed the hanging problem.

Ultimately, this would seem to be Term::ReadKey's fault.  It advertises
a way to indicate that the terminal size could not be
determined--returning an empty list--but instead it returns nonsensical
screen dimensions of 0x0.


  reply	other threads:[~2010-11-01 19:29 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-30 20:17 Weird interaction between chroot jail and shell-mode Sean McAfee
2010-11-01 19:29 ` Sean McAfee [this message]
2010-11-03 22:25   ` Ilya Zakharevich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bp8aalskflv.fsf@usca1uw-JZWWPM1.sanmateo.corp.akamai.com \
    --to=eefacm@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.