public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Re: TIOCGWINSZ retuns old pty size after receiving SIGWINCH
@ 2008-10-05 12:17 Kanru Chen
  0 siblings, 0 replies; 18+ messages in thread
From: Kanru Chen @ 2008-10-05 12:17 UTC (permalink / raw)
  To: linux-kernel

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

On Sun, 5 Oct 2008 13:03:30 +0100
Alan Cox <alan@lxorguk.ukuu.org.uk> wrote:

> The relevant fixes were pushed and are in the current -rc series kernels.
> The tty mutex now locks the TIOCG/SWINSZ calls using the tty mutex lock
> of the tty side of tty/pty pairs.

Thanks! I didn't notice that.

Regards,
-- 
   ~    Kanru Chen <koster@debian.org.tw>
  'v'   http://stu.csie.ncnu.edu.tw/~kanru.96/
 // \\  GnuPG-Key ID: 365CC7A2
/(   )\ Fingerprint: 3278 DFB4 BB28 6E8C 9E1F  1ECB B1B7 5B5F 365C C7A2
 ^`~'^

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

^ permalink raw reply	[flat|nested] 18+ messages in thread
* Re: TIOCGWINSZ retuns old pty size after receiving SIGWINCH
@ 2008-10-05 11:39 Kanru Chen
  2008-10-05 12:03 ` Alan Cox
  0 siblings, 1 reply; 18+ messages in thread
From: Kanru Chen @ 2008-10-05 11:39 UTC (permalink / raw)
  To: linux-kernel; +Cc: Alan Cox

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

Hi Alan,

Could you push a fix for this problem for .27 release? It seems many
people encounter this if they compile with PREEMPT enabled and it's quite
annoying.

Regards,
-- 
   ~    Kanru Chen <koster@debian.org.tw>
  'v'   http://stu.csie.ncnu.edu.tw/~kanru.96/
 // \\  GnuPG-Key ID: 365CC7A2
/(   )\ Fingerprint: 3278 DFB4 BB28 6E8C 9E1F  1ECB B1B7 5B5F 365C C7A2
 ^`~'^

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

^ permalink raw reply	[flat|nested] 18+ messages in thread
* Re: TIOCGWINSZ retuns old pty size after receiving SIGWINCH
@ 2008-10-03 16:08 Christoph
  0 siblings, 0 replies; 18+ messages in thread
From: Christoph @ 2008-10-03 16:08 UTC (permalink / raw)
  To: linux-kernel

Hello list!

This is a follow up of
http://linux.derkeiler.com/Mailing-Lists/Kernel/2008-08/msg08509.html

Summary:
resizing a terminal emulator window results in a lot of misaligned text
on the screen. SIGWINCH signal defective.

It ends with this question and I'd like to contribute some confusion:

> > 2.6.25.9: good
> > 2.6.26-rc1 bad ( +/- 10% of the resizes)
> > 2.6.26.2: still bad ( +/- 10% of the resizes )
> > 2.6.27-rc3: ugly bad ( > 75% of the resizes )
> > linux-next good

> Any other versions to test ?

I got this bug after kernel upgrade from 2.6.25.25 to 2.6.26.5 on my ppc
notebook. That made me wonder. On my x86 desktop I don't had that bug.
I tested:

ppc, notebook
2.6.25.25 ok
2.6.26.5 bug
2.6.26.4 bug

x86, desktop
2.6.26.1 ok
2.6.26.2 ok
2.6.26.3 ok
2.6.26.4 ok !

So I diffed the config of .4 and there is an eye catcher:

ppc: CONFIG_PREEMPT (=> CONFIG_LOCK_KERNEL)
x86: CONFIG_PREEMPT_VOLUNTARY

So, recompiled and tested:

2.6.26.4, x86, CONFIG_PREEMPT => bug
2.6.26.5, ppc, CONFIG_PREEMPT_VOLUNTARY => ok

Hope, this information helps you hunting the bug.

greets

chr


^ permalink raw reply	[flat|nested] 18+ messages in thread
* Re: TIOCGWINSZ retuns old pty size after receiving SIGWINCH
@ 2008-08-12  2:51 Javeed Shaikh
  2008-08-12  4:03 ` Javeed Shaikh
  0 siblings, 1 reply; 18+ messages in thread
From: Javeed Shaikh @ 2008-08-12  2:51 UTC (permalink / raw)
  To: linux-kernel

Ico Doornekamp wrote:
> Hello,
>
> 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 ?
>
> Ico

Hi,

I've been experiencing similar issues.
Here's a screenshot: http://omploader.org/vbzA1 .
Note how emacs is only taking up half of the terminal's total height.

However, my diagnostics are different from yours. Sending SIGWINCH
(in this case, to emacs) fixes the issue, at least temporarily. However,
sending SIGWINCH to the shell process under which emacs is running
(using a negative PID, to specify the "process group") has no visible effect.
I believe the issue has to do with sending SIGWINCH to process groups,
though I do not have enough experience in this area to be sure.

git-bisect tracked it down to this:
46151122e0a2e80e5a6b2889f595e371fe2b600d is first bad commit
commit 46151122e0a2e80e5a6b2889f595e371fe2b600d
Author: Mike Galbraith <efault@gmx.de>
Date:   Thu May 8 17:00:42 2008 +0200

    sched: fix weight calculations

Starting at v2.6.26, I wasn't able to easily revert the commit. However,
the following "patch" seems to have alleviated the problem.

=== begin patch ===
diff --git a/kernel/sched_features.h b/kernel/sched_features.h
index 1c7283c..0e269ed 100644
--- a/kernel/sched_features.h
+++ b/kernel/sched_features.h
@@ -1,4 +1,4 @@
-SCHED_FEAT(NEW_FAIR_SLEEPERS, 1)
+SCHED_FEAT(NEW_FAIR_SLEEPERS, 0)
 SCHED_FEAT(WAKEUP_PREEMPT, 1)
 SCHED_FEAT(START_DEBIT, 1)
 SCHED_FEAT(AFFINE_WAKEUPS, 1)
=== end patch ===

This is merely a workaround, however.

I was able to easily revert commit 46151122e0a2e80e5a6b2889f595e371fe2b600d on
the latest git version of the kernel. However, it did not alleviate the problem.

As in v2.6.26, the above patch (disabling NEW_FAIR_SLEEPERS) seems to work well.

^ permalink raw reply related	[flat|nested] 18+ messages in thread
* TIOCGWINSZ retuns old pty size after receiving SIGWINCH
@ 2008-08-10 15:08 Ico Doornekamp
  2008-08-19  7:40 ` Andrew Morton
  0 siblings, 1 reply; 18+ messages in thread
From: Ico Doornekamp @ 2008-08-10 15:08 UTC (permalink / raw)
  To: linux-kernel


Hello,

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 ?

Ico

-- 
:wq
^X^Cy^K^X^C^C^C^C

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

end of thread, other threads:[~2008-10-05 12:18 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-05 12:17 TIOCGWINSZ retuns old pty size after receiving SIGWINCH Kanru Chen
  -- strict thread matches above, loose matches on Subject: below --
2008-10-05 11:39 Kanru Chen
2008-10-05 12:03 ` Alan Cox
2008-10-03 16:08 Christoph
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-08-10 15:08 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
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

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