Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 28 May 2003 13:23:46 -0500
From:      Derek Young <bleach@orcacom.net>
To:        Mike Makonnen <mtm@identd.net>
Cc:        cvs-src@FreeBSD.org
Subject:   Re: cvs commit: src/lib/libthr/thread thr_join.c
Message-ID:  <200305281323.46880.bleach@orcacom.net>
In-Reply-To: <20030528074607.PASI4805.out003.verizon.net@kokeb.ambesa.net>
References:  <20030527214357.CE12C37B48F@hub.freebsd.org> <20030527185552.258336eb.ak03@gte.com> <20030528074607.PASI4805.out003.verizon.net@kokeb.ambesa.net>

next in thread | previous in thread | raw e-mail | index | archive | help
I use FreeBSD 4.8 STABLE and KDE 3.1.2 and I get the same error message about 
the cannot chown /dev/tty blah blah blah. I don't get crashes though. 
Interesting enough the DRM-DRI people were talking about konsole also did 
something weird which prevents x server being ran more than once when the DRM 
is enabled. Which is the case on my laptop, I have to reboot if I want to run 
X twice. Snicker. Something about the font handling...

Maybe you should talk to anholt@freebsd and see if you problems are somewhat 
related? I could be totally offbase, but you never know.

Derek Young

On Wednesday 28 May 2003 02:46 am, Mike Makonnen wrote:
> On Tue, 27 May 2003 18:55:52 -0400
>
> Alexander Kabaev <ak03@gte.com> wrote:
> > konsole has similar problems when run with libkse. The ktrace + source
> > code inspection convinced me that it simply abort()'a itself, because
> > ttyname() function returns NULL in makePty() function.
>
> Yes, seems like it. More comments below.
>
> > I do not think either threading library has anything to do with the
> > failure.
>
> It doesn't look like it's a threading issue, but since libc_r doesn't bring
> out this behaviour in Konsole, they must be doing (or not doing) something
> (directly or indirectly) that triggers it.
>
> I have finally taken the plunge and installed KDE, and I can reproduce the
> bug. However, it is unclear to me exactly what the problem is. To
> complicate things even further it doesn't even look look Konsole uses
> threads, and instead plays games with fork(2). I think we need someone who
> is familiar with the code to help out because I am having a hard time
> following it. Just to add a couple of data points:
>
> It crashes because tcgetattr(3) called from libc/ttyname_unthreaded()
> returns ENOTTY to TEPty::makePty().
>
> When it does crash it is also usually preceded by:
> 	konsole: cannot chown /dev/ttypc.
> 	Reason: Operation not permitted
> which is as a result of this code snippet from TEPty.cpp:openPty()
>
>     if (openpty(&master_fd, &slave_fd, NULL, NULL, NULL) == 0) {
>       m_MasterFd = master_fd;
>       m_SlaveFd = slave_fd;
> #ifdef HAVE_PTSNAME
>       strncpy(ptynam, ptsname(master_fd), 50);
> 	...
> 	[snip]
> 	...
>       if (fchown(slave_fd, (uid_t) -1, gid) < 0)
>       {
>          m_bNeedGrantPty = true;
>          fprintf(stderr,"konsole: cannot chown %s.\n",ttynam);
>          perror("Reason");
>       }
>
>
> The fact that it works sometimes and abort()s at others suggests that there
> may be a race somewhere, but where...
>
> Cheers.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200305281323.46880.bleach>