From: Zhisong J. <jj...@dy...> - 2004-10-05 18:43:57
|
I'm trying to build a Expect.pm on solaris 9 1. download expect-1.15 and IO-tty-1.02 source from sourceforge 2. compile and install IO-tty , all OK, \ 2. compile expect-1.15, failed at make test $ perl Makefile.pl $ make $ make test "make test failed" , complain about Use of uninitialized value in ioctl at /usr/local/lib/perl5/site_perl/5.8.4/sun4-solaris-thread-multi-64/IO/Pty.pm line 119. warning: TIOCSCTTY failed, slave might not be set as controlling terminal: Invalid argument at /usr/local/lib/perl5/site_perl/5.8.4/sun4-solaris-thread-multi-64/IO/Pty.pm line 120. TIMEOUT looking into the source on Pty.pm , the relevent portion is: # Acquire a controlling terminal if this doesn't happen automatically if (defined TIOCSCTTY) { if (not defined ioctl( ${*$self}{'io_pty_slave'}, TIOCSCTTY, 0 )) { warn "warning: TIOCSCTTY failed, slave might not be set as controlling terminal: $!" if $^W; } } elsif (defined TCSETCTTY) { if (not defined ioctl( ${*$self}{'io_pty_slave'}, TCSETCTTY, 0 )) { warn "warning: TCSETCTTY failed, slave might not be set as controlling terminal: $!" if $^W; } } can somebody suggest a work around or is there exist a solution? thanks. Jason |
From: Austin S. <te...@of...> - 2004-10-08 08:54:04
|
On Tue, Oct 05, 2004 at 02:43:42PM -0400, Zhisong Jin wrote: > I'm trying to build a Expect.pm on solaris 9 > > 1. download expect-1.15 and IO-tty-1.02 source from sourceforge > 2. compile and install IO-tty , all OK, \ > 2. compile expect-1.15, failed at make test > $ perl Makefile.pl > $ make > $ make test > > "make test failed" , complain about > > Use of uninitialized value in ioctl at > /usr/local/lib/perl5/site_perl/5.8.4/sun4-solaris-thread-multi-64/IO/Pty.pm line 119. > warning: TIOCSCTTY failed, slave might not be set as controlling > terminal: Invalid argument at > /usr/local/lib/perl5/site_perl/5.8.4/sun4-solaris-thread-multi-64/IO/Pty.pm line 120. > TIMEOUT > > looking into the source on Pty.pm , the relevent portion is: > # Acquire a controlling terminal if this doesn't happen automatically > if (defined TIOCSCTTY) { > if (not defined ioctl( ${*$self}{'io_pty_slave'}, TIOCSCTTY, 0 )) { > warn "warning: TIOCSCTTY failed, slave might not be set as > controlling > terminal: $!" if $^W; > } Solaris doesn't set TIOCSCTTY here (can't find it anywhere under /usr/include), that seems a little strange to me, not sure how you are getting it defined. > } elsif (defined TCSETCTTY) { Also doesn't define this. I'm looking at 5.8 (vs. 9/5.9), but I would be _very_ surprised if they changed basic terminal handling code between OS revs. Austin |
From: Roland G. <RGi...@cp...> - 2004-10-08 09:29:21
|
Austin Schutz wrote: > On Tue, Oct 05, 2004 at 02:43:42PM -0400, Zhisong Jin wrote: > >>I'm trying to build a Expect.pm on solaris 9 >> >>1. download expect-1.15 and IO-tty-1.02 source from sourceforge >>2. compile and install IO-tty , all OK, \ >>2. compile expect-1.15, failed at make test >>$ perl Makefile.pl >>$ make >>$ make test >> >>"make test failed" , complain about >> >>Use of uninitialized value in ioctl at >>/usr/local/lib/perl5/site_perl/5.8.4/sun4-solaris-thread-multi-64/IO/Pty.pm line 119. >>warning: TIOCSCTTY failed, slave might not be set as controlling >>terminal: Invalid argument at >>/usr/local/lib/perl5/site_perl/5.8.4/sun4-solaris-thread-multi-64/IO/Pty.pm line 120. >>TIMEOUT >> >>looking into the source on Pty.pm , the relevent portion is: >># Acquire a controlling terminal if this doesn't happen automatically >> if (defined TIOCSCTTY) { >> if (not defined ioctl( ${*$self}{'io_pty_slave'}, TIOCSCTTY, 0 )) { >> warn "warning: TIOCSCTTY failed, slave might not be set as >>controlling >>terminal: $!" if $^W; >> } > > > Solaris doesn't set TIOCSCTTY here (can't find it anywhere under > /usr/include), that seems a little strange to me, not sure how you are getting > it defined. > > >> } elsif (defined TCSETCTTY) { > > > Also doesn't define this. > > > I'm looking at 5.8 (vs. 9/5.9), but I would be _very_ surprised if they > changed basic terminal handling code between OS revs. > Hmm, in the 'perl Makefile.PL' step I'm trying to figure out what constants are defined by compiling test progs for each constant. Austin, as you seem to have a solaris machine on your hands, could you look into that and see why it gets defined? Thanks! Roland |
From: Austin S. <te...@of...> - 2004-10-08 20:48:30
|
On Fri, Oct 08, 2004 at 11:28:37AM +0200, Roland Giersig wrote: > > Hmm, in the 'perl Makefile.PL' step I'm trying to figure out what > constants are defined by compiling test progs for each constant. Austin, > as you seem to have a solaris machine on your hands, could you look into > that and see why it gets defined? > On my solaris machine I'm not able to replicate the issue because I'm running an old perl: 5.00503, which doesn't exhibit this problem and I can't get 5.8.4 to compile. However, I _was_ able to replicate this on my home linux workstation by commenting out #define TIOCSCTTY in /usr/include/asm/ioctls.h. I'm not sure why the code in question is being executed. Running it in the debugger I still couldn't figure it out (output follows). It looks to me like a perl bug. However, I was able to work around it by changing line 118 to: if (defined TIOCSCTTY && TIOCSCTTY) { which _should_ be valid - I doubt any vendor defines TIOCSCTTY as 0. Austin DB<5> p defined TIOCSCTTY DB<6> l 118==> if (defined TIOCSCTTY) { 119: if (not defined ioctl( ${*$self}{'io_pty_slave'}, TIOCSCTTY, 0 )) { 120: warn "warning: TIOCSCTTY failed, slave might not be set as control ling terminal: $!" if $^W; 121 } 122 } elsif (defined TCSETCTTY) { 123: if (not defined ioctl( ${*$self}{'io_pty_slave'}, TCSETCTTY, 0 )) { 124: warn "warning: TCSETCTTY failed, slave might not be set as control ling terminal: $!" if $^W; 125 } 126 } 127 DB<6> s IO::Pty::make_slave_controlling_terminal(/root/.cpan/build/IO-Tty-1.02/blib/lib/ IO/Pty.pm:119): 119: if (not defined ioctl( ${*$self}{'io_pty_slave'}, TIOCSCTTY, 0 )) { DB<6> p defined TIOCSCTTY DB<7> p defined TIOCSCTTY DB<8> if(defined TIOCSCTTY) { print "defined\n"; } DB<9> n IO::Pty::make_slave_controlling_terminal(/root/.cpan/build/IO-Tty-1.02/blib/lib/IO/Pty.pm:119): 119: if (not defined ioctl( ${*$self}{'io_pty_slave'}, TIOCSCTTY, 0 )) { DB<9> n Use of uninitialized value in ioctl at /root/.cpan/build/IO-Tty-1.02/blib/lib/IO/Pty.pm line 119, <XT> line 1. IO::Pty::make_slave_controlling_terminal('IO::Pty=GLOB(0x8171f8c)') called at test.pl line 66 IO::Pty::make_slave_controlling_terminal(/root/.cpan/build/IO-Tty-1.02/blib/lib/IO/Pty.pm:120): 120: warn "warning: TIOCSCTTY failed, slave might not be set as controlling terminal: $!" if $^W; |
From: Zhisong J. <jj...@dy...> - 2004-10-13 15:00:44
|
Helo, I make the change at line 118 as suggeted. however it didn't work. Do you know where can I find or download perl 5.00503 for solaris 9. Thank you very much . Jason On Fri, 2004-10-08 at 16:48, Austin Schutz wrote: > On Fri, Oct 08, 2004 at 11:28:37AM +0200, Roland Giersig wrote: > > > > Hmm, in the 'perl Makefile.PL' step I'm trying to figure out what > > constants are defined by compiling test progs for each constant. Austin, > > as you seem to have a solaris machine on your hands, could you look into > > that and see why it gets defined? > > > > On my solaris machine I'm not able to replicate the issue because > I'm running an old perl: 5.00503, which doesn't exhibit this problem and > I can't get 5.8.4 to compile. > However, I _was_ able to replicate this on my home linux workstation > by commenting out #define TIOCSCTTY in /usr/include/asm/ioctls.h. > > I'm not sure why the code in question is being executed. Running > it in the debugger I still couldn't figure it out (output follows). It looks > to me like a perl bug. However, I was able to work around it by changing line > 118 to: > > if (defined TIOCSCTTY && TIOCSCTTY) { > > which _should_ be valid - I doubt any vendor defines TIOCSCTTY as 0. > > Austin > > DB<5> p defined TIOCSCTTY > > DB<6> l > 118==> if (defined TIOCSCTTY) { > 119: if (not defined ioctl( ${*$self}{'io_pty_slave'}, TIOCSCTTY, 0 )) { > 120: warn "warning: TIOCSCTTY failed, slave might not be set as control > ling terminal: $!" if $^W; > 121 } > 122 } elsif (defined TCSETCTTY) { > 123: if (not defined ioctl( ${*$self}{'io_pty_slave'}, TCSETCTTY, 0 )) { > 124: warn "warning: TCSETCTTY failed, slave might not be set as control > ling terminal: $!" if $^W; > 125 } > 126 } > 127 > DB<6> s > IO::Pty::make_slave_controlling_terminal(/root/.cpan/build/IO-Tty-1.02/blib/lib/ > IO/Pty.pm:119): > 119: if (not defined ioctl( ${*$self}{'io_pty_slave'}, TIOCSCTTY, 0 )) { > DB<6> p defined TIOCSCTTY > > DB<7> p defined TIOCSCTTY > > DB<8> if(defined TIOCSCTTY) { print "defined\n"; } > > DB<9> n > IO::Pty::make_slave_controlling_terminal(/root/.cpan/build/IO-Tty-1.02/blib/lib/IO/Pty.pm:119): > 119: if (not defined ioctl( ${*$self}{'io_pty_slave'}, TIOCSCTTY, 0 )) { > DB<9> n > Use of uninitialized value in ioctl at /root/.cpan/build/IO-Tty-1.02/blib/lib/IO/Pty.pm line 119, <XT> line 1. > IO::Pty::make_slave_controlling_terminal('IO::Pty=GLOB(0x8171f8c)') called at test.pl line 66 > IO::Pty::make_slave_controlling_terminal(/root/.cpan/build/IO-Tty-1.02/blib/lib/IO/Pty.pm:120): > 120: warn "warning: TIOCSCTTY failed, slave might not be set as controlling terminal: $!" if $^W; > > > > ------------------------------------------------------- > This SF.net email is sponsored by: IT Product Guide on ITManagersJournal > Use IT products in your business? Tell us what you think of them. Give us > Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more > http://productguide.itmanagersjournal.com/guidepromo.tmpl > _______________________________________________ > Expectperl-discuss mailing list > Exp...@li... > https://lists.sourceforge.net/lists/listinfo/expectperl-discuss > |
From: Zhisong J. <jj...@dy...> - 2004-10-18 20:14:51
|
Austin: thank you for the reply. since I wasn't able to figure out how to make it work under perl 5.8.4. I'm now trying to use SUN's version of perl 5.005_03 came with solaris 9. solaris 9, perl 5.005_03 ,and IO-Tty-1.02 from sourceforge. however, make on IO-Tty-1.02 gives [jason@flounder IO-Tty-1.02]$ make <snip> cc -c -xO3 -xdepend -DVERSION=\"1.02\" -DXS_VERSION=\"1.02\" -KPIC -I/usr/perl5/5.00503/sun4-solaris/CORE -DHAVE_DEV_PTMX -DHAVE_GRANTPT -DHAVE_PTSNAME -DHAVE_SIGACTION -DHAVE_STRLCPY -DHAVE_SYS_STROPTS_H -DHAVE_TERMIOS_H -DHAVE_TERMIO_H -DHAVE_TTYNAME -DHAVE_UNLOCKPT Tty.c cc: unrecognized option `-KPIC' cc: language depend not recognized cc: Tty.c: linker input file unused because linking not done Running Mkbootstrap for IO::Tty () chmod 644 Tty.bs LD_RUN_PATH="" cc -o blib/arch/auto/IO/Tty/Tty.so -G Tty.o cc: Tty.o: No such file or directory cc: no input files make: *** [blib/arch/auto/IO/Tty/Tty.so] Error 1 I believe the sun own version of perl is compiled with sun's own c compiler. does that causing this problm, any work around? Thanks. Jason PS: I also tried to compile perl 5.005_03 from source using gcc 3.3.2 on solaris 9. I got an [jason@flounder perl5.005_03]$ make make: *** No rule to make target `<built-in>', needed by `miniperlmain.o'. Stop. On Fri, 2004-10-08 at 16:48, Austin Schutz wrote: > On Fri, Oct 08, 2004 at 11:28:37AM +0200, Roland Giersig wrote: > > > > Hmm, in the 'perl Makefile.PL' step I'm trying to figure out what > > constants are defined by compiling test progs for each constant. Austin, > > as you seem to have a solaris machine on your hands, could you look into > > that and see why it gets defined? > > > > On my solaris machine I'm not able to replicate the issue because > I'm running an old perl: 5.00503, which doesn't exhibit this problem and > I can't get 5.8.4 to compile. > However, I _was_ able to replicate this on my home linux workstation > by commenting out #define TIOCSCTTY in /usr/include/asm/ioctls.h. > > I'm not sure why the code in question is being executed. Running > it in the debugger I still couldn't figure it out (output follows). It looks > to me like a perl bug. However, I was able to work around it by changing line > 118 to: > > if (defined TIOCSCTTY && TIOCSCTTY) { > > which _should_ be valid - I doubt any vendor defines TIOCSCTTY as 0. > > Austin > > DB<5> p defined TIOCSCTTY > > DB<6> l > 118==> if (defined TIOCSCTTY) { > 119: if (not defined ioctl( ${*$self}{'io_pty_slave'}, TIOCSCTTY, 0 )) { > 120: warn "warning: TIOCSCTTY failed, slave might not be set as control > ling terminal: $!" if $^W; > 121 } > 122 } elsif (defined TCSETCTTY) { > 123: if (not defined ioctl( ${*$self}{'io_pty_slave'}, TCSETCTTY, 0 )) { > 124: warn "warning: TCSETCTTY failed, slave might not be set as control > ling terminal: $!" if $^W; > 125 } > 126 } > 127 > DB<6> s > IO::Pty::make_slave_controlling_terminal(/root/.cpan/build/IO-Tty-1.02/blib/lib/ > IO/Pty.pm:119): > 119: if (not defined ioctl( ${*$self}{'io_pty_slave'}, TIOCSCTTY, 0 )) { > DB<6> p defined TIOCSCTTY > > DB<7> p defined TIOCSCTTY > > DB<8> if(defined TIOCSCTTY) { print "defined\n"; } > > DB<9> n > IO::Pty::make_slave_controlling_terminal(/root/.cpan/build/IO-Tty-1.02/blib/lib/IO/Pty.pm:119): > 119: if (not defined ioctl( ${*$self}{'io_pty_slave'}, TIOCSCTTY, 0 )) { > DB<9> n > Use of uninitialized value in ioctl at /root/.cpan/build/IO-Tty-1.02/blib/lib/IO/Pty.pm line 119, <XT> line 1. > IO::Pty::make_slave_controlling_terminal('IO::Pty=GLOB(0x8171f8c)') called at test.pl line 66 > IO::Pty::make_slave_controlling_terminal(/root/.cpan/build/IO-Tty-1.02/blib/lib/IO/Pty.pm:120): > 120: warn "warning: TIOCSCTTY failed, slave might not be set as controlling terminal: $!" if $^W; > |
From: Austin S. <te...@of...> - 2004-10-18 20:21:38
|
On Mon, Oct 18, 2004 at 04:14:43PM -0400, Zhisong Jin wrote: > Austin: > > thank you for the reply. since I wasn't able to figure out > how to make it work under perl 5.8.4. I'm now trying to > use SUN's version of perl 5.005_03 came with solaris 9. > Sorry, I should have replied to the other message. > solaris 9, perl 5.005_03 ,and IO-Tty-1.02 from sourceforge. > > however, make on IO-Tty-1.02 gives > ... > <snip> > cc -c -xO3 -xdepend -DVERSION=\"1.02\" -DXS_VERSION=\"1.02\" -KPIC > -I/usr/perl5/5.00503/sun4-solaris/CORE -DHAVE_DEV_PTMX -DHAVE_GRANTPT > -DHAVE_PTSNAME -DHAVE_SIGACTION -DHAVE_STRLCPY -DHAVE_SYS_STROPTS_H > -DHAVE_TERMIOS_H -DHAVE_TERMIO_H -DHAVE_TTYNAME -DHAVE_UNLOCKPT Tty.c > cc: unrecognized option `-KPIC' > cc: language depend not recognized This is (as you suspected) because perl was compiled with the solaric cc, but you are trying to compile the module with the gnu cc. You can fix this by modifying your Config.pm (somewhere in your @INC path) to use flags compatible with gcc, such as -fPIC and -O3. The other (much easier) workaround is to just comment out the offending warning. It doesn't really matter if the ioctl fails, because Solaris doesn't define TIOCSCTTY in the first place. You won't break anything by commenting out lines 119 and 120, which should make the warning go away. Austin |
From: Zhisong J. <jj...@dy...> - 2004-10-18 21:18:03
|
thanks for all replied. so now I'm back at this setting: solaris 9, perl 5.8.4, gcc 3.3.2, IO-tty-1.02, and expect-1.15. as suggested by Austin, I comment out the line 119 and 120 on Pty.pm and now try to run a small program that use expect.pm ==========the relevent code segment of test program ======= # example taken from Perl for System administrators $username='test'; $tmp_pwd='test'; my $result = &InitUnixPasswd($username, $tmp_pwd); sub InitUnixPasswd { my ($account,$passwd) = @_; # return a process object my $pobj = Expect->spawn($passwdex, $account); die "Unable to spawn $passwdex:$!\n" unless (defined $pobj); # do not log to stdout (i.e. be silent) $pobj->log_stdout(0); $pobj->expect(10,"New password: "); # Linux sometimes prompts before it is ready for input, so we pause sleep 1; print $pobj "$passwd\r"; $pobj->expect(10, "Re-enter new password: "); print $pobj "$passwd\r"; $result = (defined ($pobj->expect(10, "successfully changed")) ? "" : "password changefailed"); # close the process object, waiting up to 15 secs for # the process to exit $pobj->soft_close( ); return $result; } ================================================ the program failed; Use of uninitialized value in join or string at /usr/local/lib/perl5/site_perl/5.8.4/Expect.pm line 129. Cannot exec( test): No such file or directory Use of uninitialized value in concatenation (.) or string at /usr/local/dpiusr/mkdpiusr line 137. Unable to spawn :No such file or directory I then commment out Expect.pm line 129 #warn "Error: could not connect pty as controlling terminal!\n"; and try again, still same error, the real problem seem is "Unable to spawn". any suggestions. Thanks. h > > The other (much easier) workaround is to just comment out the > offending warning. It doesn't really matter if the ioctl fails, because > Solaris doesn't define TIOCSCTTY in the first place. You won't break anything > by commenting out lines 119 and 120, which should make the warning go away. > > Austin > > > ------------------------------------------------------- > This SF.net email is sponsored by: IT Product Guide on ITManagersJournal > Use IT products in your business? Tell us what you think of them. Give us > Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more > http://productguide.itmanagersjournal.com/guidepromo.tmpl > _______________________________________________ > Expectperl-discuss mailing list > Exp...@li... > https://lists.sourceforge.net/lists/listinfo/expectperl-discuss > |