Need IO::Pty help with *BSD/OSX

Recently I encountered an issue with Expect.pm on OSX. I think it is caused by a bug in IO::Pty (Expect.pm is a subclass of IO::Pty) and thus filed a bug report there. I even created a test-case and released an unofficial version of Expect.pm with a test exposing the problem.


Today, thanks to the countless CPAN smokers of BinGOs (aka Chris Williams) I got the first test reports that indicate the same problem exists on OpenBSD and NetBSD as well. (Surprisingly, there are no reports at all on FreeBSD and OSX!)


As I don't have any knowledge of BSDs and this IO::Pty stuff, I wonder if there is anyone out there with such expertise? Could you look into this issue?

4 Comments

For at least OpenBSD and NetBSD, there are patches in ports/pkgsrc for IO-Pty/Expect which may be related.

The patch adds util.h to the include list if.

http://cvsweb.netbsd.org/bsdweb.cgi/~checkout~/pkgsrc/devel/p5-IO-Tty/patches/patch-Tty.xs?rev=1.1&content-type=text/plain

Bingos has an open pull request here on the IO::Tty repo:

https://github.com/toddr/IO-Tty/pull/3/commits

It seems however the patch is unrelated to your problem?

Gabor, your test fails on FreeBSD as well. The bc(1) in *BSD is different from the GNU bc in Linux and does not print anything at startup, hence no qr/warranty'\./ line. Also, I get back 23 from the test instead fo 30:

spawn id(5): beginning expect.
Timeout: 1 seconds.
Current time: Sun Aug 3 06:58:41 2014
Waiting for new data (1 seconds)...
spawn id(5): new data.
spawn id(5): read 6 byte(s).
23+7
Returning from expect successfully.
spawn id(5): accumulator: `+7\r\n'
not ok 1
# Failed test at 02-bc.t line 28.
# got: '23'
# expected: '30'
Closing spawn id(5).

Leave a comment

About Gabor Szabo

user-pic Perl author and trainer. Usually writing on other sites: Writing the Perl Maven tutorial Perl 6 articles. Started a Perl IDE. Running the Weekly Perl newsletter. My personal blog.