From: <RGi...@a1...> - 2002-04-04 07:06:54
|
> Expect builds on multiple Mac OS X systems here with one error in the > test suite, but Crypt::GPG hangs in its test suite, and a trace > indicates that it's halting in Expect's spawn method. I would > appreciate any help getting these modules functional, or figuring out > what's wrong. First of all, what version of IO-Tty and Expect are you using? I just tried the latest versions (v1.02 and v1.15) on SourceForges compile farm and found that IO-Tty tests OK while Expect fails on test 31 line 284, which tests the controlling terminal, but this can only be a minor bug as the test for a controlling terminal passes in IO-Tty. I'll look into that. BTW, that tests ran on Darwin Kernel 5.3. > The trace from Crypt::GPG's test suite is available here: Hmm, the spawn seems to hang on exec synchronisation, which is fishy, as the test suite contains a test for that... Anyway, please check that you are using the latest versions. Cheers! Roland -- RGi...@cp... |
From: <RGi...@a1...> - 2002-04-04 10:15:30
|
> Crypt::GPG still failed, and when I went to re-run > Expect's test suite, just to see what would happen, I got this: > > $ make test > PERL_DL_NONLAZY=1 /usr/bin/perl -Iblib/arch -Iblib/lib > -I/System/Library/Perl/darwin -I/System/Library/Perl test.pl 1..36 > > Basic tests... > > ok 1 > Use of uninitialized value in numeric eq (==) at test.pl line 37. > not ok 2 > # Test failed at test.pl line 22. > Died at test.pl line 22. > make: *** [test_dynamic] Error 255 > > That's after make clean; perl Makefile.PL; make; of course. I > repeated this failure on two systems, identically. Interesting, I also encountered that error during my test runs, but it was only temporary, when I reran the test, it worked. If you can reproduce it consistently, please uncomment the '$Expect::Exp_Internal = 1' line in test.pl and rerun the test. It will probably vanish then, just as Murphy predicts. I will continue to investigate... Roland -- RGi...@cp... |
From: Nathaniel I. <nd...@bu...> - 2002-04-04 18:40:06
|
On Thu, Apr 04, 2002 at 12:15:16PM +0200, RGi...@a1... wrote: > Interesting, I also encountered that error during my test runs, but it > was only temporary, when I reran the test, it worked. If you can > reproduce it consistently, please uncomment the '$Expect::Exp_Internal > = 1' line in test.pl and rerun the test. It will probably vanish then, > just as Murphy predicts. I could reproduce it consistently, so I uncommented that line, and it failed again -- unfortunately I didn't save that output, and when I reran the test with the line uncommented, it completed the test suite. When it was done, however, the only test it had failed was 15, which was the failure in my original message. Here's the output: Continuing expect, restarting timeout... spawn id(4): Does `\r\n' match: pattern #1: -re `Begin'? No. pattern #2: -re `End'? No. pattern #3: -eof `'? No. Waiting for new data (1 seconds)... TIMEOUT Calling timeout function ARRAY(0x41c294)... Waiting for new data (1 seconds)... TIMEOUT Calling timeout function ARRAY(0x41c294)... Waiting for new data (1 seconds)... TIMEOUT Calling timeout function ARRAY(0x41c294)... Waiting for new data (1 seconds)... TIMEOUT Calling timeout function ARRAY(0x41c294)... Waiting for new data (1 seconds)... EOF not ok 15 # Test failed at test.pl line 83. Returning from expect with TIMEOUT or EOF > This leads me to the conclusion that the close-on-exit is broken on > Darwin. > > Workaround: add a 'sleep 1' to the spawn command, > i.e. spawn("someprog; sleep 1"). Let me make sure I understand the syntax you're proposing -- tack on "; sleep 1" to spawn's first argument? To use an example from Crypt:GPG, this my $expect = Expect->spawn ("$self->{GPGBIN}", @opts, '-o-', '--sign', $armor, $detach, '--default-key', $self->{SECRETKEY}, $tmpnam); becomes this: my $expect = Expect->spawn ("$self->{GPGBIN}; sleep 1", @opts, '-o-', '--sign', $armor, $detach, '--default-key', $self->{SECRETKEY}, $tmpnam); There are ten calls to spawn in Crypt::GPG, and I modified them all as shown. It still hangs in test 11, apparently with the same symptoms: http://bumppo.net/expect/debug-trace-2.txt Thanks for all your effort. -nat |
From: <RGi...@a1...> - 2002-04-04 13:40:03
|
I did some further investigations and have come to the conclusion that = Darwin has a severe bug=3A When a spawned program exits=2C the master immediately gets EOF and all = characters that should have been queued inside the pty are lost=2E When the spawned program closes the pty before exiting=2C no characters = are lost=2E This leads me to the conclusion that the close-on-exit is broken on = Darwin=2E Workaround=3A add a =27sleep 1=27 to the spawn command=2C i=2Ee=2E spawn(= =22someprog=3B = sleep 1=22)=2E I don=27t know if this helps with Crypt=3A=3APGP=2C but it=27s a first st= ep=2E Roland -- RGiersig=40cpan=2Eorg ----- Urspr=FCngliche Nachricht ----- Von=3A RGiersig=40a1=2Enet Datum=3A Donnerstag=2C April 4=2C 2002 12=3A15 pm Betreff=3A Re=3A =5BExpectperl-discuss=5D spawn hanging on darwin =3E =3E Crypt=3A=3AGPG still failed=2C and when I went to re-run =3E =3E Expect=27s test suite=2C just to see what would happen=2C I got t= his=3A =3E =3E = =3E =3E =24 make test = =3E =3E PERL=5FDL=5FNONLAZY=3D1 /usr/bin/perl -Iblib/arch -Iblib/lib =3E =3E -I/System/Library/Perl/darwin -I/System/Library/Perl test=2Epl 1=2E= =2E36 =3E =3E = =3E =3E Basic tests=2E=2E=2E =3E =3E = =3E =3E ok 1 =3E =3E Use of uninitialized value in numeric eq (=3D=3D) at test=2Epl li= ne 37=2E =3E =3E not ok 2 =3E =3E =23 Test failed at test=2Epl line 22=2E =3E =3E Died at test=2Epl line 22=2E =3E =3E make=3A *** =5Btest=5Fdynamic=5D Error 255 =3E =3E = =3E =3E That=27s after make clean=3B perl Makefile=2EPL=3B make=3B of cou= rse=2E I =3E =3E repeated this failure on two systems=2C identically=2E =3E = =3E Interesting=2C I also encountered that error during my test runs=2C = =3E but it = =3E was only temporary=2C when I reran the test=2C it worked=2E If you c= an = =3E reproduce it consistently=2C please uncomment the = =3E =27=24Expect=3A=3AExp=5FInternal = =3E =3D 1=27 line in test=2Epl and rerun the test=2E It will probably va= nish = =3E then=2C = =3E just as Murphy predicts=2E =3E = =3E I will continue to investigate=2E=2E=2E =3E = =3E Roland =3E -- =3E RGiersig=40cpan=2Eorg =3E = =3E = =3E = =3E =5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F= =5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F =3E Expectperl-discuss mailing list =3E Expectperl-discuss=40lists=2Esourceforge=2Enet =3E https=3A//lists=2Esourceforge=2Enet/lists/listinfo/expectperl-discuss= =3E |
From: <RGi...@a1...> - 2002-04-05 07:57:49
|
> > This leads me to the conclusion that the close-on-exit is broken on > > Darwin. > > > > Workaround: add a 'sleep 1' to the spawn command, > > i.e. spawn("someprog; sleep 1"). > > Let me make sure I understand the syntax you're proposing -- tack on > "; sleep 1" to spawn's first argument? To use an example from > Crypt:GPG, this > > my $expect = Expect->spawn ("$self->{GPGBIN}", @opts, '-o-', '--sign', > $armor, $detach, '--default-key', $self->{SECRETKEY}, $tmpnam); > > becomes this: > > my $expect = Expect->spawn ("$self->{GPGBIN}; sleep 1", @opts, '-o-', > '--sign', $armor, $detach, '--default-key', $self->{SECRETKEY}, > $tmpnam); No, add it as the last statement: my $expect = Expect->spawn ("$self->{GPGBIN} @opts -o- \ --sign $armor $detach --default-key $self->{SECRETKEY} \ $tmpnam; sleep 1"); This will pass everything to the shell, so you have to take care of shell metachars in your arguments, but that's seldom a problem. I added such a 'sleep' statement to all spawns in test.pl and now all tests pass (except those I added to specifically test for the bug). Have you tried the Crypt::GPG tests on a different platform? If you don't have access locally, I can recommend the SourceForge compile farm. It is important to try out to see if the problem is system- dependend or not. If you can reproduce the problem on a different architecture, then we have a pure application problem... Roland -- RGi...@cp... |
From: Nathaniel I. <nd...@bu...> - 2002-04-05 20:39:33
|
On Fri, Apr 05, 2002 at 09:57:39AM +0200, RGi...@a1... wrote: > I added such a 'sleep' statement to all spawns in test.pl and now all > tests pass (except those I added to specifically test for the bug). I rejiggered the GPG module's ten spawn calls, but it's still hanging in the same place, after sysread in spawn() in test 11 (decryption). > Have you tried the Crypt::GPG tests on a different platform? If you > don't have access locally, I can recommend the SourceForge compile > farm. I have an old sourceforge account, and I can log into shell, but my password's rejected when I try to connect to cf.sourceforge.net. I'll file a support request. -nat |
From: Nathaniel I. <nd...@bu...> - 2002-04-04 08:52:29
|
On Thu, Apr 04, 2002 at 09:06:32AM +0200, RGi...@a1... wrote: > First of all, what version of IO-Tty and Expect are you using? I just > tried the latest versions (v1.02 and v1.15) on SourceForges compile > farm and found that IO-Tty tests OK while Expect fails on test 31 line > 284, which tests the controlling terminal, but this can only be a minor > bug as the test for a controlling terminal passes in IO-Tty. I'll look > into that. BTW, that tests ran on Darwin Kernel 5.3. I had IO::Tty 1.00 and Expect 1.15, with the same kernel version (it corresponds to Mac OS X 10.1.3). I upgraded IO::Tty to 1.0.2, which passed its 4 tests. Crypt::GPG still failed, and when I went to re-run Expect's test suite, just to see what would happen, I got this: $ make test PERL_DL_NONLAZY=1 /usr/bin/perl -Iblib/arch -Iblib/lib -I/System/Library/Perl/darwin -I/System/Library/Perl test.pl 1..36 Basic tests... ok 1 Use of uninitialized value in numeric eq (==) at test.pl line 37. not ok 2 # Test failed at test.pl line 22. Died at test.pl line 22. make: *** [test_dynamic] Error 255 That's after make clean; perl Makefile.PL; make; of course. I repeated this failure on two systems, identically. -nat |