From: Ico Doornekamp <lkml@zevv.nl>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org
Subject: Re: TIOCGWINSZ retuns old pty size after receiving SIGWINCH
Date: Tue, 19 Aug 2008 19:56:39 +0200 [thread overview]
Message-ID: <20080819175639.GI29842@pruts.nl> (raw)
In-Reply-To: <20080819114423.GB29842@pruts.nl>
* On 2008-08-19 Ico Doornekamp <lkml@zevv.nl> wrote :
>
>
> * On 2008-08-19 Andrew Morton <akpm@linux-foundation.org> wrote :
>
> > On Tue, 19 Aug 2008 09:54:14 +0200 Ico Doornekamp <lkml@zevv.nl> wrote:
> > >
> > > * On 2008-08-19 Andrew Morton <akpm@linux-foundation.org> wrote :
> > >
> > > > On Sun, 10 Aug 2008 17:08:59 +0200 Ico Doornekamp <lkml@zevv.nl> wrote:
> > > >
> > > > > Recently my X terminals showed annoying behaviour where the application
> > > > > in the terminal was not resized properly to the actual size of the X
> > > > > terminal emulator window, resulting in a lot of misaligned text on the
> > > > > screen. Hunting the issue down from the windowmanager and the terminal
> > > > > emulator program, I suspect the problem might lie in the kernel. I'm
> > > > > running 2.6.26 on a dual core i386.
> > > > >
> > > > > What I see is this: the userspace application receives a SIGWINCH signal
> > > > > and acquires the terminal size usign the TIOCGWINSZ ioctl. It seems that
> > > > > in some cases the old instead of the new terminal size is returned.
> > > > > A small delay before the ioctl seems to 'fix' this behaviour.
> > > > >
> > > > > I noticed some changes involving locking in the the pty code in the last
> > > > > kernel verions, could one of these changes cause the above behaviour ? If
> > > > > so, wouldn't this affect much more users ?
> > > >
> > > > hm, that code is pretty simple and although it does the SIGWINCH and
> > > > the window-size setting in a peculiar order, it looks to be race-free.
> > > >
> > > > Approximately what proportion of the time does it go wrong?
> > >
> > > I guess about 10 to 20% of the resizes. I happen to be using a tiling
> > > window manager which causes resizing more often and more agressive then
> > > 'normal' window managers, I guess this helps triggering the problem.
> > >
> > > I temporary worked around this issue this by changing the order of the
> > > signal and the updating of the pty size in tty_io.c's tiocswinsz(), but
> > > this is not much of a real fix.
> > >
> >
> > Well damn. Are you sure? The code looks solid to me.
> >
> > At least, it does after
> >
> > Author: Alan Cox <alan@redhat.com> 2008-08-15 02:39:38
> > Committer: Linus Torvalds <torvalds@linux-foundation.org> 2008-08-15 10:34:07
> > Parent: 000b9151d7851cc1e490b2a76d0206e524f43cca (Fix race/oops in tty layer after BKL pushdown)
> > Branches: git-cifs, git-ia64, git-nfs, git-powerpc-merge, linux-next, remotes/origin/master
> > Follows: v2.6.27-rc3
> > Precedes: next-20080818
> >
> > tty: remove resize window special case
> >
> > perhaps you're still running a kernel which is earlier than that?
>
> I reported the behaviour on 2.6.26.2, but I was not aware this issue was
> adressed already in the 2.6.27 tree. I will update to the latest 2.6.27
> rc and report if the problem still persists.
I am not able to reproduce the problem with git 2.6.27-rc3-next-20080819.
next prev parent reply other threads:[~2008-08-19 17:57 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-10 15:08 TIOCGWINSZ retuns old pty size after receiving SIGWINCH Ico Doornekamp
2008-08-19 7:40 ` Andrew Morton
2008-08-19 7:54 ` Ico Doornekamp
2008-08-19 8:07 ` Andrew Morton
2008-08-19 11:44 ` Ico Doornekamp
2008-08-19 17:56 ` Ico Doornekamp [this message]
2008-08-19 19:03 ` Andrew Morton
2008-08-19 20:13 ` Ico Doornekamp
2008-08-19 20:49 ` Andrew Morton
2008-08-20 7:22 ` Ico Doornekamp
-- strict thread matches above, loose matches on Subject: below --
2008-08-12 2:51 Javeed Shaikh
2008-08-12 4:03 ` Javeed Shaikh
2008-08-12 23:58 ` Javeed Shaikh
2008-08-13 9:20 ` Alan Cox
2008-10-03 16:08 Christoph
2008-10-05 11:39 Kanru Chen
2008-10-05 12:03 ` Alan Cox
2008-10-05 12:17 Kanru Chen
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=20080819175639.GI29842@pruts.nl \
--to=lkml@zevv.nl \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.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.
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.