public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* gnome-terminal acts funny in recent 2.5 series
@ 2002-02-19  0:03 Alessandro Suardi
  2002-02-19  0:39 ` Gustavo Noronha Silva
  2002-02-19 11:44 ` OGAWA Hirofumi
  0 siblings, 2 replies; 10+ messages in thread
From: Alessandro Suardi @ 2002-02-19  0:03 UTC (permalink / raw)
  To: linux-kernel

Running Ximian-latest for rh72/i386, latest 2.5 kernels (including
  2.5.4-pre2, 2.5.4, 2.5.5-pre1).

Symptom:
   - clicking on the panel icon for gnome-terminal shows a flicker
      of the terminal window coming up then the window disappears.
     No leftover processes.

What works 100%:
   - regular xterm in 2.5.x
   - gnome-terminal in 2.4.x (x in .17, .18-pre9, .18-rc2)

More info:
   - doesn't happen 100% of the time, but close
   - trying to start gnome-terminal either vanilla or with the
      parameters in the icon from an xterm causes
       * gnome-terminal window comes up, but no shell prompt; the
          window *does not* disappear and program is in a CPU loop
       * program detaches from calling xterm even when '&' is
          not used
       * calling xterm's tty is left in a funny state (sometimes
          stty sane^J is required, sometimes tput reset)

Any ideas would be quite welcome - I can go back and try and narrow
  down what kernel breaks gnome-terminal if nothing comes up.


Thanks,

--alessandro

  "If your heart is a flame burning brightly
    you'll have light and you'll never be cold
   And soon you will know that you just grow / You're not growing old"
                               (Husker Du, "Flexible Flyer")


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: gnome-terminal acts funny in recent 2.5 series
  2002-02-19  0:03 gnome-terminal acts funny in recent 2.5 series Alessandro Suardi
@ 2002-02-19  0:39 ` Gustavo Noronha Silva
  2002-02-19  4:00   ` Wayne Whitney
  2002-02-19  6:13   ` Sebastian Dröge
  2002-02-19 11:44 ` OGAWA Hirofumi
  1 sibling, 2 replies; 10+ messages in thread
From: Gustavo Noronha Silva @ 2002-02-19  0:39 UTC (permalink / raw)
  To: linux-kernel@vger.kernel.org

On Tue, 19 Feb 2002 01:03:13 +0100
Alessandro Suardi <alessandro.suardi@oracle.com> wrote:

> Running Ximian-latest for rh72/i386, latest 2.5 kernels (including
>   2.5.4-pre2, 2.5.4, 2.5.5-pre1).
> 
> Symptom:
>    - clicking on the panel icon for gnome-terminal shows a flicker
>       of the terminal window coming up then the window disappears.
>      No leftover processes.
> 
> What works 100%:
>    - regular xterm in 2.5.x
>    - gnome-terminal in 2.4.x (x in .17, .18-pre9, .18-rc2)
I noticed this problem also... it seems the problem lies on
devpts, I enabled it on my 2.5.5pre1 build, mounting
devpts with the options given on the "readme" file
made gnome-terminal start on the second try, almost
everytime

[]s!

-- 
    Gustavo Noronha Silva - kov <http://www.metainfo.org/kov>
*---------* -+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-+-+
|  .''`.  | Debian GNU/Linux: <http://www.debian.org>         |
| : :'  : + Debian BR.......: <http://debian-br.cipsga.org.br>+
| `. `'`  + Q: "Why did the chicken cross the road?"          +
|   `-    | A: "Upstream's decision." -- hmh                  |
*---------* -+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-+-+

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: gnome-terminal acts funny in recent 2.5 series
  2002-02-19  0:39 ` Gustavo Noronha Silva
@ 2002-02-19  4:00   ` Wayne Whitney
  2002-02-19 12:48     ` Sebastian Dröge
  2002-02-19  6:13   ` Sebastian Dröge
  1 sibling, 1 reply; 10+ messages in thread
From: Wayne Whitney @ 2002-02-19  4:00 UTC (permalink / raw)
  To: Gustavo Noronha Silva, Alessandro Suardi; +Cc: linux-kernel

In mailing-lists.linux-kernel, Gustavo wrote:

> I noticed this problem also... it seems the problem lies on
> devpts, I enabled it on my 2.5.5pre1 build, mounting
> devpts with the options given on the "readme" file
> made gnome-terminal start on the second try, almost
> everytime

I also am seeing this problem--it is definitely pts related.  I have
noticed that when the problem occurs, if I execute "gnome-terminal &"
from an existing gnome-terminal, a new window comes up, but input and
output from the new shell are still going to the prior gnome-terminal.
'ps' shows both the new gnome-terminal and old gnome-terminal on the
same pts.  But sometimes everything works fine.

Cheers, Wayne


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: gnome-terminal acts funny in recent 2.5 series
  2002-02-19  0:39 ` Gustavo Noronha Silva
  2002-02-19  4:00   ` Wayne Whitney
@ 2002-02-19  6:13   ` Sebastian Dröge
  1 sibling, 0 replies; 10+ messages in thread
From: Sebastian Dröge @ 2002-02-19  6:13 UTC (permalink / raw)
  To: Gustavo Noronha Silva; +Cc: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1374 bytes --]

On Mon, 18 Feb 2002 21:39:17 -0300
Gustavo Noronha Silva <kov@debian.org> wrote:

> On Tue, 19 Feb 2002 01:03:13 +0100
> Alessandro Suardi <alessandro.suardi@oracle.com> wrote:
> 
> > Running Ximian-latest for rh72/i386, latest 2.5 kernels (including
> >   2.5.4-pre2, 2.5.4, 2.5.5-pre1).
> > 
> > Symptom:
> >    - clicking on the panel icon for gnome-terminal shows a flicker
> >       of the terminal window coming up then the window disappears.
> >      No leftover processes.
> > 
> > What works 100%:
> >    - regular xterm in 2.5.x
> >    - gnome-terminal in 2.4.x (x in .17, .18-pre9, .18-rc2)
> I noticed this problem also... it seems the problem lies on
> devpts, I enabled it on my 2.5.5pre1 build, mounting
> devpts with the options given on the "readme" file
> made gnome-terminal start on the second try, almost
> everytime
Hi,
I have the same problem here... I reported it in another thread (look at "Reiserfs Corruption in 2.5.5-pre1")
Maybe it's something with devpts but I enabled only devfs...
If you start the gnome-terminal from an xterm for example it starts but hangs before or shortly after loading bash
Sometimes gnome-terminal starts without problems but most trys it hangs
If you strace gnome-terminal you can see an endless loop doing some funny things (I have deleted the output but I'll post it later the day, including "ps axlwww" output)

Bye

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: gnome-terminal acts funny in recent 2.5 series
  2002-02-19  0:03 gnome-terminal acts funny in recent 2.5 series Alessandro Suardi
  2002-02-19  0:39 ` Gustavo Noronha Silva
@ 2002-02-19 11:44 ` OGAWA Hirofumi
  2002-02-19 15:09   ` Dave Jones
  1 sibling, 1 reply; 10+ messages in thread
From: OGAWA Hirofumi @ 2002-02-19 11:44 UTC (permalink / raw)
  To: Alessandro Suardi; +Cc: linux-kernel, David S. Miller

[-- Attachment #1: Type: text/plain, Size: 1915 bytes --]

Alessandro Suardi <alessandro.suardi@oracle.com> writes:

> Running Ximian-latest for rh72/i386, latest 2.5 kernels (including
>   2.5.4-pre2, 2.5.4, 2.5.5-pre1).
> 
> Symptom:
>    - clicking on the panel icon for gnome-terminal shows a flicker
>       of the terminal window coming up then the window disappears.
>      No leftover processes.
> 
> What works 100%:
>    - regular xterm in 2.5.x
>    - gnome-terminal in 2.4.x (x in .17, .18-pre9, .18-rc2)
> 
> More info:
>    - doesn't happen 100% of the time, but close
>    - trying to start gnome-terminal either vanilla or with the
>       parameters in the icon from an xterm causes
>        * gnome-terminal window comes up, but no shell prompt; the
>           window *does not* disappear and program is in a CPU loop
>        * program detaches from calling xterm even when '&' is
>           not used
>        * calling xterm's tty is left in a funny state (sometimes
>           stty sane^J is required, sometimes tput reset)
> 
> Any ideas would be quite welcome - I can go back and try and narrow
>   down what kernel breaks gnome-terminal if nothing comes up.

Probably, this problem had occurred in libzvt which gnome-terminal is
using.

libzvt was using file descriptor passing via UNIX domain socket for
pseudo terminal. Then because ->passcred was not initialized in
sock_alloc(), unexpected credential data was passing to libzvt.

The following patch fixed this problem, but I'm not sure.
Could you review the patch? (attached file are test program)

--- socket.c.orig	Mon Feb 11 18:21:59 2002
+++ socket.c	Tue Feb 19 16:20:18 2002
@@ -501,6 +501,8 @@ struct socket *sock_alloc(void)
 	sock->ops = NULL;
 	sock->sk = NULL;
 	sock->file = NULL;
+//	init_waitqueue_head(&sock->wait);	this is needed?
+	sock->passcred = 0;
 
 	sockets_in_use[smp_processor_id()].counter++;
 	return sock;

Regards
-- 
OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: test.c --]
[-- Type: text/x-csrc, Size: 2487 bytes --]

#include <stdio.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/wait.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>

static void client(int fd)
{
	int send_fd;
	struct msghdr msg;
	struct iovec iov[1];
	char buf[1];
	union {
		struct cmsghdr cm;
		char cntl[CMSG_SPACE(sizeof(int))];
	} cntl_u;
	struct cmsghdr *cmsgptr;

	send_fd = open("/dev/null", O_RDWR);
	
	iov[0].iov_base = buf;
	iov[0].iov_len = 1;
	msg.msg_iov = iov;
	msg.msg_iovlen = 1;
	msg.msg_name = NULL;
	msg.msg_namelen = 0;

	msg.msg_control = cntl_u.cntl;
	msg.msg_controllen = sizeof(cntl_u.cntl);

	cmsgptr = CMSG_FIRSTHDR(&msg);
	cmsgptr->cmsg_len = CMSG_LEN(sizeof(int));
	cmsgptr->cmsg_level = SOL_SOCKET;
	cmsgptr->cmsg_type = SCM_RIGHTS;
	*((int *)CMSG_DATA(cmsgptr)) = send_fd;

	if (sendmsg(fd, &msg, 0) <= 0)
		perror("sendmsg");
}

static void server(int fd)
{
	int recv_fd;
	struct stat statbuf;
	struct msghdr msg;
	struct iovec iov[1];
	char buf[1];
	union {
		struct cmsghdr cm;
		char cntl[CMSG_SPACE(sizeof(int))];
	} cntl_u;
	struct cmsghdr *cmsgptr;

	iov[0].iov_base = buf;
	iov[0].iov_len = 1;
	msg.msg_iov = iov;
	msg.msg_iovlen = 1;
	msg.msg_name = NULL;
	msg.msg_namelen = 0;

	msg.msg_control = cntl_u.cntl;
	msg.msg_controllen = sizeof(cntl_u.cntl);
	
	if (recvmsg(fd, &msg, 0) <= 0) {
		perror("recvmsg");
		exit(1);
	}
	cmsgptr = CMSG_FIRSTHDR(&msg);
	if (cmsgptr == NULL) {
		fprintf(stderr, "no control message\n");
		exit(1);
	}
	if (cmsgptr->cmsg_len != CMSG_LEN(sizeof(int)))
		fprintf(stderr, "bad length: %d\n", cmsgptr->cmsg_len);
	if (cmsgptr->cmsg_level != SOL_SOCKET)
		fprintf(stderr, "not SOL_SOCKET: %d\n", cmsgptr->cmsg_level);
	if (cmsgptr->cmsg_type != SCM_RIGHTS)
		fprintf(stderr, "not SCM_RIGHTS: %d\n", cmsgptr->cmsg_type);
	recv_fd = *((int *)CMSG_DATA(cmsgptr));
	if (fstat(recv_fd, &statbuf) == -1) {
		perror("stat");
		exit(1);
	}

	printf("fd: %d, dev: %llx, mode: %o\n",
	       recv_fd, statbuf.st_rdev, statbuf.st_mode);
}

int main()
{
	pid_t pid;
	int status, fd[2];

	if (socketpair(AF_UNIX, SOCK_STREAM, 0, fd) == -1) {
		perror("socketpair");
		exit(1);
	}

	pid = fork();
	if (pid == -1) {
		perror("fork");
		exit(1);
	}
	if (pid == 0) {
		close(fd[1]);
		client(fd[0]);
		exit(0);
	}

	close(fd[0]);
	if (waitpid(pid, &status, 0) != pid) {
		perror("waitpid");
		exit(1);
	}
	if (!WIFEXITED(status) || WEXITSTATUS(status) != 0) {
		fprintf(stderr, "client abnormal end\n");
		exit(1);
	}

	server(fd[1]);

	return 0;
}

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: gnome-terminal acts funny in recent 2.5 series
  2002-02-19  4:00   ` Wayne Whitney
@ 2002-02-19 12:48     ` Sebastian Dröge
  0 siblings, 0 replies; 10+ messages in thread
From: Sebastian Dröge @ 2002-02-19 12:48 UTC (permalink / raw)
  To: whitney; +Cc: kov, alessandro.suardi, linux-kernel


[-- Attachment #1.1: Type: text/plain, Size: 941 bytes --]

On Mon, 18 Feb 2002 20:00:51 -0800
Wayne Whitney <whitney@math.berkeley.edu> wrote:

> In mailing-lists.linux-kernel, Gustavo wrote:
> 
> > I noticed this problem also... it seems the problem lies on
> > devpts, I enabled it on my 2.5.5pre1 build, mounting
> > devpts with the options given on the "readme" file
> > made gnome-terminal start on the second try, almost
> > everytime
> 
> I also am seeing this problem--it is definitely pts related.  I have
> noticed that when the problem occurs, if I execute "gnome-terminal &"
> >from an existing gnome-terminal, a new window comes up, but input and
> output from the new shell are still going to the prior gnome-terminal.
> 'ps' shows both the new gnome-terminal and old gnome-terminal on the
> same pts.  But sometimes everything works fine.
> 
> Cheers, Wayne
Hi,
here are the outputs... maybe someone can understand it ;)
BTW: aterm, eterm and xterm are running without problems...

Bye

[-- Attachment #1.2: gnome-terminal.out.tar.bz2 --]
[-- Type: application/octet-stream, Size: 22433 bytes --]

[-- Attachment #1.3: ps.output --]
[-- Type: application/octet-stream, Size: 4027 bytes --]

  F   UID   PID  PPID PRI  NI   VSZ  RSS WCHAN  STAT TTY        TIME COMMAND
100     0     1     0  15   0  1344  528 schedu S    ?          0:04 init
040     0     2     1  15   0     0    0 contex SW   ?          0:00 [keventd]
040     0     3     1  34  19     0    0 ksofti SWN  ?          0:00 [ksoftirqd_CPU0]
040     0     4     1  25   0     0    0 kswapd SW   ?          0:00 [kswapd]
040     0     5     1  25   0     0    0 interr SW   ?          0:00 [bdflush]
040     0     6     1  15   0     0    0 schedu SW   ?          0:00 [kupdated]
040     0     7     1  25   0     0    0 down_i SW   ?          0:00 [scsi_eh_0]
140     0     8     1  15   0     0    0 interr SW   ?          0:00 [khubd]
040     0     9     1  15   0     0    0 schedu SW   ?          0:00 [kreiserfsd]
100   500   188     1  15   0  2668 1428 wait4  S    vc/1       0:00 -bash
000     0   189     1  15   0  1320  452 schedu S    vc/2       0:00 /sbin/agetty tty2 9600
000     0   190     1  15   0  1320  452 schedu S    vc/3       0:00 /sbin/agetty tty3 9600
000     0   191     1  15   0  1320  452 schedu S    vc/4       0:00 /sbin/agetty tty4 9600
000     0   192     1  15   0  1320  452 schedu S    vc/5       0:00 /sbin/agetty tty5 9600
000     0   193     1  15   0  1320  452 schedu S    vc/6       0:00 /sbin/agetty tty6 9600
000     0   194     1  15   0  1320  452 schedu S    vc/8       0:00 /sbin/agetty tty8 9600
000     0   195     1  15   0  1320  452 schedu S    vc/9       0:00 /sbin/agetty tty9 9600
000     0   196     1  15   0  1320  452 schedu S    vc/10      0:00 /sbin/agetty tty10 9600
000     0   197     1  15   0  1320  452 schedu S    vc/11      0:00 /sbin/agetty tty11 9600
000     0   198     1  15   0  1320  452 schedu S    vc/12      0:00 /sbin/agetty tty12 9600
000   500   199   188  16   0  2520 1108 wait4  S    vc/1       0:00 /bin/sh /usr/X11R6/bin/startx
000   500   206   199  15   0  2208  688 wait4  S    vc/1       0:00 xinit /home/slomo/.xinitrc --
100     0   207   206  15   0 58496 13000 schedu S   ?          0:07 X :0
000   500   210   206  15   0  8728 4852 schedu S    vc/1       0:01 gnome-session
000   500   214     1  15   0  6728 2144 schedu S    ?          0:00 gnome-smproxy --sm-config-prefix /.gnome-smproxy-ZNlsgK/ --sm-client-id 11c0a80001000101214878700000082960000
000   500   226     1  15   0  9840 4528 schedu S    ?          0:02 sawfish --sm-client-id 11c0a80001000101214878800000082960002 --sm-prefix 9zh555wwde
000   500   228     1  15   0  9700 5764 schedu S    ?          0:02 panel --sm-config-prefix /panel.d/default-hQt86A/ --sm-client-id 11c0a80001000101396418500000223280108
000   500   230     1  15   0  2888 1236 schedu S    ?          0:00 gnome-name-service
000   500   232     1  15   0  8700 4532 schedu S    ?          0:00 tasklist_applet --activate-goad-server tasklist_applet --goad-fd 10
000   500   234     1  15   0  8644 4520 schedu S    ?          0:00 deskguide_applet --activate-goad-server deskguide_applet --goad-fd 10
000   500   311     1  15   0  3116 1616 schedu S    ?          0:00 aterm -tn xterm -rv +sb -sl 1024 -geometry 80x24 -fn -misc-fixed-medium-r-normal-*-*-140-*-*-c-*-iso8859-15 -fb -misc-fixed-bold-r-normal-*-*-140-*-*-c-*-iso8859-15
000   500   312   311  16   0  2676 1464 wait4  S    pts/0      0:00 bash
000   500   313   312  25   0  9608 4888 -      R    pts/0      0:18 gnome-terminal
100     0   314   313  17   0  1380  576 schedu S    pts/0      0:00 gnome-pty-helper
000   500   315   313  16   0  2672 1416 schedu S    ?          0:00 bash
000   500   317     1  15   0  3116 1616 schedu S    ?          0:00 aterm -tn xterm -rv +sb -sl 1024 -geometry 80x24 -fn -misc-fixed-medium-r-normal-*-*-140-*-*-c-*-iso8859-15 -fb -misc-fixed-bold-r-normal-*-*-140-*-*-c-*-iso8859-15
000   500   318   317  15   0  2668 1436 wait4  S    pts/2      0:00 bash
100     0   319   318  15   0  2672 1432 wait4  S    pts/2      0:00 bash
100     0   321   319  16   0  3100 1288 -      R    pts/2      0:00 ps axlwww

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: gnome-terminal acts funny in recent 2.5 series
@ 2002-02-19 14:08 ALESSANDRO.SUARDI
  0 siblings, 0 replies; 10+ messages in thread
From: ALESSANDRO.SUARDI @ 2002-02-19 14:08 UTC (permalink / raw)
  To: hirofumi; +Cc: linux-kernel, davem

OGAWA Hirofumi wrote:
> 
> Alessandro Suardi <alessandro.suardi@oracle.com> writes:
> 
>> Running Ximian-latest for rh72/i386, latest 2.5 kernels (including
>>   2.5.4-pre2, 2.5.4, 2.5.5-pre1).
>> 
>> Symptom:
>>    - clicking on the panel icon for gnome-terminal shows a flicker
>>       of the terminal window coming up then the window disappears.
>>      No leftover processes.

[snip]

> Probably, this problem had occurred in libzvt which gnome-terminal 
> is using.
> 
> libzvt was using file descriptor passing via UNIX domain socket for
> pseudo terminal. Then because ->passcred was not initialized in
> sock_alloc(), unexpected credential data was passing to libzvt.
> 
> The following patch fixed this problem, but I'm not sure.
> Could you review the patch? (attached file are test program)
> 
> --- socket.c.orig     Mon Feb 11 18:21:59 2002
> +++ socket.c     Tue Feb 19 16:20:18 2002
> @@ -501,6 +501,8 @@ struct socket *sock_alloc(void)
>      sock->ops = NULL;
>      sock->sk = NULL;
>      sock->file = NULL;
> +//     init_waitqueue_head(&sock->wait);     this is needed?
> +     sock->passcred = 0;
> 
>      sockets_in_use[smp_processor_id()].counter++;
>      return sock;

Success on first attempt - thanks. Of course since this wasn't
 fully reproducable I'll assume the patch fixes the bug, unless
 proven wrong.

Thanks again,

--alessandro

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: gnome-terminal acts funny in recent 2.5 series
  2002-02-19 11:44 ` OGAWA Hirofumi
@ 2002-02-19 15:09   ` Dave Jones
  0 siblings, 0 replies; 10+ messages in thread
From: Dave Jones @ 2002-02-19 15:09 UTC (permalink / raw)
  To: OGAWA Hirofumi; +Cc: Alessandro Suardi, linux-kernel, David S. Miller, zwane

On Tue, Feb 19, 2002 at 08:44:39PM +0900, OGAWA Hirofumi wrote:
 > --- socket.c.orig	Mon Feb 11 18:21:59 2002
 > +++ socket.c	Tue Feb 19 16:20:18 2002
 > @@ -501,6 +501,8 @@ struct socket *sock_alloc(void)
 >  	sock->ops = NULL;
 >  	sock->sk = NULL;
 >  	sock->file = NULL;
 > +//	init_waitqueue_head(&sock->wait);	this is needed?
 > +	sock->passcred = 0;

 The first line is dead since 2.5.4, but the second is the important
 bit here. And as well as fixing the gnome-terminal weirdness, it
 also fixes the 'portmapper slows box to a crawl' problem, that
 Zwane, myself and rth saw..

-- 
| Dave Jones.        http://www.codemonkey.org.uk
| SuSE Labs

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: gnome-terminal acts funny in recent 2.5 series
@ 2002-02-19 16:40 Petr Vandrovec
  2002-02-19 17:47 ` OGAWA Hirofumi
  0 siblings, 1 reply; 10+ messages in thread
From: Petr Vandrovec @ 2002-02-19 16:40 UTC (permalink / raw)
  To: OGAWA Hirofumi; +Cc: linux-kernel, David S. Miller

On 19 Feb 02 at 20:44, OGAWA Hirofumi wrote:
> 
> libzvt was using file descriptor passing via UNIX domain socket for
> pseudo terminal. Then because ->passcred was not initialized in
> sock_alloc(), unexpected credential data was passing to libzvt.
> 
> The following patch fixed this problem, but I'm not sure.
> Could you review the patch? (attached file are test program)

I sent simillar patch to Linus and DaveM on Sunday. Unfortunately it
did not found its way into either of these two trees (and IPX oops fix too). 
In addition to yours I moved these 'sock->XXX = NULL' into sock_alloc_inode,
as I see no reason why sock->wait should be initialized in sock_alloc_inode,
but all other members in sock_alloc. It caused confusion to me, and
from your comment it looks like that you missed it too. Besides that
root of sockfs uses sock's inode with sock->ops, sk and file being
0x5a5a5a5a without moving initialization from sock_alloc to sock_alloc_inode.

> --- socket.c.orig   Mon Feb 11 18:21:59 2002
> +++ socket.c    Tue Feb 19 16:20:18 2002
> @@ -501,6 +501,8 @@ struct socket *sock_alloc(void)
>     sock->ops = NULL;
>     sock->sk = NULL;
>     sock->file = NULL;
> +// init_waitqueue_head(&sock->wait);   this is needed?
> +   sock->passcred = 0;
>  
>     sockets_in_use[smp_processor_id()].counter++;
>     return sock;

                                  Best regards,
                                                    Petr Vandrovec
                                                    vandrove@vc.cvut.cz
                                                    

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: gnome-terminal acts funny in recent 2.5 series
  2002-02-19 16:40 Petr Vandrovec
@ 2002-02-19 17:47 ` OGAWA Hirofumi
  0 siblings, 0 replies; 10+ messages in thread
From: OGAWA Hirofumi @ 2002-02-19 17:47 UTC (permalink / raw)
  To: Petr Vandrovec; +Cc: linux-kernel, David S. Miller

"Petr Vandrovec" <VANDROVE@vc.cvut.cz> writes:

> On 19 Feb 02 at 20:44, OGAWA Hirofumi wrote:
> > 
> > libzvt was using file descriptor passing via UNIX domain socket for
> > pseudo terminal. Then because ->passcred was not initialized in
> > sock_alloc(), unexpected credential data was passing to libzvt.
> > 
> > The following patch fixed this problem, but I'm not sure.
> > Could you review the patch? (attached file are test program)
> 
> I sent simillar patch to Linus and DaveM on Sunday. Unfortunately it
> did not found its way into either of these two trees (and IPX oops fix too). 
> In addition to yours I moved these 'sock->XXX = NULL' into sock_alloc_inode,
> as I see no reason why sock->wait should be initialized in sock_alloc_inode,
> but all other members in sock_alloc. It caused confusion to me, and
> from your comment it looks like that you missed it too. Besides that
> root of sockfs uses sock's inode with sock->ops, sk and file being
> 0x5a5a5a5a without moving initialization from sock_alloc to sock_alloc_inode.

I wish your patch apply to the tree. Thanks.
-- 
OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2002-02-19 17:48 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-02-19  0:03 gnome-terminal acts funny in recent 2.5 series Alessandro Suardi
2002-02-19  0:39 ` Gustavo Noronha Silva
2002-02-19  4:00   ` Wayne Whitney
2002-02-19 12:48     ` Sebastian Dröge
2002-02-19  6:13   ` Sebastian Dröge
2002-02-19 11:44 ` OGAWA Hirofumi
2002-02-19 15:09   ` Dave Jones
  -- strict thread matches above, loose matches on Subject: below --
2002-02-19 14:08 ALESSANDRO.SUARDI
2002-02-19 16:40 Petr Vandrovec
2002-02-19 17:47 ` OGAWA Hirofumi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox