Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Need help with module problem specific to sun-solaris

by tachyon (Chancellor)
on Nov 08, 2002 at 10:57 UTC ( #211401=perlquestion: print w/ replies, xml ) Need Help??
tachyon has asked for the wisdom of the Perl Monks concerning the following question:

I need the assistance of someone with a sun-solaris system. A module I wrote (CGI::Simple) fails 1.5% of its tests under solaris. This does not occur on Win32, cygwin, Mac, Redhat, Mandrake, or Free BSD.

I don't have access to a solaris system so I need is someone to download the module and do this:

%tar -zxvf Cgi-Simple-0.05.tar.gz %cd Cgi-Simple-0.05 %perl Makefile.PL %make %make test

This should show errors like so

PERL_DL_NONLAZY=1 /usr/local/perl/bin/perl "-MExtUtils::Command::MM" " +-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t t/cookie......ok t/function....ok t/request.....ok t/simple......FAILED tests 68, 76-77, 81, 89-90, 205 Failed 7/330 tests, 97.88% okay t/standard....FAILED tests 69, 77-78, 82, 185 Failed 5/303 tests, 98.35% okay t/util........ok Failed Test Stat Wstat Total Fail Failed List of Failed ---------------------------------------------------------------------- +--------- t/simple.t 330 7 2.12% 68 76-77 81 89-90 205 t/standard.t 303 5 1.65% 69 77-78 82 185 Failed 2/6 test scripts, 66.67% okay. 12/839 subtests failed, 98.57% o +kay.

Assuming this to be the case on your system I just need the two problem test scripts run outside the harness which will enable the full debugging mode to output to STDOUT so I just need:

%cd t %perl simple.t >dump.txt %perl standard.t >>dump.txt

The text file will contain the debug output and this is what I need. Can anyone spare 5 minutes to help me out? I have emailed the tester but have yet to recieve a reply.

cheers

tachyon jfreeman@tassie.net.au

s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print

Comment on Need help with module problem specific to sun-solaris
Select or Download Code
Re: Need help with module problem specific to sun-solaris
by tommyw (Hermit) on Nov 08, 2002 at 11:31 UTC

    It all works for me, I'm afraid...

    ptiw@duet Cgi-Simple-0.05$ make cp Simple.pm blib/lib/CGI/Simple.pm cp Simple/Util.pm blib/lib/CGI/Simple/Util.pm cp Simple/Standard.pm blib/lib/CGI/Simple/Standard.pm cp Simple/Cookie.pm blib/lib/CGI/Simple/Cookie.pm ptiw@duet Cgi-Simple-0.05$ make test PERL_DL_NONLAZY=1 /local/share/oed/extern/bin/perl "-MExtUtils::Comman +d::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t t/cookie......ok t/function....ok t/request.....ok t/simple......ok t/standard....ok t/util........ok All tests successful. Files=6, Tests=839, 5 wallclock secs ( 2.48 cusr + 0.96 csys = 3.44 + CPU)
    That's on solaris 2.8, with perl 5.6.1.

    --
    Tommy
    Too stupid to live.
    Too stubborn to die.

    update (broquaint): changed <pre> to <code>

      Oh: it also behaves fine on the version of perl supplied by Sun. Which is 5.005_03.

      --
      Tommy
      Too stupid to live.
      Too stubborn to die.

Re: Need help with module problem specific to sun-solaris
by grinder (Bishop) on Nov 08, 2002 at 11:58 UTC

    Like tommyw it works fine for me as well (same version of Perl but different version of Solaris):

    Running make test PERL_DL_NONLAZY=1 /usr/bin/perl -Iblib/arch -Iblib/lib -I/usr/lib/perl +5/5.6.1/sun4-solaris -I/usr/lib/perl5/5.6.1 -e 'use Test::Harness qw( +&runtests $verbose); $verbose=0; runtests @ARGV;' t/*.t t/cookie............ok + t/function..........ok + t/request...........ok + t/simple............ok + t/standard..........ok + t/util..............ok + All tests successful. Files=6, Tests=839, 13 wallclock secs ( 3.52 cusr + 0.31 csys = 3.83 + CPU) /usr/ccs/bin/make test -- OK

    Information about Perl:

    Summary of my perl5 (revision 5.0 version 6 subversion 1) configuratio +n: Platform: osname=solaris, osvers=2.6, archname=sun4-solaris uname='sunos ouessant 5.6 generic_105181-31 sun4u sparc sunw,ultra +-4 ' config_args='' hint=recommended, useposix=true, d_sigaction=define usethreads=undef use5005threads=undef useithreads=undef usemultipl +icity=undef useperlio=undef d_sfio=undef uselargefiles=define usesocks=undef use64bitint=undef use64bitall=undef uselongdouble=undef Compiler: cc='gcc', ccflags ='-I/usr/local/include -D_LARGEFILE_SOURCE -D_FI +LE_OFFSET_BITS=64', optimize='-O', cppflags='-I/usr/local/include' ccversion='', gccversion='2.8.1', gccosandvers='solaris2.6' intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=4321 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=1 +6 ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', + lseeksize=8 alignbytes=8, usemymalloc=y, prototype=define Linker and Libraries: ld='gcc', ldflags =' -L/usr/local/lib ' libpth=/usr/local/lib /usr/lib /usr/ccs/lib libs=-lsocket -lnsl -ldl -lm -lc perllibs=-lsocket -lnsl -ldl -lm -lc libc=/lib/libc.so, so=so, useshrplib=false, libperl=libperl.a Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' ' cccdlflags='-fPIC', lddlflags='-G -L/usr/local/lib' Characteristics of this binary (from libperl): Compile-time options: USE_LARGE_FILES

    Is the error with 5.6.0? I utterly failed to install cpanplus on 5.6.0, which was why I finally installed 5.6.1 a few months ago (and yes, upgrading fixed the problem). The reason for failure was deep inside LWP::Request. Does that set off warning bells? Either that, or maybe you fixed the error without realising it :)


    print@_{sort keys %_},$/if%_=split//,'= & *a?b:e\f/h^h!j+n,o@o;r$s-t%t#u'
Re: Need help with module problem specific to sun-solaris
by tachyon (Chancellor) on Nov 08, 2002 at 12:58 UTC

    Hmm even more confusing....

    Most of the tests that fail are in the form

    ok( (join' ',@av), 'foo bar' ); #68

    so I presume the return order is probably wrong but unless I can find a system that will reproduce the errors.... Perhaps it is specific to the version of perl rather than the OS

    Here is the CPAN tester dump

Re: Need help with module problem specific to sun-solaris
by Jaap (Curate) on Nov 08, 2002 at 13:13 UTC
    Here it succeeded on Solaris 8 with Perl 5.6.0
Re: Need help with module problem specific to sun-solaris
by vek (Prior) on Nov 08, 2002 at 13:30 UTC
    tachyon - worked fine for me too - Solaris 2.8 - Perl 5.6.1.

    -- vek --
Re: Need help with module problem specific to sun-solaris
by erasei (Pilgrim) on Nov 08, 2002 at 14:23 UTC
    Solaris 2.8

    Perl 5.005_03, failed cookie test with a "Can't find CGI::Util.pm" error message, yet my "kit is complete".

    Perl 5.8, failed both simple and standard, just like your example, both with an error "Can't locate CGI/Simple.pm" and "CGI/Simple/Standard.pm" in @INC (paths follow).

    Both simple and standard failed on line 9, the "use Simple" line.

    Feel free to contact me off site at erasei@erasei.com

      At the top of the test scripts is the line

      use lib qw(t/lib blib/lib blib/arch);

      This is the build library made by make after you run

      %perl Makefile.PL %make

      I suspect you may have just untargzipped the module without performing the make step (you must have done perl Makefile.PL as this is when you get the kit complete message). Without running make there will be no blib and thus the inability of perl to find the module in @INC.

      If you did perform the make step I would be very interested to know what is going on!

      cheers

      tachyon

      s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print

        Yes, I performed the correct steps, and installed it just like I always do, namely:
        tar -zxvf Cgi-Simple-0.05.tar.gz cd Cgi-Simple-0.05/ perl Makefile.PL make make test
        I just tried it again just to be sure, and it did the same thing again, so I am sure I did the same thing last week. I'd be happy to send you any output you need, just let me know.
Re: Need help with module problem specific to sun-solaris
by jlongino (Parson) on Nov 08, 2002 at 16:28 UTC
    Summary for my boxes:
    • Solaris 2.6, Perl 5.6.1 ++OK
    • Solaris 2.7, Perl 5.6.0 ++OK
    • Solaris 2.8, Perl 5.6.0 --Errors
    • Solaris 2.7, Perl 5.005_02 --Errors

      Oops, much egg on face for me. You do not have a full version of CGI.pm installed which has revealed an error in my test scripts. I had been calling CGI::Util instead of CGI::Simple::Util in this test script. As the APIs are identical this does not show up if you have CGI::Util installed (usual case). Fortunately changing the line

      # use CGI::Util qw(escape unescape); # Oops :o/ # I actually meant this.... use CGI::Simple::Util qw(escape unescape);

      should fix the problem.

      Thanks very much for your time.

      cheers

      tachyon

      s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print

Re: Need help with module problem specific to sun-solaris
by strider corinth (Friar) on Nov 08, 2002 at 17:42 UTC
    I ran the tests on my Linux from Scratch box, just to see what I got. I'm running Linux 2.4.19 on a P4. The results looked just like yours:
    PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_h +arness(0, 'blib/lib', 'blib/arch')" t/*.t t/cookie......ok + t/function....ok + t/request.....ok + t/simple......FAILED tests 68, 76-77, 81, 89-90, 205 + Failed 7/330 tests, 97.88% okay t/standard....FAILED tests 69, 77-78, 82, 185 + Failed 5/303 tests, 98.35% okay t/util........ok + Failed Test Stat Wstat Total Fail Failed List of Failed ---------------------------------------------------------------------- +--------- t/simple.t 330 7 2.12% 68 76-77 81 89-90 205 t/standard.t 303 5 1.65% 69 77-78 82 185 Failed 2/6 test scripts, 66.67% okay. 12/839 subtests failed, 98.57% o +kay.


    The info that isn't summarized above follows. I've emailed you the dump.txt file as well, but thought for discussion's sake that I should post this here:

      Hmmm. As suspected the failures result from a sort order problem. The interesting thing is that they occur in a seemingly random manner (on most systems they are in one order and OK but on other systems they are broken.) CGI::Simple uses the same method of retaining passed param order as CGI. Params are parsed in the order they are received and the param keys are pushed into an array to remember the order. Specifically this happens

      push @{$self->{'.parameters'}}, $param;

      @.parameters is used to remeber the supplied order. In the test scripts the problem arises thusly:

      # new() hash constructor print "Testing: new() hash constructor\n" if $debug; $q = new CGI::Simple( { 'foo'=>'1', 'bar'=>[2,3,4] } ); @av = $q->param; ok( (join' ',@av), 'foo bar' ); #68

      This is the code for the first test that fails. Evidently on certain versions of perl/OS the bucket architecture changes so that when the hash ref is passed in some cases this code:

      elsif ( (ref $init) =~ m/HASH/i ) { # initialize from param hash for my $param( keys %{$init} ) { $self->_add_param( $param, $init->{$param} ); } }

      returns the keys in a different order. As a result they are pushed into @.parameters in a different order and returned in a different order. Adding a reverse sort at this point will fix the tests BUT as this is exactly the same method CGI uses break concurrence.

      Rather than break this concurrence I will modify the test to reflect the two possible return cases. For all intents and purposes it is unlikey to make any real world difference.

      Thanks very much for your time

      cheers

      tachyon

      s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://211401]
Approved by fireartist
Front-paged by fireartist
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (7)
As of 2014-12-21 06:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (104 votes), past polls