Hallowed Monks,

I have a process in place that creates child processes, each of which create their own Expect object. For some children, the following error is returned upon instantiation of the Expect object:
Cannot create a new IO::Tty from fd -1: Invalid argument

The error seems to happen after X number of children are spawned. If I do say 50 children, it works fine. 90... not so much.
Also, this seems to be happening only on one box. It does not happen on another box that is configured the same way.
I am running on HP-UX 11.11 on both boxes, and the nstrpty and npty are both set to 512.
So I'm not sure why I'm getting -1 returned...

Since Expect.pm uses IO::Pty to instantiate the psuedo tty, I drilled down and found this call:
my ($ptyfd, $ttyfd, $ttyname) = pty_allocate();

However, I can't really find any information on this method to try and decipher why it is returning -1 into $ttyfd (thus causing the error). I do see that the nstrtel is set to 60, however it is that way on both boxes (the one that works and the one that doesn't) so I don't think that's it either. Besides, I believe that parameter controls incoming telnet sessions, and I'm dealing with outgoing sessions here...

I'm hoping someone may have knowledge of IO::Pty and/or pty_allocate() and can point me in the direction of what to check that may be causing this error. I checked the documentation on CPAN for this module, but it really didn't have anything. My basic impression is that pty_allocate() is *expected* to be able to create an fd on pty and tty.

Any help would be greatly appreciated.

System Info
O/S: HP-UX B.11.11
perl: 5.6.1

Thanks,

Jayson

In reply to Error when creating Expect object by jhill03

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.