[konsole] [Bug 372991] Terminal gets stuck on interrupting a program that is outputting, preventing further output from being shown

Peter Wu bugzilla_noreply at kde.org
Sat Feb 18 01:43:16 UTC 2017


https://bugs.kde.org/show_bug.cgi?id=372991

--- Comment #8 from Peter Wu <peter at lekensteyn.nl> ---
Created attachment 104086
  --> https://bugs.kde.org/attachment.cgi?id=104086&action=edit
debug patch

I have traced the issue into kpty, KPtyDevicePrivate::_k_canRead.

The ioctl(q->masterFd, FIONREAD, &available) returns 0 available data.
Subsequently reading 0 bytes also returns 0 (with errno=0). This is considered
EOF which then prevents further read events from being reported.

tty_ioctl(4) documents FIONREAD as: "Get the number of bytes in the input
buffer."
Not sure if "0 available bytes" should be interpreted as EOF though for ptmx
devices.

Attached is a debug patch. I did not observe ioctl failing in the output. Put a
gdb breakpoint on the "!readBytes" block (line with
"readNotifier->setEnabled(false);") and invoke "call fflush(0)". If you
"return", the output is processed normally.

available 4095
fd=12 readBytes=4095 errno=0
available 4095
fd=12 readBytes=4095 errno=0
available 0
fd=12 readBytes=0 errno=0

Would you see any issues with returning false (without logging other warnings
nor emitting signals) when available==0? Surely if there is really an EOF
condition, read would return 0 which actually detects the EOF?

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the konsole-devel mailing list