gnome-terminal fails to open new pty, does all I/O via parent
Submitted by gal..@..ke.edu
Assigned to anthony taranto
Description
When gnome-terminal is started, it never fully opens its new pty and all i/o is done via the parent. The user sees a blank window that one cannot type in.
You see this when you start it (note transcript is all from same xterm):
<12:03am>thunder/gallatin:~>tty;echo $$ /dev/ttyp6 97527 <12:03am>thunder/gallatin:~>gnome-terminal Warning: no access to tty (Inappropriate ioctl for device). Thus no job control in this shell. tcsh 6.10.00 (Astron) 2000-11-19 (alpha-digital-FreeBSD) options 8b,nls,dl,al,kan,sm,rh,color,dspm setting up context sens completions....done gallatin has logged on ttyp0 from :0.0 gallatin has logged on ttyp7 from :0.0 gallatin has logged on ttyv0 from local <12:03am>thunder/gallatin:~>tty;echo $$ /dev/ttyp6 97547 <12:04am>thunder/gallatin:~>exit
This is happening because of a bug in gnome-pty-helper. CONTROLLEN is set too small for a 64-bit platform and the fd is never passed by pass_fd, so its is received as garbage by receive_fd. See the following ktrace (debugging printf() instserted in code for clarity): <....> 12728 gnome-terminal CALL recvmsg(0x7,0x11ffae68,0) 12728 gnome-terminal GIO fd 7 read 1 byte "X" 12728 gnome-terminal RET recvmsg 1 12728 gnome-terminal CALL write(0x1,0x1200a5400,0x11) 12728 gnome-terminal GIO fd 1 wrote 17 bytes "got FD: 54410240 " 12728 gnome-terminal RET write 17/0x11 12728 gnome-terminal CALL fork 12728 gnome-terminal RET fork 12730/0x31ba 12728 gnome-terminal CALL close(0x33e3c00) 12728 gnome-terminal RET close -1 errno 9 Bad file descriptor 12728 gnome-terminal CALL pipe 12728 gnome-terminal RET pipe 9 12728 gnome-terminal CALL wait4(0x31ba,0x11ffaf6c,0x3,0) 12728 gnome-terminal RET wait4 0 12728 gnome-terminal CALL fcntl(0x33e3c00,0x4,0x4) 12728 gnome-terminal RET fcntl -1 errno 9 Bad file descriptor 12728 gnome-terminal CALL ioctl(0x33e3c00,TIOCSWINSZ,0x11ffaf88) 12728 gnome-terminal RET ioctl -1 errno 9 Bad file descriptor <...>
The follwing patch appears to fix the problem here:
--- zvt/subshell.c~ Mon May 22 17:24:16 2000 +++ zvt/subshell.c Sun Aug 5 11:35:50 2001 @@ -102,7 +102,7 @@ #endif /* CMSG_DATA */
static struct cmsghdr *cmptr; -#define CONTROLLEN sizeof (struct cmsghdr) + sizeof (int) +#define CONTROLLEN sizeof (struct cmsghdr) + sizeof (long)
static int receive_fd (int helper_fd) --- zvt/gnome-pty-helper.c~ Tue Jul 31 02:48:56 2001 +++ zvt/gnome-pty-helper.c Sun Aug 5 11:37:41 2001 @@ -116,7 +116,7 @@ #endif #endif /* CMSG_DATA */
-#define CONTROLLEN (sizeof (struct cmsghdr) + sizeof (int)) +#define CONTROLLEN (sizeof (struct cmsghdr) + sizeof (long))
static struct cmsghdr *cmptr;
Thanks for your help,
Drew
Version: 2.0.x
Resolution: RESOLVED FIXED