[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-frameworks-devel
Subject: Re: Review Request 129197: Fix tests on FreeBSD
From: Oswald Buddenhagen <ossi () kde ! org>
Date: 2016-10-29 9:07:24
Message-ID: 20161029090724.5235.15874 () mimi ! kde ! org
[Download RAW message or body]
--===============5256827710913040146==
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
> On Oct. 16, 2016, 1:12 p.m., Tobias Berner wrote:
> > I'm kind of unsure if this is right. Yes, the tests run now, but isn't the issue \
> > rather in the way kpty works (or fails to work on FreeBSD)?
>
> Gleb Popov wrote:
> From what i've understood, this boils down to `KPtyDevicePrivate::_k_canRead()` \
> method in kptydevice.cpp. The line 284
> if (!::ioctl(q->masterFd(), PTY_BYTES_AVAILABLE, (char *) &available))
>
> returns 0 in `available` and this makes method return `false`. This, in turn, make \
> `waitFor*` methods return false too.
> Now you mention it, i'm also unsure if this `ioctl` behaves different on Linux.
i've been trying to make sense of the freebsd pts layer, and utterly failed. the \
documentation is anything between abysmal and non-existing. i suggest you find and \
invite an actual expert.
kptyprocess keeps both ends of the pty open, so whether the child process is running \
or not should be irrelevant. apparently, it's not. maybe this is somehow related to \
whether the tty is the process' controlling terminal.
you can try the following:
- remove the freebsd case from the PTY_BYTES_AVAILABLE definition near the top. this \
was introduced 2008, before freebsd 8's release, which got an entirely new pts layer. \
it may just work with the generic code now.
- try replacing the masterFd() with slaveFd() in the above ioctl. that would be kinda \
broken, but at least it would be a data point.
- Oswald
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/129197/#review100039
-----------------------------------------------------------
On Oct. 16, 2016, 11:44 a.m., Gleb Popov wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/129197/
> -----------------------------------------------------------
>
> (Updated Oct. 16, 2016, 11:44 a.m.)
>
>
> Review request for KDE Frameworks, Adriaan de Groot, Tobias Berner, Oswald \
> Buddenhagen, and Martin Tobias Holmedahl Sandsmark.
>
> Repository: kpty
>
>
> Description
> -------
>
> Apparently, KPtyDevice can't be operated on after KPtyProcess finishes. Tweak tests \
> accordingly, so they actually test things while the process is still running.
>
> Diffs
> -----
>
> autotests/kptyprocesstest.cpp 8b0b5b0
>
> Diff: https://git.reviewboard.kde.org/r/129197/diff/
>
>
> Testing
> -------
>
> make test on FreeBSD
>
>
> Thanks,
>
> Gleb Popov
>
>
--===============5256827710913040146==
MIME-Version: 1.0
Content-Type: text/html; charset="utf-8"
Content-Transfer-Encoding: 7bit
<html>
<body>
<div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
<table bgcolor="#f9f3c9" width="100%" cellpadding="12" style="border: 1px #c9c399 \
solid; border-radius: 6px; -moz-border-radius: 6px; -webkit-border-radius: 6px;"> \
<tr> <td>
This is an automatically generated e-mail. To reply, visit:
<a href="https://git.reviewboard.kde.org/r/129197/">https://git.reviewboard.kde.org/r/129197/</a>
</td>
</tr>
</table>
<br />
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: \
10px;"> <p style="margin-top: 0;">On October 16th, 2016, 1:12 p.m. UTC, <b>Tobias \
Berner</b> wrote:</p> <blockquote style="margin-left: 1em; border-left: 2px solid \
#d0d0d0; padding-left: 10px;"> <pre style="white-space: pre-wrap; white-space: \
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: \
inherit;white-space: inherit;">I'm kind of unsure if this is right. Yes, the tests \
run now, but isn't the issue rather in the way kpty works (or fails to work on \
FreeBSD)?</p></pre> </blockquote>
<p>On October 16th, 2016, 1:22 p.m. UTC, <b>Gleb Popov</b> wrote:</p>
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: \
10px;"> <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: \
0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">From \
what i've understood, this boils down to <code style="text-rendering: inherit;color: \
#4444cc;padding: 0;white-space: normal;margin: 0;line-height: \
inherit;">KPtyDevicePrivate::_k_canRead()</code> method in kptydevice.cpp. The line \
284</p> <p style="padding: 0;text-rendering: inherit;margin: 0;line-height: \
inherit;white-space: inherit;"><div class="codehilite" style="background: \
#f8f8f8"><pre style="line-height: 125%"><span></span>if (!::ioctl(q->masterFd(), \
PTY_BYTES_AVAILABLE, (char *) &available)) </pre></div>
</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: \
inherit;white-space: inherit;">returns 0 in <code style="text-rendering: \
inherit;color: #4444cc;padding: 0;white-space: normal;margin: 0;line-height: \
inherit;">available</code> and this makes method return <code style="text-rendering: \
inherit;color: #4444cc;padding: 0;white-space: normal;margin: 0;line-height: \
inherit;">false</code>. This, in turn, make <code style="text-rendering: \
inherit;color: #4444cc;padding: 0;white-space: normal;margin: 0;line-height: \
inherit;">waitFor*</code> methods return false too.</p> <p style="padding: \
0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Now \
you mention it, i'm also unsure if this <code style="text-rendering: inherit;color: \
#4444cc;padding: 0;white-space: normal;margin: 0;line-height: inherit;">ioctl</code> \
behaves different on Linux.</p></pre> </blockquote>
</blockquote>
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: \
0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">i've \
been trying to make sense of the freebsd pts layer, and utterly failed. the \
documentation is anything between abysmal and non-existing. i suggest you find and \
invite an actual expert.</p> <p style="padding: 0;text-rendering: inherit;margin: \
0;line-height: inherit;white-space: inherit;">kptyprocess keeps both ends of the pty \
open, so whether the child process is running or not should be irrelevant. \
apparently, it's not. maybe this is somehow related to whether the tty is the \
process' controlling terminal.</p> <p style="padding: 0;text-rendering: \
inherit;margin: 0;line-height: inherit;white-space: inherit;">you can try the \
following:
- remove the freebsd case from the PTY_BYTES_AVAILABLE definition near the top. this \
was introduced 2008, before freebsd 8's release, which got an entirely new pts layer. \
it may just work with the generic code now.
- try replacing the masterFd() with slaveFd() in the above ioctl. that would be kinda \
broken, but at least it would be a data point.</p></pre> <br />
<p>- Oswald</p>
<br />
<p>On October 16th, 2016, 11:44 a.m. UTC, Gleb Popov wrote:</p>
<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="12" style="border: \
1px #888a85 solid; border-radius: 6px; -moz-border-radius: 6px; \
-webkit-border-radius: 6px;"> <tr>
<td>
<div>Review request for KDE Frameworks, Adriaan de Groot, Tobias Berner, Oswald \
Buddenhagen, and Martin Tobias Holmedahl Sandsmark.</div> <div>By Gleb Popov.</div>
<p style="color: grey;"><i>Updated Oct. 16, 2016, 11:44 a.m.</i></p>
<div style="margin-top: 1.5em;">
<b style="color: #575012; font-size: 10pt;">Repository: </b>
kpty
</div>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" \
style="border: 1px solid #b8b5a0"> <tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: \
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: \
inherit;white-space: inherit;">Apparently, KPtyDevice can't be operated on after \
KPtyProcess finishes. Tweak tests accordingly, so they actually test things while the \
process is still running.</p></pre> </td>
</tr>
</table>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: \
1px solid #b8b5a0"> <tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: \
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: \
inherit;white-space: inherit;">make test on FreeBSD</p></pre> </td>
</tr>
</table>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">
<li>autotests/kptyprocesstest.cpp <span style="color: grey">(8b0b5b0)</span></li>
</ul>
<p><a href="https://git.reviewboard.kde.org/r/129197/diff/" style="margin-left: \
3em;">View Diff</a></p>
</td>
</tr>
</table>
</div>
</body>
</html>
--===============5256827710913040146==--
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic