help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Pseudo-terminal will not be allocated because stdin is not a terminal.


From: Pierre Lorenzon
Subject: Pseudo-terminal will not be allocated because stdin is not a terminal.
Date: Mon, 13 Apr 2009 13:42:49 +0200 (CEST)

Hi all,

I don't know if this list is the right place to post this
question since I understand that it is not a specific emacs
question but a problem of interaction between emacs and the
system. 

Error message in the subject appears when trying to start ssh
for instance in an emacs shell. After having started emacs and
executing the command M-x shell I try to start ssh and get this
error message. 

I detected that the problem is that the subprocess bash is
started by emacs in a pipe and not in a pty. Indeed when I
evaluate (process-tty-name ...) the result is nil. When I
execute the shell command ps -u I clearly see that the bash
process is in a pipe (there is a `?' and not something like
ttyp<something>).

Sure the variable process-connection-type is set to t ! But I
read that when pty are not accessible, subprocess is started in
a pipe anyway. 

However there are pty on the system.

System is gnu linux with kernel 2.6.22.5 and in the kernel
configuration I have : 

CONFIG_UNIX98_PTYS=y
CONFIG_LEGACY_PTYS=y
CONFIG_LEGACY_PTY_COUNT=256

In the /etc/udev/rules.d/somthing.rules I have

KERNEL=="tty",          MODE="0666",    GROUP="tty"
KERNEL=="tty[0-9]*",    MODE="0666",    GROUP="tty"
KERNEL=="pty*",    MODE="0666",    GROUP="tty"

There's no .bashrc for the user doing the operations but only
a /etc/profile containing :

# Begin /etc/profile

export LANG=C
export INPUTRC=/etc/inputrc
export PS1='address@hidden \W]\$ '
export CVSROOT=:ext:address@hidden:/srv/cvs
export CVS_RSH=ssh
export TEXBIB=/usr/share/texmf/local/tex/latex/local/
export PYTHONDOCS=/usr/share/doc/Python-2.5.2/html
umask -S 0027
# End /etc/profile

Finally here is an extract of what I get when starting emacs
with strace :

open("/dev/ptyp0", O_RDWR)              = -1 EIO (Input/output error)
open("/dev/ptyp1", O_RDWR)              = -1 EIO (Input/output error)
open("/dev/ptyp2", O_RDWR)              = 3
rt_sigprocmask(SIG_BLOCK, [CHLD], [], 8) = 0
ioctl(3, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon echo ...}) = 0
ioctl(3, TIOCGPTN, [135193058])         = -1 EINVAL (Invalid argument)
fstat64(3, {st_mode=S_IFCHR|0666, st_rdev=makedev(2, 2), ...}) = 0
stat64("/dev/ttyp2", {st_mode=S_IFCHR|0660, st_rdev=makedev(3, 2), ...}) = 0
statfs("/dev/ttyp2", {f_type=0x1021994, f_bsize=4096, f_blocks=79380, 
f_bfree=79363, f_bavail=79363, f_files=79380, f_ffree=76551, f_fsid={0, 0}, 
f_namelen=255, f_frsize=4096}) = 0
ioctl(3, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon echo ...}) = 0
ioctl(3, TIOCGPTN, [-1075029688])       = -1 EINVAL (Invalid argument)
fstat64(3, {st_mode=S_IFCHR|0666, st_rdev=makedev(2, 2), ...}) = 0
stat64("/dev/ttyp2", {st_mode=S_IFCHR|0660, st_rdev=makedev(3, 2), ...}) = 0
stat64("/dev/ttyp2", {st_mode=S_IFCHR|0660, st_rdev=makedev(3, 2), ...}) = 0
getuid32()                              = 1001
chown32("/dev/ttyp2", 1001, 0)          = -1 EPERM (Operation not permitted)
clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, 
child_tidptr=0xb7dec708) = 3437
--- SIGIO (I/O possible) @ 0 (0) ---
ioctl(0, FIONREAD, [0])                 = 0
sigreturn()                             = ? (mask now [CHLD])
waitpid(3437, [{WIFEXITED(s) && WEXITSTATUS(s) == 4}], 0) = 3437
rt_sigprocmask(SIG_UNBLOCK, [CHLD], [CHLD], 8) = 0
--- SIGCHLD (Child exited) @ 0 (0) ---
wait4(-1, 0xbfec7628, WNOHANG|WSTOPPED, NULL) = -1 ECHILD (No child processes)
sigreturn()                             = ? (mask now [])
close(3)                                = 0
pipe([3, 4])                            = 0
pipe([5, 6])                            = 0
fcntl64(3, F_SETFL, O_RDONLY|O_NONBLOCK) = 0
fcntl64(6, F_SETFL, O_RDONLY|O_NONBLOCK) = 0
rt_sigaction(SIGINT, NULL, {0x80a44e0, [], SA_RESTART}, 8) = 0
rt_sigaction(SIGQUIT, NULL, {0x80a44e0, [], SA_RESTART}, 8) = 0
rt_sigprocmask(SIG_BLOCK, [INT QUIT CHLD], [], 8) = 0
vfork()                                 = 3438

The problem seems to come from this "chown32" which returns an
error.

When doing the same things on another system there's no such
"chowne" request and everything get well. 

But I could not detect any difference between the two systems :
kernel settings, udev settings, bash startup files seem to be
the same. 

Regards

Pierre





reply via email to

[Prev in Thread] Current Thread [Next in Thread]