Re: Output truncated in ssh session after d2b6f44779d3 ("n_tty: Fix signal handling flushes")

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Peter,

On Wed, Jun 3, 2015 at 5:02 AM, Peter Hurley <peter@xxxxxxxxxxxxxxxxxx> wrote:
>> The problem is that pressing Ctrl+C on a shell through SSH is "eating"
>> the output, which is usually a literal "^C", a newline and the $PS1
>> prompt.
>
> Thanks for the report.
>
> But I'm having trouble reproducing what you observe using either
> native localhost or 2 machines, so this may be specific to qemu.
> I assume you're shelling onto the vm? Is this an x86 vm?

Yes, it's all x86.

Host is running Ubuntu 14.04 LTS with kernel 3.13.0-52-generic on
x86_64. Hypervisor is qemu-system-x86_64 and using virtio-net for the
network. (I have the problem on ssh but not on the serial console to
the VM, it really looks like it's on the pty code.)

With the guest running 4.1-rc6 I can reproduce the problem and after I
revert commit d2b6f44779d3 I can no longer reproduce it.

>> I straced both bash and the sshd for that connection and caught it on
>> a time while the problem happened. It turns out bash was indeed
>> printing the "^C", newline and $PS1 but the sshd process was never
>> receiving it, so it was being lost somewhere in the pty code...
>>
>> I tried bisecting it but it was hard since the problem wouldn't always
>> reproduce...
>
> Could echo be off at the moment the signal char is processed?

I recall checking that and I'm fairly sure that no, it's not off...
Though I lost the straces I had and in fact I didn't take them at the
same time, so let me work on getting another pair of them, at the same
time, and cut out the snippet that illustrates the issue.

> IOW, what are you interrupting?

I'm just pressing Ctrl+C on the shell command line to cancel the
command I was inputting.

For instance, I type "git sta" and then I realize I don't want to run
git status and then I press Ctrl+C to run "ls" instead.

But after I press Ctrl+C, the cursor is still after the "git sta" and
I don't see a "^C", newline and a new prompt.

But the interrupt really happened, because if I type "ls" then I see
"git stals" but when I press enter the "ls" command is really
executed, so bash did process the interrupt, it's just the output of
"^C", newline, $PS1 that was lost...

> I could see how a pty closing bug might cause this but that was fixed
> for 4.1-rc3 (and was only just added to the 4.0-stable tree), so
> doesn't explain observing this on 4.1-rc6.

I don't think it's a pty closing thing, as I explained this is when
pressing Ctrl+C on a shell command line, so the pty is certainly not
closing.

The problem is intermittent but I can reproduce it somewhat easily,
maybe not right away but if I use the machine for 30 minutes or so I
get to see it at least once.

If you have some suggestions of what I could be looking for, I'd be
happy to add some traces or maybe patch the kernel to expose some
information (what are we looking for? at what spots?) to help isolate
this.

Let me work on providing you with good strace output to demonstrate the issue.

Cheers,
Filipe
--
To unsubscribe from this list: send the line "unsubscribe linux-serial" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux PPP]     [Linux FS]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Linmodem]     [Device Mapper]     [Linux Kernel for ARM]

  Powered by Linux