Giter Site home page Giter Site logo

io-tty's Introduction

NAME

IO::Tty - Low-level allocate a pseudo-Tty, import constants.

VERSION

1.20

SYNOPSIS

use IO::Tty qw(TIOCNOTTY);
...
# use only to import constants, see IO::Pty to create ptys.

DESCRIPTION

IO::Tty is used internally by IO::Pty to create a pseudo-tty. You wouldn't want to use it directly except to import constants, use IO::Pty. For a list of importable constants, see IO::Tty::Constant.

Windows is now supported, but ONLY under the Cygwin environment, see http://sources.redhat.com/cygwin/.

Please note that pty creation is very system-dependend. From my experience, any modern POSIX system should be fine. Find below a list of systems that IO::Tty should work on. A more detailed table (which is slowly getting out-of-date) is available from the project pages document manager at SourceForge http://sourceforge.net/projects/expectperl/.

If you have problems on your system and your system is listed in the "verified" list, you probably have some non-standard setup, e.g. you compiled your Linux-kernel yourself and disabled ptys (bummer!). Please ask your friendly sysadmin for help.

If your system is not listed, unpack the latest version of IO::Tty, do a 'perl Makefile.PL; make; make test; uname -a' and send me ([email protected]) the results and I'll see what I can deduce from that. There are chances that it will work right out-of-the-box...

If it's working on your system, please send me a short note with details (version number, distribution, etc. 'uname -a' and 'perl -V' is a good start; also, the output from "perl Makefile.PL" contains a lot of interesting info, so please include that as well) so I can get an overview. Thanks!

VERIFIED SYSTEMS, KNOWN ISSUES

This is a list of systems that IO::Tty seems to work on ('make test' passes) with comments about "features":

  • AIX 4.3

    Returns EIO instead of EOF when the slave is closed. Benign.

  • AIX 5.x

  • FreeBSD 4.4

    EOF on the slave tty is not reported back to the master.

  • OpenBSD 2.8

    The ioctl TIOCSCTTY sometimes fails. This is also known in Tcl/Expect, see http://expect.nist.gov/FAQ.html

    EOF on the slave tty is not reported back to the master.

  • Darwin 7.9.0

  • HPUX 10.20 & 11.00

    EOF on the slave tty is not reported back to the master.

  • IRIX 6.5

  • Linux 2.2.x & 2.4.x

    Returns EIO instead of EOF when the slave is closed. Benign.

  • OSF 4.0

    EOF on the slave tty is not reported back to the master.

  • Solaris 8, 2.7, 2.6

    Has the "feature" of returning EOF just once?!

    EOF on the slave tty is not reported back to the master.

  • Windows NT/2k/XP (under Cygwin)

    When you send (print) a too long line (>160 chars) to a non-raw pty, the call just hangs forever and even alarm() cannot get you out. Don't complain to me...

    EOF on the slave tty is not reported back to the master.

  • z/OS

The following systems have not been verified yet for this version, but a previous version worked on them:

  • SCO Unix

  • NetBSD

    probably the same as the other *BSDs...

If you have additions to these lists, please mail them to <[email protected]>.

SEE ALSO

IO::Pty, IO::Tty::Constant

MAILING LISTS

As this module is mainly used by Expect, support for it is available via the two Expect mailing lists, expectperl-announce and expectperl-discuss, at

http://lists.sourceforge.net/lists/listinfo/expectperl-announce

and

http://lists.sourceforge.net/lists/listinfo/expectperl-discuss

AUTHORS

Originally by Graham Barr <[email protected]>, based on the Ptty module by Nick Ing-Simmons <[email protected]>.

Now maintained and heavily rewritten by Roland Giersig <[email protected]>.

Contains copyrighted stuff from openssh v3.0p1, authored by Tatu Ylonen [email protected], Markus Friedl and Todd C. Miller [email protected]. I also got a lot of inspiration from the pty code in Xemacs.

COPYRIGHT

Now all code is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

Nevertheless the above AUTHORS retain their copyrights to the various parts and want to receive credit if their source code is used. See the source for details.

DISCLAIMER

THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

In other words: Use at your own risk. Provided as is. Your mileage may vary. Read the source, Luke!

And finally, just to be sure:

Any Use of This Product, in Any Manner Whatsoever, Will Increase the Amount of Disorder in the Universe. Although No Liability Is Implied Herein, the Consumer Is Warned That This Process Will Ultimately Lead to the Heat Death of the Universe.

io-tty's People

Contributors

toddr avatar rgiersig avatar dsteinbrunner avatar bluhm avatar bingos avatar oylenshpeegul avatar hugmeir avatar fgasper avatar kraj avatar manwar avatar pghmcfc avatar skaji avatar scop avatar tzccinct avatar

Stargazers

Elvin Aslanov avatar Ilya avatar Thibault Duponchelle avatar Christopher Layne avatar Neil Locketz avatar  avatar

Watchers

 avatar James Cloos avatar

io-tty's Issues

Possible memory corruption [rt.cpan.org #76921]

Migrated from rt.cpan.org#76921 (status was 'new')

Requestors:

From http://tsdme.nl/portfolio/ on 2012-05-01 10:50:19
:

I get the following error message when trying to run Mosh on Cygwin. I
already reported this bug to them, but they told me to take it up with
the IO-Tty team.

"Possible memory corruption: ioctl overflowed 3rd argument at
/usr/lib/perl5/site
_perl/5.10/i686-cygwin/IO/Tty.pm line 57."

The issue at tje mosh project:
https://github.com/keithw/mosh/issues/151

Perl -v: This is perl, v5.10.1 (*) built for i686-cygwin-thread-multi-64int
uname -a: CYGWIN_NT-6.1 cm-pc 1.7.13(0.260/5/3) 2012-04-05 12:43 i686 Cygwin

IOO:TTy not compiling in new Oracle Solaris 11.4 (beta) [rt.cpan.org #124287]

Migrated from rt.cpan.org#124287 (status was 'open')

Requestors:

From [email protected] on 2018-02-01 09:25:39
:

I tried to compile Expect on the new Solaris 11.4 Beta as i need Tty.so 
but failed at the IO:Tty part

what I have done, see 
https://forums.servethehome.com/index.php?threads/oracle-solaris-11-4.18133/#post-179726

I have tried IO-Tty rel 1.12 and 1.13_01

Writing Makefile for IO::Tty
Writing MYMETA.yml and MYMETA.json
root@solaris114:~/IO-Tty-1.13_01# make install
cp Tty.pm blib/lib/IO/Tty.pm
cp Pty.pm blib/lib/IO/Pty.pm
cp Tty/Constant.pm blib/lib/IO/Tty/Constant.pm
Running Mkbootstrap for IO::Tty ()
chmod 644 "Tty.bs"
"/usr/perl5/5.22/bin/perl" "/usr/perl5/5.22/lib/ExtUtils/xsubpp"  -typemap "/usr/perl5/5.22/lib/ExtUtils/typemap"  Tty.xs > Tty.xsc && mv Tty.xsc Tty.c
cc -c    -D_REENTRANT -m64 -D_LARGEFILE64_SOURCE -DPERL_USE_SAFE_PUTENV -xO4    -DVERSION=\"1.13_01\"  -DXS_VERSION=\"1.13_01\" -KPIC "-I/usr/perl5/5.22/lib/i86pc-solaris-thread-multi-64/CORE"  -DHAVE_DEV_PTMX -DHAVE_GRANTPT -DHAVE_POSIX_OPENPT -DHAVE_PTSNAME -DHAVE_SIGACTION -DHAVE_STRLCPY -DHAVE_SYS_STROPTS_H -DHAVE_TERMIOS_H -DHAVE_TERMIO_H -DHAVE_TTYNAME -DHAVE_UNLOCKPT Tty.c
cc: error: unrecognized command line option '-KPIC'
*** Error code 1
make: Fatal error: Command failed for target `Tty.o'
root@solaris114:~/IO-Tty-1.13_01#



best regards


Gea

-- 
Guenther Alka, Dipl.-Ing. (FH)

Rektor-Klaus Str. 71
73525 Schwäbisch Gmünd


From [email protected] on 2018-02-06 15:56:35
:

Hi.

I was given responsibility for Expect, and also co-maint on many IO::*ty
modules, including this one. I really don't know Solaris, nor this code
base.

The key, of course, is that the C compiler is kicking out the error
"unrecognized
command line option '-KPIC'".

I did some searching, and that error seems to come from your perl being
built with the Solaris C compiler and you trying to build your module with
the Gnu C compiler, or perhaps the other way around.

I'm not sure what flags you would need for perl Makefile.PL to get the this
aligned with what has been built, but that's where I would start
investigating.

Best of luck.


On Thu, Feb 1, 2018 at 4:25 AM, [email protected] via RT <
[email protected]> wrote:

> Thu Feb 01 04:25:39 2018: Request 124287 was acted upon.
> Transaction: Ticket created by [email protected]
>        Queue: IO-Tty
>      Subject: IOO:TTy not compiling in new Oracle Solaris 11.4 (beta)
>    Broken in: (no value)
>     Severity: (no value)
>        Owner: Nobody
>   Requestors: [email protected]
>       Status: new
>  Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=124287 >
>
>
> I tried to compile Expect on the new Solaris 11.4 Beta as i need Tty.so
> but failed at the IO:Tty part
>
> what I have done, see
> https://forums.servethehome.com/index.php?threads/oracle-
> solaris-11-4.18133/#post-179726
>
> I have tried IO-Tty rel 1.12 and 1.13_01
>
> Writing Makefile for IO::Tty
> Writing MYMETA.yml and MYMETA.json
> root@solaris114:~/IO-Tty-1.13_01# make install
> cp Tty.pm blib/lib/IO/Tty.pm
> cp Pty.pm blib/lib/IO/Pty.pm
> cp Tty/Constant.pm blib/lib/IO/Tty/Constant.pm
> Running Mkbootstrap for IO::Tty ()
> chmod 644 "Tty.bs"
> "/usr/perl5/5.22/bin/perl" "/usr/perl5/5.22/lib/ExtUtils/xsubpp"
> -typemap "/usr/perl5/5.22/lib/ExtUtils/typemap"  Tty.xs > Tty.xsc && mv
> Tty.xsc Tty.c
> cc -c    -D_REENTRANT -m64 -D_LARGEFILE64_SOURCE -DPERL_USE_SAFE_PUTENV
> -xO4    -DVERSION=\"1.13_01\"  -DXS_VERSION=\"1.13_01\" -KPIC
> "-I/usr/perl5/5.22/lib/i86pc-solaris-thread-multi-64/CORE"
> -DHAVE_DEV_PTMX -DHAVE_GRANTPT -DHAVE_POSIX_OPENPT -DHAVE_PTSNAME
> -DHAVE_SIGACTION -DHAVE_STRLCPY -DHAVE_SYS_STROPTS_H -DHAVE_TERMIOS_H
> -DHAVE_TERMIO_H -DHAVE_TTYNAME -DHAVE_UNLOCKPT Tty.c
> cc: error: unrecognized command line option '-KPIC'
> *** Error code 1
> make: Fatal error: Command failed for target `Tty.o'
> root@solaris114:~/IO-Tty-1.13_01#
>
>
>
> best regards
>
>
> Gea
>
> --
> Guenther Alka, Dipl.-Ing. (FH)
>
> Rektor-Klaus Str. 71
> 73525 Schwäbisch Gmünd
>



-- 
Dave Jacoby
[email protected]

Don't panic when the crisis is happening, or you won't enjoy it.


From [email protected] on 2018-02-06 19:26:10
:

I have just been informed that there's a non-system perl in
/usr/perl5/5.22/bin that should include cpan, so you should be able to
install IO::Tty with that, and that 5.26 is available via pkg.

Best of luck.

On Tue, Feb 6, 2018 at 10:56 AM, Dave Jacoby <[email protected]> wrote:

> Hi.
>
> I was given responsibility for Expect, and also co-maint on many IO::*ty
> modules, including this one. I really don't know Solaris, nor this code
> base.
>
> The key, of course, is that the C compiler is kicking out the error "unrecognized
> command line option '-KPIC'".
>
> I did some searching, and that error seems to come from your perl being
> built with the Solaris C compiler and you trying to build your module with
> the Gnu C compiler, or perhaps the other way around.
>
> I'm not sure what flags you would need for perl Makefile.PL to get the
> this aligned with what has been built, but that's where I would start
> investigating.
>
> Best of luck.
>
>
> On Thu, Feb 1, 2018 at 4:25 AM, [email protected] via RT <
> [email protected]> wrote:
>
>> Thu Feb 01 04:25:39 2018: Request 124287 was acted upon.
>> Transaction: Ticket created by [email protected]
>>        Queue: IO-Tty
>>      Subject: IOO:TTy not compiling in new Oracle Solaris 11.4 (beta)
>>    Broken in: (no value)
>>     Severity: (no value)
>>        Owner: Nobody
>>   Requestors: [email protected]
>>       Status: new
>>  Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=124287 >
>>
>>
>> I tried to compile Expect on the new Solaris 11.4 Beta as i need Tty.so
>> but failed at the IO:Tty part
>>
>> what I have done, see
>> https://forums.servethehome.com/index.php?threads/oracle-sol
>> aris-11-4.18133/#post-179726
>>
>> I have tried IO-Tty rel 1.12 and 1.13_01
>>
>> Writing Makefile for IO::Tty
>> Writing MYMETA.yml and MYMETA.json
>> root@solaris114:~/IO-Tty-1.13_01# make install
>> cp Tty.pm blib/lib/IO/Tty.pm
>> cp Pty.pm blib/lib/IO/Pty.pm
>> cp Tty/Constant.pm blib/lib/IO/Tty/Constant.pm
>> Running Mkbootstrap for IO::Tty ()
>> chmod 644 "Tty.bs"
>> "/usr/perl5/5.22/bin/perl" "/usr/perl5/5.22/lib/ExtUtils/xsubpp"
>> -typemap "/usr/perl5/5.22/lib/ExtUtils/typemap"  Tty.xs > Tty.xsc && mv
>> Tty.xsc Tty.c
>> cc -c    -D_REENTRANT -m64 -D_LARGEFILE64_SOURCE -DPERL_USE_SAFE_PUTENV
>> -xO4    -DVERSION=\"1.13_01\"  -DXS_VERSION=\"1.13_01\" -KPIC
>> "-I/usr/perl5/5.22/lib/i86pc-solaris-thread-multi-64/CORE"
>> -DHAVE_DEV_PTMX -DHAVE_GRANTPT -DHAVE_POSIX_OPENPT -DHAVE_PTSNAME
>> -DHAVE_SIGACTION -DHAVE_STRLCPY -DHAVE_SYS_STROPTS_H -DHAVE_TERMIOS_H
>> -DHAVE_TERMIO_H -DHAVE_TTYNAME -DHAVE_UNLOCKPT Tty.c
>> cc: error: unrecognized command line option '-KPIC'
>> *** Error code 1
>> make: Fatal error: Command failed for target `Tty.o'
>> root@solaris114:~/IO-Tty-1.13_01#
>>
>>
>>
>> best regards
>>
>>
>> Gea
>>
>> --
>> Guenther Alka, Dipl.-Ing. (FH)
>>
>> Rektor-Klaus Str. 71
>> 73525 Schwäbisch Gmünd
>>
>
>
>
> --
> Dave Jacoby
> [email protected]
>
> Don't panic when the crisis is happening, or you won't enjoy it.
>



-- 
Dave Jacoby
[email protected]

Don't panic when the crisis is happening, or you won't enjoy it.


From [email protected] on 2018-02-06 20:06:33
:

hello Jacoby

Thanks for the reply.
The problem was that Makefile expects the Sun compiler while I used GCC-5

- It works as  I edited the Makefile and changed (Solaris 11.4)

CCCDLFLAGS = -KPIC to
CCCDLFLAGS = -fPIC

and commented the language option
OPTIMIZE = -xO4 to
#OPTIMIZE = -xO4

  and was able to compile the Perl module (call from the module folder) via

perl Makefile.PL
make
make test
make install

My napp-it where I needed the Tty.so binary for Expect is now working on 
Solaris 11.4b


Gea


Am 06.02.2018 um 20:26 schrieb [email protected] via RT:
> <URL: https://rt.cpan.org/Ticket/Display.html?id=124287 >
>
> I have just been informed that there's a non-system perl in
> /usr/perl5/5.22/bin that should include cpan, so you should be able to
> install IO::Tty with that, and that 5.26 is available via pkg.
>
> Best of luck.
>
> On Tue, Feb 6, 2018 at 10:56 AM, Dave Jacoby <[email protected]> wrote:
>
>> Hi.
>>
>> I was given responsibility for Expect, and also co-maint on many IO::*ty
>> modules, including this one. I really don't know Solaris, nor this code
>> base.
>>
>> The key, of course, is that the C compiler is kicking out the error "unrecognized
>> command line option '-KPIC'".
>>
>> I did some searching, and that error seems to come from your perl being
>> built with the Solaris C compiler and you trying to build your module with
>> the Gnu C compiler, or perhaps the other way around.
>>
>> I'm not sure what flags you would need for perl Makefile.PL to get the
>> this aligned with what has been built, but that's where I would start
>> investigating.
>>
>> Best of luck.
>>
>>
>> On Thu, Feb 1, 2018 at 4:25 AM, [email protected] via RT <
>> [email protected]> wrote:
>>
>>> Thu Feb 01 04:25:39 2018: Request 124287 was acted upon.
>>> Transaction: Ticket created by [email protected]
>>>         Queue: IO-Tty
>>>       Subject: IOO:TTy not compiling in new Oracle Solaris 11.4 (beta)
>>>     Broken in: (no value)
>>>      Severity: (no value)
>>>         Owner: Nobody
>>>    Requestors: [email protected]
>>>        Status: new
>>>   Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=124287 >
>>>
>>>
>>> I tried to compile Expect on the new Solaris 11.4 Beta as i need Tty.so
>>> but failed at the IO:Tty part
>>>
>>> what I have done, see
>>> https://forums.servethehome.com/index.php?threads/oracle-sol
>>> aris-11-4.18133/#post-179726
>>>
>>> I have tried IO-Tty rel 1.12 and 1.13_01
>>>
>>> Writing Makefile for IO::Tty
>>> Writing MYMETA.yml and MYMETA.json
>>> root@solaris114:~/IO-Tty-1.13_01# make install
>>> cp Tty.pm blib/lib/IO/Tty.pm
>>> cp Pty.pm blib/lib/IO/Pty.pm
>>> cp Tty/Constant.pm blib/lib/IO/Tty/Constant.pm
>>> Running Mkbootstrap for IO::Tty ()
>>> chmod 644 "Tty.bs"
>>> "/usr/perl5/5.22/bin/perl" "/usr/perl5/5.22/lib/ExtUtils/xsubpp"
>>> -typemap "/usr/perl5/5.22/lib/ExtUtils/typemap"  Tty.xs > Tty.xsc && mv
>>> Tty.xsc Tty.c
>>> cc -c    -D_REENTRANT -m64 -D_LARGEFILE64_SOURCE -DPERL_USE_SAFE_PUTENV
>>> -xO4    -DVERSION=\"1.13_01\"  -DXS_VERSION=\"1.13_01\" -KPIC
>>> "-I/usr/perl5/5.22/lib/i86pc-solaris-thread-multi-64/CORE"
>>> -DHAVE_DEV_PTMX -DHAVE_GRANTPT -DHAVE_POSIX_OPENPT -DHAVE_PTSNAME
>>> -DHAVE_SIGACTION -DHAVE_STRLCPY -DHAVE_SYS_STROPTS_H -DHAVE_TERMIOS_H
>>> -DHAVE_TERMIO_H -DHAVE_TTYNAME -DHAVE_UNLOCKPT Tty.c
>>> cc: error: unrecognized command line option '-KPIC'
>>> *** Error code 1
>>> make: Fatal error: Command failed for target `Tty.o'
>>> root@solaris114:~/IO-Tty-1.13_01#
>>>
>>>
>>>
>>> best regards
>>>
>>>
>>> Gea
>>>
>>> --
>>> Guenther Alka, Dipl.-Ing. (FH)
>>>
>>> Rektor-Klaus Str. 71
>>> 73525 Schwäbisch Gmünd
>>>
>>
>>
>> --
>> Dave Jacoby
>> [email protected]
>>
>> Don't panic when the crisis is happening, or you won't enjoy it.
>>
>
>

-- 
Guenther Ernst Alka, Dipl.-Ing. (FH)
Rektor-Klaus Str.71
73525 Schwäbisch Gmünd

[email protected]


error: implicit declaration of function 'openpty'

Building IO:Tty 1.14 on macOS with Xcode 12 beta and perl 5.28.3 fails:

Tty.xs:530:12: error: implicit declaration of function 'openpty' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
            ret = openpty(ptyfd, ttyfd, NULL, NULL, NULL);
                  ^

What worked for me was to revert b59e8e2.

1.14: test suite is failing when LTO is used

Looksk like when perl IO::Tty module is build with LTO some symbols are not added to the DSO and by this test suite is failing.

+ export 'CFLAGS=-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -flto=auto -flto-partition=none'
+ CFLAGS='-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -flto=auto -flto-partition=none'
+ export 'CXXFLAGS=-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -flto=auto -flto-partition=none'
+ CXXFLAGS='-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -flto=auto -flto-partition=none'
+ export 'FFLAGS=-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -I/usr/lib64/gfortran/modules -flto=auto -flto-partition=none'
+ FFLAGS='-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -I/usr/lib64/gfortran/modules -flto=auto -flto-partition=none'
+ export 'FCFLAGS=-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -I/usr/lib64/gfortran/modules -flto=auto -flto-partition=none'
+ FCFLAGS='-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -I/usr/lib64/gfortran/modules -flto=auto -flto-partition=none'
+ export 'LDFLAGS=-Wl,-z,relro -Wl,--as-needed  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -flto=auto -flto-partition=none -fuse-linker-plugin'
+ LDFLAGS='-Wl,-z,relro -Wl,--as-needed  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -flto=auto -flto-partition=none -fuse-linker-plugin'
+ export AR=/usr/bin/gcc-ar RANLIB=/usr/bin/gcc-ranlib NM=/usr/bin/gcc-nm
+ AR=/usr/bin/gcc-ar
+ RANLIB=/usr/bin/gcc-ranlib
+ NM=/usr/bin/gcc-nm
+ export CC=gcc CXX=g++
+ CC=gcc
+ CXX=g++
+ /usr/bin/perl Makefile.PL INSTALLDIRS=vendor NO_PACKLIST=1 NO_PERLLOCAL=1 'LDDLFLAGS=-lpthread -shared -Wl,-z,relro -Wl,--as-needed  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -flto=auto -flto-partition=none -fuse-linker-plugin' 'OPTIMIZE= -Wl,-z,relro -Wl,--as-needed  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -flto=auto -flto-partition=none -fuse-linker-plugin'
Now let's see what we can find out about your system
(logfiles of failing tests are available in the conf/ dir)...
Looking for _getpty()...... FOUND.
Looking for getpt()........ FOUND.
Looking for grantpt()...... FOUND.
Looking for openpty()...... FOUND.
Looking for posix_openpt(). FOUND.
Looking for ptsname()...... FOUND.
Looking for ptsname_r().... FOUND.
Looking for sigaction().... FOUND.
Looking for strlcpy()...... FOUND.
Looking for ttyname()...... FOUND.
Looking for unlockpt()..... FOUND.
Looking for libutil.h...... not found.
Looking for pty.h.......... FOUND.
Looking for sys/pty.h...... not found.
Looking for sys/ptyio.h.... not found.
Looking for sys/stropts.h.. not found.
Looking for termio.h....... FOUND.
Looking for termios.h...... FOUND.
Looking for util.h......... not found.
Checking which symbols compile OK...
(sorry for the tedious check, but some systems have not too clean
 header files, to say the least;  '+' means OK, '-' means not defined
 and '*' has compile problems...)
+B0 +B110 +B115200 +B1200 +B134 +B150 -B153600 +B1800 +B19200 +B200 +B230400 +B2400 +B300 -B307200 +B38400 +B460800 +B4800 +B50 +B57600 +B600 +B75 -B76800 +B9600 +BRKINT +BS0 +BS1 +BSDLY +CBAUD -CBAUDEXT +CBRK -CCTS_OFLOW -CDEL +CDSUSP +CEOF +CEOL -CEOL2 +CEOT +CERASE -CESC +CFLUSH +CIBAUD -CIBAUDEXT +CINTR +CKILL +CLNEXT +CLOCAL -CNSWTCH -CNUL +CQUIT +CR0 +CR1 +CR2 +CR3 +CRDLY +CREAD +CRPRNT +CRTSCTS -CRTSXOFF -CRTS_IFLOW +CS5 +CS6 +CS7 +CS8 +CSIZE +CSTART +CSTOP +CSTOPB +CSUSP -CSWTCH +CWERASE -DEFECHO -DIOC -DIOCGETP -DIOCSETP -DOSMODE +ECHO +ECHOCTL +ECHOE +ECHOK +ECHOKE +ECHONL +ECHOPRT +EXTA +EXTB +FF0 +FF1 +FFDLY -FIORDCHK +FLUSHO +HUPCL +ICANON +ICRNL +IEXTEN +IGNBRK +IGNCR +IGNPAR +IMAXBEL +INLCR +INPCK +ISIG +ISTRIP +IUCLC +IXANY +IXOFF +IXON -KBENABLED -LDCHG -LDCLOSE -LDDMAP -LDEMAP -LDGETT -LDGMAP -LDIOC -LDNMAP -LDOPEN -LDSETT -LDSMAP -LOBLK +NCCS +NL0 +NL1 +NLDLY +NOFLSH +OCRNL +OFDEL +OFILL +OLCUC +ONLCR +ONLRET +ONOCR +OPOST -PAGEOUT +PARENB -PAREXT +PARMRK +PARODD +PENDIN -RCV1EN -RTS_TOG +TAB0 +TAB1 +TAB2 +TAB3 +TABDLY -TCDSET +TCFLSH +TCGETA +TCGETS +TCIFLUSH +TCIOFF +TCIOFLUSH +TCION +TCOFLUSH +TCOOFF +TCOON +TCSADRAIN +TCSAFLUSH +TCSANOW +TCSBRK +TCSETA +TCSETAF +TCSETAW -TCSETCTTY +TCSETS +TCSETSF +TCSETSW +TCXONC -TERM_D40 -TERM_D42 -TERM_H45 -TERM_NONE -TERM_TEC -TERM_TEX -TERM_V10 -TERM_V61 +TIOCCBRK -TIOCCDTR +TIOCCONS +TIOCEXCL -TIOCFLUSH -TIOCGETC +TIOCGETD -TIOCGETP -TIOCGLTC +TIOCGPGRP +TIOCGSID +TIOCGSOFTCAR +TIOCGWINSZ -TIOCHPCL -TIOCKBOF -TIOCKBON -TIOCLBIC -TIOCLBIS -TIOCLGET -TIOCLSET +TIOCMBIC +TIOCMBIS +TIOCMGET +TIOCMSET +TIOCM_CAR +TIOCM_CD +TIOCM_CTS +TIOCM_DSR +TIOCM_DTR +TIOCM_LE +TIOCM_RI +TIOCM_RNG +TIOCM_RTS +TIOCM_SR +TIOCM_ST +TIOCNOTTY +TIOCNXCL +TIOCOUTQ -TIOCREMOTE +TIOCSBRK +TIOCSCTTY -TIOCSDTR -TIOCSETC +TIOCSETD -TIOCSETN -TIOCSETP -TIOCSIGNAL -TIOCSLTC +TIOCSPGRP -TIOCSSID +TIOCSSOFTCAR -TIOCSTART +TIOCSTI -TIOCSTOP +TIOCSWINSZ -TM_ANL -TM_CECHO -TM_CINVIS -TM_LCF -TM_NONE -TM_SET -TM_SNL +TOSTOP -VCEOF -VCEOL +VDISCARD -VDSUSP +VEOF +VEOL +VEOL2 +VERASE +VINTR +VKILL +VLNEXT +VMIN +VQUIT +VREPRINT +VSTART +VSTOP +VSUSP -VSWTCH +VT0 +VT1 +VTDLY +VTIME +VWERASE -WRAP +XCASE -XCLUDE -XMT1EN +XTABS

>>> Configuration looks good! <<<

Writing IO::Tty::Constant.pm...
DEFINE = -DHAVE_DEV_PTMX -DHAVE_GETPT -DHAVE_GRANTPT -DHAVE_OPENPTY -DHAVE_POSIX_OPENPT -DHAVE_PTSNAME -DHAVE_PTSNAME_R -DHAVE_PTY_H -DHAVE_SIGACTION -DHAVE_STRLCPY -DHAVE_TERMIOS_H -DHAVE_TERMIO_H -DHAVE_TTYNAME -DHAVE_UNLOCKPT -DHAVE__GETPTY
Checking if your kit is complete...
Looks good
Generating a Unix-style Makefile
Writing Makefile for IO::Tty
Writing MYMETA.yml and MYMETA.json
+ /usr/bin/make -O -j48 V=1 VERBOSE=1
Running Mkbootstrap for Tty ()
chmod 644 "Tty.bs"
"/usr/bin/perl" -MExtUtils::Command::MM -e 'cp_nonempty' -- Tty.bs blib/arch/auto/IO/Tty/Tty.bs 644
cp Tty.pm blib/lib/IO/Tty.pm
cp Tty/Constant.pm blib/lib/IO/Tty/Constant.pm
cp Pty.pm blib/lib/IO/Pty.pm
"/usr/bin/perl" "/usr/share/perl5/vendor_perl/ExtUtils/xsubpp"  -typemap '/usr/share/perl5/ExtUtils/typemap'  Tty.xs > Tty.xsc
mv Tty.xsc Tty.c
gcc -c   -D_REENTRANT -D_GNU_SOURCE -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -flto=auto -flto-partition=none -fwrapv -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -Wl,-z,relro -Wl,--as-needed  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -flto=auto -flto-partition=none -fuse-linker-plugin   -DVERSION=\"1.14\" -DXS_VERSION=\"1.14\" -fPIC "-I/usr/lib64/perl5/CORE"  -DHAVE_DEV_PTMX -DHAVE_GETPT -DHAVE_GRANTPT -DHAVE_OPENPTY -DHAVE_POSIX_OPENPT -DHAVE_PTSNAME -DHAVE_PTSNAME_R -DHAVE_PTY_H -DHAVE_SIGACTION -DHAVE_STRLCPY -DHAVE_TERMIOS_H -DHAVE_TERMIO_H -DHAVE_TTYNAME -DHAVE_UNLOCKPT -DHAVE__GETPTY Tty.c
Tty.xs: In function 'open_slave':
Tty.xs:310:9: warning: implicit declaration of function 'strlcpy'; did you mean 'strncpy'? [-Wimplicit-function-declaration]
  310 |      if(strlcpy(namebuf, name, namebuflen) >= namebuflen) {
      |         ^~~~~~~
      |         strncpy
Tty.xs: In function 'allocate_pty':
Tty.xs:468:14: warning: implicit declaration of function '_getpty'; did you mean 'getpt'? [-Wimplicit-function-declaration]
  468 |      slave = _getpty(ptyfd, O_RDWR, 0622, 0);
      |              ^~~~~~~
      |              getpt
Tty.xs:468:12: warning: assignment to 'char *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
  468 |      slave = _getpty(ptyfd, O_RDWR, 0622, 0);
      |            ^
Tty.xs: In function 'XS_IO__Tty_unpack_winsize':
Tty.xs:865:12: warning: format '%d' expects argument of type 'int', but argument 2 has type 'STRLEN' {aka 'long unsigned int'} [-Wformat=]
  865 |      croak("IO::Tty::unpack_winsize(): Bad arg length - got %d, expected %d",
      |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Tty.xs:865:12: warning: format '%d' expects argument of type 'int', but argument 3 has type 'long unsigned int' [-Wformat=]
rm -f blib/arch/auto/IO/Tty/Tty.so
gcc  -lpthread -shared -Wl,-z,relro -Wl,--as-needed  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -flto=auto -flto-partition=none -fuse-linker-plugin  Tty.o  -o blib/arch/auto/IO/Tty/Tty.so  \
   -lutil -lperl   \

chmod 755 blib/arch/auto/IO/Tty/Tty.so
Manifying 3 pod documents
+ OPTIMIZE=' -Wl,-z,relro -Wl,--as-needed  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -flto=auto -flto-partition=none -fuse-linker-plugin'
+ RPM_EC=0
++ jobs -p
+ exit 0
Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.nQqQAo
+ umask 022
+ cd /home/tkloczko/rpmbuild/BUILD
+ '[' /home/tkloczko/rpmbuild/BUILDROOT/perl-IO-Tty-1.14-4.fc33.x86_64 '!=' / ']'
+ /usr/bin/rm -rf /home/tkloczko/rpmbuild/BUILDROOT/perl-IO-Tty-1.14-4.fc33.x86_64
+ /usr/bin/mkdir /home/tkloczko/rpmbuild/BUILDROOT/perl-IO-Tty-1.14-4.fc33.x86_64
+ cd IO-Tty-1.14
+ /usr/bin/make install DESTDIR=/home/tkloczko/rpmbuild/BUILDROOT/perl-IO-Tty-1.14-4.fc33.x86_64 'INSTALL=/usr/bin/install -p'
"/usr/bin/perl" -MExtUtils::Command::MM -e 'cp_nonempty' -- Tty.bs blib/arch/auto/IO/Tty/Tty.bs 644
Manifying 3 pod documents
Files found in blib/arch: installing files in blib/lib into architecture dependent library tree
Installing /home/tkloczko/rpmbuild/BUILDROOT/perl-IO-Tty-1.14-4.fc33.x86_64/usr/lib64/perl5/vendor_perl/auto/IO/Tty/Tty.so
Installing /home/tkloczko/rpmbuild/BUILDROOT/perl-IO-Tty-1.14-4.fc33.x86_64/usr/lib64/perl5/vendor_perl/IO/Tty.pm
Installing /home/tkloczko/rpmbuild/BUILDROOT/perl-IO-Tty-1.14-4.fc33.x86_64/usr/lib64/perl5/vendor_perl/IO/Pty.pm
Installing /home/tkloczko/rpmbuild/BUILDROOT/perl-IO-Tty-1.14-4.fc33.x86_64/usr/lib64/perl5/vendor_perl/IO/Tty/Constant.pm
Installing /home/tkloczko/rpmbuild/BUILDROOT/perl-IO-Tty-1.14-4.fc33.x86_64/usr/share/man/man3/IO::Pty.3pm
Installing /home/tkloczko/rpmbuild/BUILDROOT/perl-IO-Tty-1.14-4.fc33.x86_64/usr/share/man/man3/IO::Tty.3pm
Installing /home/tkloczko/rpmbuild/BUILDROOT/perl-IO-Tty-1.14-4.fc33.x86_64/usr/share/man/man3/IO::Tty::Constant.3pm
+ /usr/bin/chmod 755 /home/tkloczko/rpmbuild/BUILDROOT/perl-IO-Tty-1.14-4.fc33.x86_64/usr/lib64/perl5/vendor_perl/auto/IO/Tty/Tty.so
+ /usr/lib/rpm/find-debuginfo.sh -j48 --strict-build-id -m -i --build-id-seed 1.14-4.fc33 --unique-debug-suffix -1.14-4.fc33.x86_64 --unique-debug-src-base perl-IO-Tty-1.14-4.fc33.x86_64 --run-dwz --dwz-low-mem-die-limit 10000000 --dwz-max-die-limit 110000000 -S debugsourcefiles.list /home/tkloczko/rpmbuild/BUILD/IO-Tty-1.14
explicitly decompress any DWARF compressed ELF sections in /home/tkloczko/rpmbuild/BUILDROOT/perl-IO-Tty-1.14-4.fc33.x86_64/usr/lib64/perl5/vendor_perl/auto/IO/Tty/Tty.so
extracting debug info from /home/tkloczko/rpmbuild/BUILDROOT/perl-IO-Tty-1.14-4.fc33.x86_64/usr/lib64/perl5/vendor_perl/auto/IO/Tty/Tty.so
original debug info size: 112kB, size after compression: 104kB
/usr/lib/rpm/sepdebugcrcfix: Updated 1 CRC32s, 0 CRC32s did match.
132 blocks
+ /usr/lib/rpm/check-buildroot
+ /usr/lib/rpm/redhat/brp-ldconfig
+ /usr/lib/rpm/brp-compress
+ /usr/lib/rpm/brp-strip-static-archive /usr/bin/strip
+ /usr/lib/rpm/brp-python-bytecompile /usr/bin/python 1 0
+ /usr/lib/rpm/brp-python-hardlink
+ /usr/lib/rpm/redhat/brp-mangle-shebangs
Executing(%check): /bin/sh -e /var/tmp/rpm-tmp.cQjkps
+ umask 022
+ cd /home/tkloczko/rpmbuild/BUILD
+ cd IO-Tty-1.14
+ /usr/bin/make -O -j48 V=1 VERBOSE=1 test
"/usr/bin/perl" -MExtUtils::Command::MM -e 'cp_nonempty' -- Tty.bs blib/arch/auto/IO/Tty/Tty.bs 644
PERL_DL_NONLAZY=1 "/usr/bin/perl" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
Can't load '/home/tkloczko/rpmbuild/BUILD/IO-Tty-1.14/blib/arch/auto/IO/Tty/Tty.so' for module IO::Tty: /home/tkloczko/rpmbuild/BUILD/IO-Tty-1.14/blib/arch/auto/IO/Tty/Tty.so: undefined symbol: _getpty at /usr/lib64/perl5/DynaLoader.pm line 193.
 at /home/tkloczko/rpmbuild/BUILD/IO-Tty-1.14/blib/lib/IO/Tty.pm line 31.
Compilation failed in require at /home/tkloczko/rpmbuild/BUILD/IO-Tty-1.14/blib/lib/IO/Pty.pm line 7.
BEGIN failed--compilation aborted at /home/tkloczko/rpmbuild/BUILD/IO-Tty-1.14/blib/lib/IO/Pty.pm line 7.
Compilation failed in require at t/pty_get_winsize.t line 9.
BEGIN failed--compilation aborted at t/pty_get_winsize.t line 9.
t/pty_get_winsize.t ..
Dubious, test returned 2 (wstat 512, 0x200)
No subtests run
Can't load '/home/tkloczko/rpmbuild/BUILD/IO-Tty-1.14/blib/arch/auto/IO/Tty/Tty.so' for module IO::Tty: /home/tkloczko/rpmbuild/BUILD/IO-Tty-1.14/blib/arch/auto/IO/Tty/Tty.so: undefined symbol: _getpty at /usr/lib64/perl5/DynaLoader.pm line 193.
 at /home/tkloczko/rpmbuild/BUILD/IO-Tty-1.14/blib/lib/IO/Tty.pm line 31.
Compilation failed in require at /home/tkloczko/rpmbuild/BUILD/IO-Tty-1.14/blib/lib/IO/Pty.pm line 7.
BEGIN failed--compilation aborted at /home/tkloczko/rpmbuild/BUILD/IO-Tty-1.14/blib/lib/IO/Pty.pm line 7.
Compilation failed in require at t/test.t line 9.
BEGIN failed--compilation aborted at t/test.t line 9.
# Looks like your test exited with 2 before it could output anything.
t/test.t .............
Dubious, test returned 2 (wstat 512, 0x200)
Failed 5/5 subtests

Test Summary Report
-------------------
t/pty_get_winsize.t (Wstat: 512 Tests: 0 Failed: 0)
  Non-zero exit status: 2
  Parse errors: No plan found in TAP output
t/test.t           (Wstat: 512 Tests: 0 Failed: 0)
  Non-zero exit status: 2
  Parse errors: Bad plan.  You planned 5 tests but ran 0.
Files=2, Tests=0,  0 wallclock secs ( 0.03 usr  0.01 sys +  0.11 cusr  0.07 csys =  0.22 CPU)
Result: FAIL
Failed 2/2 test programs. 0/0 subtests failed.
make: *** [Makefile:1018: test_dynamic] Error 2

File numbers not closed on some operating systems [rt.cpan.org #130491]

Migrated from rt.cpan.org#130491 (status was 'new')

Requestors:

From [email protected] on 2019-09-11 07:07:08
:

IPC::Run is has a broken test in t/pty.t because IO::Pty objects are not closing all of their file handles when they are destroyed.

https://github.com/toddr/IPC-Run/issues/130

On Fedora 29 and Redhat 8, file handle 4 doesn't reliably close. I've seen it close occasionally so this failure isn't even consistent.

$>perl -MIO::Pty -MIPC::Run::Debug -wE'print __FILE__ . " " . __LINE__ . "  " . IPC::Run::Debug::_map_fds() . "\n";my $h = IO::Pty->new; print __FILE__ . " " . __LINE__ . "  " . IPC::Run::Debug::_map_fds() . "\n";undef $h; print __FILE__ . " " . __LINE__ . "  " . IPC::Run::Debug::_map_fds() . "\n";'
-e 1  012---------
-e 1  012345------
-e 1  012-4-------

From [email protected] on 2019-09-11 07:08:51
:

See also https://github.com/toddr/IPC-Run/issues/56

From [email protected] on 2019-09-11 07:16:34
:

The file handle seems to get re-used so this isn't a incrementing leak.

$>perl -MIO::Pty -MIPC::Run::Debug -wE'sub loop { print __FILE__ . " " . __LINE__ . "  " . IPC::Run::Debug::_map_fds() . "\n";my $h = IO::Pty->new; print __FILE__ . " " . __LINE__ . "  " . IPC::Run::Debug::_map_fds() . "\n";undef $h; print __FILE__ . " " . __LINE__ . "  " . IPC::Run::Debug::_map_fds() . "\n"; } loop() for(1..10);'
-e 1  012---------
-e 1  012345------
-e 1  012-4-------
-e 1  012-4-------
-e 1  012345------
-e 1  012-4-------
-e 1  012-4-------
-e 1  012345------
-e 1  012-4-------
-e 1  012-4-------
-e 1  012345------
-e 1  012-4-------
-e 1  012-4-------
-e 1  012345------
-e 1  012-4-------
-e 1  012-4-------
-e 1  012345------
-e 1  012-4-------
-e 1  012-4-------
-e 1  012345------
-e 1  012-4-------
-e 1  012-4-------
-e 1  012345------
-e 1  012-4-------
-e 1  012-4-------
-e 1  012345------
-e 1  012-4-------
-e 1  012-4-------
-e 1  012345------
-e 1  012-4-------

CPAN and MetaCPAN doesn't have the latest version

Hi,

I noticed github has the latest v1.13_01. However CPAN and MetaCPAN still has v1.12
It would be nice if they also have the same version as the github, as not everyone look for updated code in github.

Many Thanks,

Best Regards,
Mohammad S Anwar

IO-Tty-1.18 does not work on FreeBSD 14

I haven't tested on different FreeBSD versions, but I have tested on two different FreeBSD 14 systems, one with 1.17 (from packages) and one with 1.18 (from ports).

The symptom is it installs but can't open any ptys. This test program demonstrates it:

#!/usr/local/bin/perl
use IO::Pty;
$mpty = IO::Pty->new;

In the broken state, truss indicates it's trying to open lots of pty variations that don't exist:

openat(AT_FDCWD,"/dev/ptyp0151",O_RDWR|O_NOCTTY,00) ERR#2 'No such file or directory'
openat(AT_FDCWD,"/dev/ptyto",O_RDWR|O_NOCTTY,00) ERR#2 'No such file or directory'
openat(AT_FDCWD,"/dev/ptyp152",O_RDWR|O_NOCTTY,00) ERR#2 'No such file or directory'
openat(AT_FDCWD,"/dev/pt/to",O_RDWR|O_NOCTTY,00) ERR#2 'No such file or directory'
openat(AT_FDCWD,"/dev/ptyp0152",O_RDWR|O_NOCTTY,00) ERR#2 'No such file or directory'
openat(AT_FDCWD,"/dev/ptytp",O_RDWR|O_NOCTTY,00) ERR#2 'No such file or directory'

And then pty_allocate() returns nothing.

Comparing build output from 1.17 and 1.18 shows the build process is not finding a lot of needed functions.

Building 1.17 (cd /usr/ports/devel/p5-IO-Tty ; make) the following functions are found:

Looking for _getpty()...... not found.
Looking for getpt()........ not found.
Looking for grantpt()...... FOUND.
Looking for openpty()...... FOUND.
Looking for posix_openpt(). FOUND.
Looking for ptsname()...... FOUND.
Looking for ptsname_r().... FOUND.
Looking for sigaction().... FOUND.
Looking for strlcpy()...... FOUND.
Looking for ttyname()...... FOUND.
Looking for unlockpt()..... FOUND.
Looking for libutil.h...... FOUND.
Looking for pty.h.......... not found.
Looking for sys/pty.h...... not found.
Looking for sys/ptyio.h.... not found.
Looking for sys/stropts.h.. not found.
Looking for termio.h....... not found.
Looking for termios.h...... FOUND.
Looking for util.h......... not found.

Doing the same with 1.18:

Looking for getpt()........ not found.
Looking for grantpt()...... not found.
Looking for openpty()...... not found.
Looking for posix_openpt(). not found.
Looking for ptsname()...... not found.
Looking for ptsname_r().... not found.
Looking for sigaction().... not found.
Looking for strlcpy()...... not found.
Looking for ttyname()...... not found.
Looking for unlockpt()..... not found.
Looking for libutil.h...... FOUND.
Looking for pty.h.......... not found.
Looking for sys/pty.h...... not found.
Looking for sys/ptyio.h.... not found.
Looking for sys/stropts.h.. not found.
Looking for termio.h....... not found.
Looking for termios.h...... FOUND.
Looking for util.h......... not found.

I'm happy to test any fixes.

Build error on freebsd 13

Building IO-Tty-1.17 started to fail on my freebsd 13 system (currently 13.2-STABLE). It seems that the configuration check fails to find most functions. A comparison between freebsd 12 and 13:

  • freebsd 12:
Now let's see what we can find out about your system
(logfiles of failing tests are available in the conf/ dir)...
Looking for _getpty()...... not found.
Looking for getpt()........ not found.
Looking for grantpt()...... FOUND.
Looking for openpty()...... FOUND.
Looking for posix_openpt(). FOUND.
Looking for ptsname()...... FOUND.
Looking for ptsname_r().... FOUND.
Looking for sigaction().... FOUND.
Looking for strlcpy()...... FOUND.
Looking for ttyname()...... FOUND.
Looking for unlockpt()..... FOUND.
Looking for libutil.h...... FOUND.
Looking for pty.h.......... not found.
Looking for sys/pty.h...... not found.
Looking for sys/ptyio.h.... not found.
Looking for sys/stropts.h.. not found.
Looking for termio.h....... not found.
Looking for termios.h...... FOUND.
Looking for util.h......... not found.
...
  • freebsd 13:
Now let's see what we can find out about your system
(logfiles of failing tests are available in the conf/ dir)...
Looking for _getpty()...... not found.
Looking for getpt()........ not found.
Looking for grantpt()...... not found.
Looking for openpty()...... not found.
Looking for posix_openpt(). not found.
Looking for ptsname()...... not found.
Looking for ptsname_r().... not found.
Looking for sigaction().... not found.
Looking for strlcpy()...... not found.
Looking for ttyname()...... not found.
Looking for unlockpt()..... not found.
Looking for libutil.h...... FOUND.
Looking for pty.h.......... not found.
Looking for sys/pty.h...... not found.
Looking for sys/ptyio.h.... not found.
Looking for sys/stropts.h.. not found.
Looking for termio.h....... not found.
Looking for termios.h...... FOUND.
Looking for util.h......... not found.

For example, the log for strlcpy looks like this:

functest_strlcpy.c:10:6: warning: incompatible redeclaration of library function 'strlcpy' [-Wincompatible-library-redeclaration]
char strlcpy ();
     ^
functest_strlcpy.c:10:6: note: 'strlcpy' is a builtin with type 'unsigned long (char *, const char *, unsigned long)'
functest_strlcpy.c:28:3: error: incompatible integer to pointer conversion assigning to 'char (*)()' from 'char' [-Wint-conversion]
f = strlcpy ();
  ^ ~~~~~~~~~~
1 warning and 1 error generated.

`make` error on haiku [rt.cpan.org #101094]

Migrated from rt.cpan.org#101094 (status was 'stalled')

Requestors:

Attachments:

From [email protected] on 2014-12-23 02:07:13
:

Greetings,

When attempting to `make` this module on Haiku, some errors in Tty.xs present themselves:

815: parse error before `struct`
817: `ws` undeclared

I was able to fix this error and allow the module to pass all tests on this platform using the following patch:

pack_winsize(row, col, xpixel = 0, ypixel = 0)
-	int row
-	int col
-	int xpixel
-	int ypixel
    INIT:
+	int row;
+	int col;
+	int xpixel;
+	int ypixel;
	struct winsize ws;
    CODE:

Test report is attached.

From [email protected] on 2015-07-27 05:06:10
:

Applying that patch on OSX for causes the output below. I suspect I'd see the same thing on linux.

"/usr/bin/perl" "/Library/Perl/5.18/ExtUtils/xsubpp"  -typemap "/System/Library/Perl/5.18/ExtUtils/typemap"  Tty.xs > Tty.xsc && mv Tty.xsc Tty.c
cc -c   -arch x86_64 -arch i386 -g -pipe -fno-common -DPERL_DARWIN -fno-strict-aliasing -fstack-protector -Os   -DVERSION=\"1.13_01\" -DXS_VERSION=\"1.13_01\"  "-I/System/Library/Perl/5.18/darwin-thread-multi-2level/CORE"  -DHAVE_DEV_PTMX -DHAVE_GRANTPT -DHAVE_OPENPTY -DHAVE_POSIX_OPENPT -DHAVE_PTSNAME -DHAVE_SIGACTION -DHAVE_STRLCPY -DHAVE_TERMIOS_H -DHAVE_TTYNAME -DHAVE_UNLOCKPT -DHAVE_UTIL_H Tty.c
Tty.xs:530:12: warning: implicit declaration of function 'openpty' is invalid in C99 [-Wimplicit-function-declaration]
            ret = openpty(ptyfd, ttyfd, NULL, NULL, NULL);
                  ^
Tty.xs:844:9: error: expected ';' at end of declaration
        int row
               ^
               ;
Tty.xs:845:9: error: expected ';' at end of declaration
        int col
               ^
               ;
Tty.xs:846:12: error: expected ';' at end of declaration
        int xpixel
                  ^
                  ;
Tty.xs:847:12: error: expected ';' at end of declaration
        int ypixel
                  ^
                  ;
Tty.xs:866:3: warning: format specifies type 'int' but the argument has type 'STRLEN' (aka 'unsigned long') [-Wformat]
                SvCUR(winsize), sizeof(ws));
                ^~~~~~~~~~~~~~
/System/Library/Perl/5.18/darwin-thread-multi-2level/CORE/sv.h:1222:23: note: expanded from macro 'SvCUR'
#    define SvCUR(sv) ((XPV*) SvANY(sv))->xpv_cur
                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~
Tty.xs:866:19: warning: format specifies type 'int' but the argument has type 'unsigned long' [-Wformat]
                SvCUR(winsize), sizeof(ws));
                                ^~~~~~~~~~
3 warnings and 4 errors generated.
make: *** [Tty.o] Error 1


From [email protected] on 2015-07-27 05:06:52
:

Git's patch for reference:

diff --git a/Tty.xs b/Tty.xs
index 1e4ac79..bbcf585 100644
--- a/Tty.xs
+++ b/Tty.xs
@@ -840,11 +840,11 @@ InOutStream handle
 
 SV *
 pack_winsize(row, col, xpixel = 0, ypixel = 0)
+    INIT:
        int row
        int col
        int xpixel
        int ypixel
-    INIT:
        struct winsize ws;
     CODE:
        ws.ws_row = row;

t/pty_get_winsize.t fails on AIX

"make test" fails on AIX in t/pty_get_winsize.t:

Cannot TIOCGWINSZ - Invalid argument at t/pty_get_winsize.t line 25.

The "invalid argument" appears to be the filehandle passed to ioctl. I wrote a small test program to verify that the TIOCGWINSZ ioctl works when called on STDIN, and then repeated the get_winsize() test:

use strict;
use warnings;
use IO::Pty ();
use Data::Dumper;

print "Current tty = ";
system "tty";
ioctl STDIN, IO::Tty::Constant::TIOCGWINSZ(), my $winsize = q<> or die $!;
print Dumper [ IO::Tty::unpack_winsize($winsize) ];

my $pty = IO::Pty->new();
print "New pty = ", $pty->ttyname, "\n";
print Dumper [ $pty->get_winsize() ];

Here is its output:

Current tty = /dev/pts/0
$VAR1 = [
          55,
          195,
          1192,
          722
        ];
New pty = /dev/pts/2
Cannot TIOCGWINSZ - Invalid argument at /home/builder/iotty line 15.

I've attached the output of "perl Makefile.PL" and "make test". This is on Perl 5.34.0 and AIX 7.1.5.4.

build.log

Test failures when constants are missing on armv6l-linux

http://www.cpantesters.org/cpan/report/8ca19b36-3ac5-11ea-9db8-1711312aa01a

Use of uninitialized value $IO::Tty::CONFIG in concatenation (.) or string at t/test.t line 17.
# Configuration: 
# Checking for appropriate ioctls:
Undefined subroutine &IO::Tty::Constant::TIOCNOTTY called at t/test.t line 19.
# Looks like your test exited with 255 before it could output anything.
t/test.t ............. 
Dubious, test returned 255 (wstat 65280, 0xff00)
Failed 5/5 subtests 

IO::Pty: read from pty master sometimes hangs on OS X [rt.cpan.org #65692]

Migrated from rt.cpan.org#65692 (status was 'open')

Requestors:

From [email protected] on 2011-02-13 05:26:49
:

Hi,

A few days ago, Thomas Rast reported that one of git's tests[1]
that uses IO::Pty was getting stuck randomly (i.e., not every
run).  Turns out this is reproducible without using git at all.

Reproduction recipe:

	i=0
	while ./demo.perl echo hi $i
	do
		: $((i = i + 1))
	done

Expected result:

	hi 0
	hi 1
	hi 2
	hi 3
	...

Actual result:

	Stops after 2000 iterations or so.

Platform:

	$ perl -V | head -4
	Summary of my perl5 (revision 5 version 10 subversion 0) configuration:
	  Platform:
	    osname=darwin, osvers=10.0, archname=darwin-thread-multi-2level
	    uname='darwin neige.apple.com 10.0 darwin kernel version 10.0.0d8: tue may 5 19:29:59 pdt 2009; root:xnu-1437.2~2release_i386 i386 '
	$ uname -rv
	10.5.0 Darwin Kernel Version 10.5.0: Fri Nov  5 23:19:13 PDT 2010; root:xnu-1504.9.17~1/RELEASE_X86_64

Also reproducible with perl 5.8.9.  demo.perl follows[2].

Ideas?
Jonathan

[1] http://thread.gmane.org/gmane.comp.version-control.git/166423
http://repo.or.cz/w/git.git/blob/v1.7.4:/t/t7006-pager.sh

[2] -- 8< --
#!/usr/bin/perl
use strict;
use warnings;
use IO::Pty;

my $master = new IO::Pty;
my $slave = $master->slave();

my $pid = fork;
if (not defined $pid) {
	die "fork failed: $!";
} elsif ($pid == 0) {	# child
	close $master or die "child: cannot close master: $!";
	open STDOUT, ">&", $slave or die "child: cannot dup2 slave: $!";
	close $slave or die "child: cannot close slave: $!";
	exec(@ARGV) or die "cannot exec $ARGV[0]: $!";
}
# parent
close $slave or die "parent: cannot close slave: $!";
while (1) {
	my $nread = sysread($master, my $buf, 4096);
	defined($nread) or $!{EIO} or die "cannot read from child: $!";
	last if !$nread;
	unless (syswrite(\*STDOUT, $buf, $nread) == $nread) {
		die "cannot write: $!";
	}
}
close $master or die "parent: cannot close master: $!";
my $waiting = waitpid($pid, 0);
die "waitpid failed: $!" if $waiting < 0;
exit($?);


From [email protected] on 2011-02-24 02:48:09
:

Here's a faster reproduction recipe.  This is on Mac OS X 10.5.0,
using Apple's perl.

perl -MIO::Pty -MFile::Copy -e '
	for (my $i = 0;; $i++) {
		my $master = new IO::Pty;
		my $slave = $master->slave;
		if (fork == 0) {
			close $master or die "close: $!";
			open STDOUT, ">&", $slave or die "dup2: $!";
			close $slave or die "close: $!";
			exec("echo", "hi", $i) or die "exec: $!";
		}
		close $slave or die "close: $!";
		copy($master, \*STDOUT) or die "copy: $!";
		close $master or die "close: $!";
		wait;
	}
'

Expected result:
	hi 0
	hi 1
	...

Actual result: stops after a while.  Sometimes 18 iterations,
sometimes 7000.  Shouldn't take more than a minute or so.


From [email protected] on 2012-01-21 20:38:18
:

I have perl 5.14 on lion and see the same thing. It seems to be hanging randomly.

set_raw not working properly on OSX? [rt.cpan.org #97552]

Migrated from rt.cpan.org#97552 (status was 'new')

Requestors:

From [email protected] on 2014-07-28 06:59:24
:

Expect.pm is a subclass of IO::Pty, this test script
https://github.com/szabgab/expect.pm/blob/master/t/02-bc.t
passes on Linux but fails on OSX.

It seems that the raw_pty(1); call of Expect.pm that calls the set_raw
method of IO::Pty does NOT turn off echoing on OSX.

See also  http://www.perlmonks.org/?node_id=1095239

Gabor


From [email protected] on 2014-07-30 04:08:41
:

Based on these test reports of Expect.pm, the same problem exists on
OpenBSD and NetBSD as well:

http://www.cpantesters.org/cpan/report/0b637b30-1789-11e4-b698-db7a2867dcfa
http://www.cpantesters.org/cpan/report/6afc07c8-1749-11e4-84c4-fc77f9652e90

See the fill list
http://www.cpantesters.org/distro/E/Expect.html?oncpan=1&distmat=1&version=1.23


IO-Tty-1.18 fails to install on Mac OS X

Apparently IO-Tty-1.18 fails to install on Mac OS X systems. I first noticed it as a build failure on such systems while installing dependencies of a project I maintain. Results from CPAN Testers seems to match that experience too.

It seems to work on other operating systems, and installing the previous version(s) seems working on Mac OS X too.

Unfortunately I do not have access to such systems apart from GitHub Action runners, nor do I have experience with IO-Tty internals itself, so I could not look into root causes so far. I'm not yet sure how I may be more helpful apart from opening this issue – please let me know.

RFE: Support Strawberry Perl on Windows via "winpty" library? [rt.cpan.org #93612]

Migrated from rt.cpan.org#93612 (status was 'open')

Requestors:

From @deven on 2014-03-07 16:09:13:
Could this "winpty" library be used to support Strawberry Perl on Windows without using cygwin pty emulation?

https://github.com/rprichard/winpty

Here's the description from that site:

winpty is a Windows software package providing an interface similar to a Unix pty-master for communicating with Windows console programs. The package consists of a library (libwinpty) and a tool for Cygwin and MSYS for running Windows console programs in a Cygwin/MSYS pty.

The software works by starting the winpty-agent.exe process with a new, hidden console window, which bridges between the console API and terminal input/output escape codes. It polls the hidden console's screen buffer for changes and generates a corresponding stream of output.

The Unix adapter allows running Windows console programs (e.g. CMD, PowerShell, IronPython, etc.) under mintty or Cygwin's sshd with properly-functioning input (e.g. arrow and function keys) and output (e.g. line buffering). The library could be also useful for writing a non-Cygwin SSH server.

From @toddr on 2014-05-05 14:40:20:

I have no ready access to windows. So my question is back to you. Does this work?

IO::TTY::Constant.pm not found

Seems to have been removed from cpan, the link in the readme is a 404, but IO::TTy still requires it.
Is it deprecated, or has it been removed from cpan in error?

fails to configure on Android 10 (aarch64)

I'm on an aarch64 phone running Android 10, and perl v5.32.1 via the Termux terminal emulator.

cpanm IO::Pty fails in the configuration stage, with the following output

--> Working on IO::Pty
Fetching http://www.cpan.org/authors/id/T/TO/TODDR/IO-Tty-1.16.tar.gz ... OK                              
Configuring IO-Tty-1.16 ... FAIL
! Timed out (> 60s). Use --verbose to retry.
! Configure failed for IO-Tty-1.16. See /data/data/com.termux/files/home/.cpanm/work/1624580664.8404/build.log for details.

And the log:

cpanm (App::cpanminus) 1.7044 on perl 5.032001 built for aarch64-android
Work directory is /data/data/com.termux/files/home/.cpanm/work/1624579152.1565
You have make /data/data/com.termux/files/usr/bin/make
You have LWP 6.54
You have /data/data/com.termux/files/usr/bin/tar: tar (GNU tar) 1.34
Copyright (C) 2021 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by John Gilmore and Jay Fenlason.
You have /data/data/com.termux/files/usr/bin/unzip
Searching IO::Pty () on cpanmetadb ...
--> Working on IO::Pty
Fetching http://www.cpan.org/authors/id/T/TO/TODDR/IO-Tty-1.16.tar.gz
-> OK
Unpacking IO-Tty-1.16.tar.gz
Entering IO-Tty-1.16
Checking configure dependencies from META.json
Checking if you have ExtUtils::MakeMaker 6.58 ... Yes (7.62)
Configuring IO-Tty-1.16
Running Makefile.PL
Now let's see what we can find out about your system
(logfiles of failing tests are available in the conf/ dir)...
Looking for _getpty()...... not found.
Looking for getpt()........ FOUND.
Looking for grantpt()...... FOUND.
Looking for openpty()...... FOUND.
Looking for posix_openpt(). FOUND.
Looking for ptsname()...... FOUND.
Looking for ptsname_r().... FOUND.
Looking for sigaction().... FOUND.
Looking for strlcpy()...... FOUND.
Looking for ttyname()...... FOUND.
Looking for unlockpt()..... FOUND.
Looking for libutil.h...... not found.
Looking for pty.h.......... FOUND.
Looking for sys/pty.h...... not found.
Looking for sys/ptyio.h.... not found.
Looking for sys/stropts.h.. not found.
Looking for termio.h....... FOUND.
Looking for termios.h...... FOUND.
Looking for util.h......... not found.
Checking which symbols compile OK...
(sorry for the tedious check, but some systems have not too clean
 header files, to say the least;  '+' means OK, '-' means not defined
 and '*' has compile problems...)
+B0 +B110 +B115200 +B1200 +B134 +B150 -B153600 +B1800 +B19200 +B200 +B230400 +B2400 +B300 -B307200 +B38400 +B460800 +B4800 +B50 +B57600 +B600 +B75 -B76800 +B9600 +BRKINT +BS0 +BS1 +BSDLY +CBAUD -CBAUDEXT -CBRK -CCTS_OFLOW -CDEL -CDSUSP -CEOF -CEOL -CEOL2 -CEOT -CERASE -CESC -CFLUSH +CIBAUD -CIBAUDEXT -CINTR -CKILL -CLNEXT +CLOCAL -CNSWTCH -CNUL -CQUIT +CR0 +CR1 +CR2 +CR3 +CRDLY +CREAD -CRPRNT +CRTSCTS -CRTSXOFF -CRTS_IFLOW +CS5 +CS6 +CS7 +CS8 +CSIZE -CSTART -CSTOP +CSTOPB -CSUSP -CSWTCH -CWERASE -DEFECHO -DIOC -DIOCGETP -DIOCSETP -DOSMODE +ECHO +ECHOCTL +ECHOE +ECHOK +ECHOKE +ECHONL +ECHOPRT +EXTA +EXTB +FF0 +FF1 +FFDLY -FIORDCHK +FLUSHO +HUPCL +ICANON +ICRNL +IEXTEN +IGNBRK +IGNCR +IGNPAR +IMAXBEL +INLCR +INPCK +ISIG +ISTRIP +IUCLC +IXANY +IXOFF +IXON -KBENABLED -LDCHG -LDCLOSE -LDDMAP -LDEMAP -LDGETT -LDGMAP -LDIOC -LDNMAP -LDOPEN -LDSETT -LDSMAP -LOBLK +NCCS +NL0 +NL1 +NLDLY +NOFLSH +OCRNL +OFDEL +OFILL +OLCUC +ONLCR +ONLRET +ONOCR +OPOST -PAGEOUT +PARENB -PAREXT +PARMRK +PARODD +PENDIN -RCV1EN -RTS_TOG +TAB0 +TAB1 +TAB2 +TAB3 +TABDLY -TCDSET +TCFLSH +TCGETA +TCGETS +TCIFLUSH +TCIOFF +TCIOFLUSH +TCION +TCOFLUSH +TCOOFF +TCOON +TCSADRAIN +TCSAFLUSH +TCSANOW +TCSBRK +TCSETA +TCSETAF +TCSETAW -TCSETCTTY +TCSETS +TCSETSF +TCSETSW +TCXONC -TERM_D40 -TERM_D42 -TERM_H45 -TERM_NONE -TERM_TEC -TERM_TEX -TERM_V10 -TERM_V61 -> FAIL Timed out (> 60s). Use --verbose to retry.
-> N/A
-> FAIL Configure failed for IO-Tty-1.16. See /data/data/com.termux/files/home/.cpanm/work/1624579152.1565/build.log for details.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.