Review Request 129197: Fix tests on FreeBSD

Oswald Buddenhagen ossi at kde.org
Sat Oct 29 09:07:24 UTC 2016



> 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
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20161029/73d56988/attachment-0001.html>


More information about the Kde-frameworks-devel mailing list