Loading ...
Sorry, an error occurred while loading the content.

Fix perl/ithreads random failures

Expand Messages
  • Gisle Aas
    I had to do tests with an older version of mod_perl_1.99 that still had the perl/ithreads* tests. I see that these tests was removed from the distribution in
    Message 1 of 8 , Dec 8, 2004
    • 0 Attachment
      I had to do tests with an older version of mod_perl_1.99 that still
      had the perl/ithreads* tests. I see that these tests was removed from
      the distribution in [1], but I think that if you apply the attached
      patch you can start distribution these tests again.

      [1] http://cvs.apache.org/viewcvs.cgi/modperl-2.0/lib/ModPerl/Manifest.pm?r1=1.9&r2=1.10

      Regards,
      Gisle


      Index: t/response/TestPerl/ithreads.pm
      --- t/response/TestPerl/ithreads.pm.~1~ Wed Dec 8 03:43:55 2004
      +++ t/response/TestPerl/ithreads.pm Wed Dec 8 03:43:55 2004
      @@ -57,7 +57,10 @@
      $counter_shar += $counter_shar for 1..10;
      });
      $counter_priv += $counter_priv for 1..10;
      - $counter_shar += $counter_shar for 1..10;
      + {
      + lock $counter_shar;
      + $counter_shar += $counter_shar for 1..10;
      + }
      $thr->join;
      ok t_cmp(2**20, $counter_shar, "shared counter");
      ok t_cmp(2**10, $counter_priv, "private counter");
      End of Patch.

      --
      Report problems: http://perl.apache.org/bugs/
      Mail list info: http://perl.apache.org/maillist/modperl.html
      List etiquette: http://perl.apache.org/maillist/email-etiquette.html
    • Steve Hay
      ... mp2 is now in svn, not cvs. Check-out the latest svn revision as described at:
      Message 2 of 8 , Dec 8, 2004
      • 0 Attachment
        Gisle Aas wrote:

        >I had to do tests with an older version of mod_perl_1.99 that still
        >had the perl/ithreads* tests. I see that these tests was removed from
        >the distribution in [1], but I think that if you apply the attached
        >patch you can start distribution these tests again.
        >
        >[1] http://cvs.apache.org/viewcvs.cgi/modperl-2.0/lib/ModPerl/Manifest.pm?r1=1.9&r2=1.10
        >
        mp2 is now in svn, not cvs. Check-out the latest svn revision as
        described at:

        http://perl.apache.org/download/source.html#Development_mod_perl_2_0_Source_Distribution

        and you can try that rather than having to go back to an older version.
        The test file, of course, is in the dev source, but is currently marked
        as under construction:

        http://svn.apache.org/repos/asf/perl/modperl/trunk/t/perl/ithreads.t

        Anyway, I tried your patch (with the ithreads test re-instated) and
        sadly it didn't fix it for me :( The complete diff of changes that I
        made to my svn checkout (revision 111269) are at the end of this mail.

        The following test sequence still fails every time for me:

        perl t/TEST -verbose t/modules/reload.t t/perl/api.t t/perl/ithreads.t

        on WinXP with Apache 2.0.50 and Perl 5.8.5.

        - Steve

        Index: t/response/TestPerl/ithreads.pm
        ===================================================================
        --- t/response/TestPerl/ithreads.pm (revision 111269)
        +++ t/response/TestPerl/ithreads.pm (working copy)
        @@ -57,7 +57,10 @@
        $counter_shar += $counter_shar for
        1..10;
        });
        $counter_priv += $counter_priv for 1..10;
        - $counter_shar += $counter_shar for 1..10;
        + {
        + lock $counter_shar;
        + $counter_shar += $counter_shar for 1..10;
        + }
        $thr->join;
        ok t_cmp($counter_shar, 2**20, "shared counter");
        ok t_cmp($counter_priv, 2**10, "private counter");
        Index: t/perl/ithreads.t
        ===================================================================
        --- t/perl/ithreads.t (revision 111269)
        +++ t/perl/ithreads.t (working copy)
        @@ -11,10 +11,9 @@

        # perl < 5.6.0 fails to compile code with 'shared' attributes, so we
        must skip
        # it here.
        -#unless ($] >= 5.008001 && $Config{useithreads}) {
        -# plan tests => 1, need
        -# {"perl 5.8.1 or higher w/ithreads enabled is required" => 0};
        -#}
        -plan tests => 1, under_construction;
        +unless ($] >= 5.008001 && $Config{useithreads}) {
        + plan tests => 1, need
        + {"perl 5.8.1 or higher w/ithreads enabled is required" => 0};
        +}

        print GET_BODY_ASSERT "/TestPerl__ithreads";



        ------------------------------------------------
        Radan Computational Ltd.

        We would like to take this opportunity to wish all our customers, suppliers and colleagues seasons greetings. We will not be sending corporate greetings cards this year. Instead, we will be making a donation to charity.

        The information contained in this message and any files transmitted with it are confidential and intended for the addressee(s) only. If you have received this message in error or there are any problems, please notify the sender immediately. The unauthorized use, disclosure, copying or alteration of this message is strictly forbidden. Note that any views or opinions presented in this email are solely those of the author and do not necessarily represent those of Radan Computational Ltd. The recipient(s) of this message should check it and any attached files for viruses: Radan Computational will accept no liability for any damage caused by any virus transmitted by this email.
      • Gisle Aas
        ... Isn t CVS in sync as well? I read and it only mentioned CVS and had a pointer to the CVS web interface. ... This one
        Message 3 of 8 , Dec 8, 2004
        • 0 Attachment
          Steve Hay <steve.hay@...> writes:

          > Gisle Aas wrote:
          >
          > >I had to do tests with an older version of mod_perl_1.99 that still
          > >had the perl/ithreads* tests. I see that these tests was removed from
          > >the distribution in [1], but I think that if you apply the attached
          > >patch you can start distribution these tests again.
          > >
          > >[1] http://cvs.apache.org/viewcvs.cgi/modperl-2.0/lib/ModPerl/Manifest.pm?r1=1.9&r2=1.10
          > >
          > mp2 is now in svn, not cvs.

          Isn't CVS in sync as well?

          I read <http://perl.apache.org/contribute/> and it only mentioned CVS
          and had a pointer to the CVS web interface.

          > Check-out the latest svn revision as described at:
          >
          > http://perl.apache.org/download/source.html#Development_mod_perl_2_0_Source_Distribution

          This one also has pointers to the CVS snapshots and the CVS web
          interface so I assume that it is kept in sync.

          > and you can try that rather than having to go back to an older version.

          The patch was reletive to an older version by from glancing at the CVS
          head it looked that it would apply there as well.

          > The test file, of course, is in the dev source, but is currently marked
          > as under construction:
          >
          > http://svn.apache.org/repos/asf/perl/modperl/trunk/t/perl/ithreads.t
          >
          > Anyway, I tried your patch (with the ithreads test re-instated) and
          > sadly it didn't fix it for me :( The complete diff of changes that I
          > made to my svn checkout (revision 111269) are at the end of this mail.
          >
          > The following test sequence still fails every time for me:
          >
          > perl t/TEST -verbose t/modules/reload.t t/perl/api.t t/perl/ithreads.t
          >
          > on WinXP with Apache 2.0.50 and Perl 5.8.5.

          So what is the output when this fails?

          I tested on HP-UX/IA-64 and the fix cured the problem there. The fix
          is also obviously correct as both the parent and the child thread
          needs to lock for it to take effect.

          Regards,
          Gisle

          --
          Report problems: http://perl.apache.org/bugs/
          Mail list info: http://perl.apache.org/maillist/modperl.html
          List etiquette: http://perl.apache.org/maillist/email-etiquette.html
        • Steve Hay
          ... Other people can say for sure whether cvs is kept in sync, but my impression was that it was not. I could be wrong. Anyway, svn is definitely the way
          Message 4 of 8 , Dec 8, 2004
          • 0 Attachment
            Gisle Aas wrote:

            >Steve Hay <steve.hay@...> writes:
            >
            >
            >
            >>Gisle Aas wrote:
            >>
            >>
            >>
            >>>I had to do tests with an older version of mod_perl_1.99 that still
            >>>had the perl/ithreads* tests. I see that these tests was removed from
            >>>the distribution in [1], but I think that if you apply the attached
            >>>patch you can start distribution these tests again.
            >>>
            >>>[1] http://cvs.apache.org/viewcvs.cgi/modperl-2.0/lib/ModPerl/Manifest.pm?r1=1.9&r2=1.10
            >>>
            >>>
            >>>
            >>mp2 is now in svn, not cvs.
            >>
            >>
            >
            >Isn't CVS in sync as well?
            >
            >I read <http://perl.apache.org/contribute/> and it only mentioned CVS
            >and had a pointer to the CVS web interface.
            >
            >
            >
            >> Check-out the latest svn revision as described at:
            >>
            >>http://perl.apache.org/download/source.html#Development_mod_perl_2_0_Source_Distribution
            >>
            >>
            >
            >This one also has pointers to the CVS snapshots and the CVS web
            >interface so I assume that it is kept in sync.
            >
            >
            Other people can say for sure whether cvs is kept in sync, but my
            impression was that it was not. I could be wrong. Anyway, svn is
            definitely the way forward.

            I know that not all the docs have been updated yet, hence there are
            various references to cvs around the place still.

            >
            >
            >>and you can try that rather than having to go back to an older version.
            >>
            >>
            >
            >The patch was reletive to an older version by from glancing at the CVS
            >head it looked that it would apply there as well.
            >
            >
            Yes, the patch applied to the current svn version.

            >
            >
            >>The test file, of course, is in the dev source, but is currently marked
            >>as under construction:
            >>
            >>http://svn.apache.org/repos/asf/perl/modperl/trunk/t/perl/ithreads.t
            >>
            >>Anyway, I tried your patch (with the ithreads test re-instated) and
            >>sadly it didn't fix it for me :( The complete diff of changes that I
            >>made to my svn checkout (revision 111269) are at the end of this mail.
            >>
            >>The following test sequence still fails every time for me:
            >>
            >>perl t/TEST -verbose t/modules/reload.t t/perl/api.t t/perl/ithreads.t
            >>
            >>on WinXP with Apache 2.0.50 and Perl 5.8.5.
            >>
            >>
            >
            >So what is the output when this fails?
            >
            >I tested on HP-UX/IA-64 and the fix cured the problem there. The fix
            >is also obviously correct as both the parent and the child thread
            >needs to lock for it to take effect.
            >
            I can't argue about whether it is correct or not, it's just that it
            didn't fix the failures that I've been experiencing for some time on WinXP.

            On WinXP the test sequence that I posted in my last mail causes the
            Apache.exe process to crash. Nothing is written to the error_log, and
            only this appears in the console (even with the -verbose option):

            t\perl\ithreads.....request has failed (the response code was: 500)
            see t/logs/error_log for more details
            dubious
            Test returned status 9 (wstat 2304, 0x900)

            There is no popup application error dialogue box, hence no opportunity
            to step into the source and even see where it crashed.

            This has been discussed several times on the dev list (which is probably
            where we should be now...), most recently here:

            http://marc.theaimsgroup.com/?t=110141084300003&r=1&w=2

            Stas can't even reliably reproduce the problem on Linux, so hasn't been
            able to debug it himself at all.

            What was the problem that you had on HP/UX? Was it crashing or just
            failing (as in "not ok")?

            - Steve


            ------------------------------------------------
            Radan Computational Ltd.

            We would like to take this opportunity to wish all our customers, suppliers and colleagues seasons greetings. We will not be sending corporate greetings cards this year. Instead, we will be making a donation to charity.

            The information contained in this message and any files transmitted with it are confidential and intended for the addressee(s) only. If you have received this message in error or there are any problems, please notify the sender immediately. The unauthorized use, disclosure, copying or alteration of this message is strictly forbidden. Note that any views or opinions presented in this email are solely those of the author and do not necessarily represent those of Radan Computational Ltd. The recipient(s) of this message should check it and any attached files for viruses: Radan Computational will accept no liability for any damage caused by any virus transmitted by this email.
          • Stas Bekman
            ... Right on, Gisle. I was locking it inside the child-threads, but forgot about the parent. Thanks. --
            Message 5 of 8 , Dec 8, 2004
            • 0 Attachment
              Gisle Aas wrote:
              > I had to do tests with an older version of mod_perl_1.99 that still
              > had the perl/ithreads* tests. I see that these tests was removed from
              > the distribution in [1], but I think that if you apply the attached
              > patch you can start distribution these tests again.
              >
              > [1] http://cvs.apache.org/viewcvs.cgi/modperl-2.0/lib/ModPerl/Manifest.pm?r1=1.9&r2=1.10
              >
              > Regards,
              > Gisle
              >
              >
              > Index: t/response/TestPerl/ithreads.pm
              > --- t/response/TestPerl/ithreads.pm.~1~ Wed Dec 8 03:43:55 2004
              > +++ t/response/TestPerl/ithreads.pm Wed Dec 8 03:43:55 2004
              > @@ -57,7 +57,10 @@
              > $counter_shar += $counter_shar for 1..10;
              > });
              > $counter_priv += $counter_priv for 1..10;
              > - $counter_shar += $counter_shar for 1..10;
              > + {
              > + lock $counter_shar;
              > + $counter_shar += $counter_shar for 1..10;
              > + }
              > $thr->join;
              > ok t_cmp(2**20, $counter_shar, "shared counter");
              > ok t_cmp(2**10, $counter_priv, "private counter");
              > End of Patch.

              Right on, Gisle. I was locking it inside the child-threads, but forgot
              about the parent. Thanks.


              --
              __________________________________________________________________
              Stas Bekman JAm_pH ------> Just Another mod_perl Hacker
              http://stason.org/ mod_perl Guide ---> http://perl.apache.org
              mailto:stas@... http://use.perl.org http://apacheweek.com
              http://modperlbook.org http://apache.org http://ticketmaster.com

              --
              Report problems: http://perl.apache.org/bugs/
              Mail list info: http://perl.apache.org/maillist/modperl.html
              List etiquette: http://perl.apache.org/maillist/email-etiquette.html
            • Stas Bekman
              ... It s not in sync. The only reason it s still working is because I have tons of unfinished cvs checkouts, which I need to find the time to process and then
              Message 6 of 8 , Dec 8, 2004
              • 0 Attachment
                Steve Hay wrote:
                > Gisle Aas wrote:
                >
                >
                >>Steve Hay <steve.hay@...> writes:
                >>
                >>
                >>
                >>
                >>>Gisle Aas wrote:
                >>>
                >>>
                >>>
                >>>
                >>>>I had to do tests with an older version of mod_perl_1.99 that still
                >>>>had the perl/ithreads* tests. I see that these tests was removed from
                >>>>the distribution in [1], but I think that if you apply the attached
                >>>>patch you can start distribution these tests again.
                >>>>
                >>>>[1] http://cvs.apache.org/viewcvs.cgi/modperl-2.0/lib/ModPerl/Manifest.pm?r1=1.9&r2=1.10
                >>>>
                >>>>
                >>>>
                >>>
                >>>mp2 is now in svn, not cvs.
                >>>
                >>>
                >>
                >>Isn't CVS in sync as well?
                >>
                >>I read <http://perl.apache.org/contribute/> and it only mentioned CVS
                >>and had a pointer to the CVS web interface.
                >>
                >>
                >>
                >>
                >>>Check-out the latest svn revision as described at:
                >>>
                >>>http://perl.apache.org/download/source.html#Development_mod_perl_2_0_Source_Distribution
                >>>
                >>>
                >>
                >>This one also has pointers to the CVS snapshots and the CVS web
                >>interface so I assume that it is kept in sync.
                >>
                >>
                >
                > Other people can say for sure whether cvs is kept in sync, but my
                > impression was that it was not. I could be wrong. Anyway, svn is
                > definitely the way forward.

                It's not in sync. The only reason it's still working is because I have
                tons of unfinished cvs checkouts, which I need to find the time to process
                and then we can close cvs.

                > I know that not all the docs have been updated yet, hence there are
                > various references to cvs around the place still.

                Right, sorry, I'll be updating those pages today. for now please refer to:
                http://perl.apache.org/download/source.html#Development_mod_perl_2_0_Source_Distribution
                which is up-to-date.

                --
                __________________________________________________________________
                Stas Bekman JAm_pH ------> Just Another mod_perl Hacker
                http://stason.org/ mod_perl Guide ---> http://perl.apache.org
                mailto:stas@... http://use.perl.org http://apacheweek.com
                http://modperlbook.org http://apache.org http://ticketmaster.com

                --
                Report problems: http://perl.apache.org/bugs/
                Mail list info: http://perl.apache.org/maillist/modperl.html
                List etiquette: http://perl.apache.org/maillist/email-etiquette.html
              • Gisle Aas
                ... It was not crashing, just ending up the the wrong value. The TEST_VERBOSE=1 output was this. perl/ithreads.....1..4 # Running under perl version 5.008006
                Message 7 of 8 , Dec 8, 2004
                • 0 Attachment
                  Steve Hay <steve.hay@...> writes:

                  > What was the problem that you had on HP/UX? Was it crashing or just
                  > failing (as in "not ok")?

                  It was not crashing, just ending up the the wrong value. The
                  TEST_VERBOSE=1 output was this.

                  perl/ithreads.....1..4
                  # Running under perl version 5.008006 for hpux
                  # Current time local: Wed Dec 8 02:47:14 2004
                  # Current time GMT: Wed Dec 8 10:47:14 2004
                  # Using Test.pm version 1.25
                  ok 1
                  # testing : thread callback returned value
                  # expected: 2
                  # received: 2
                  ok 2
                  # testing : shared counter
                  # expected: 1048576
                  # received: 524288
                  not ok 3
                  # testing : private counter
                  # expected: 1024
                  # received: 1024
                  ok 4
                  FAILED test 3
                  Failed 1/4 tests, 75.00% okay
                  perl/ithreads2....# connecting to localhost:8540
                  1..4
                  # Running under perl version 5.008006 for hpux
                  # Current time local: Wed Dec 8 02:47:15 2004
                  # Current time GMT: Wed Dec 8 10:47:15 2004
                  # Using Test.pm version 1.25
                  ok 1
                  # testing : thread callback returned value
                  # expected: 2
                  # received: 2
                  ok 2
                  # testing : shared counter
                  # expected: 1048576
                  # received: 262144
                  not ok 3
                  # testing : private counter
                  # expected: 1024
                  # received: 1024
                  ok 4
                  FAILED test 3
                  Failed 1/4 tests, 75.00% okay
                  Failed Test Stat Wstat Total Fail Failed List of Failed
                  ------------------------------------------------------------------------------------------------------------------------------
                  perl/ithreads.t 4 1 25.00% 3
                  perl/ithreads2.t 4 1 25.00% 3

                  --
                  Report problems: http://perl.apache.org/bugs/
                  Mail list info: http://perl.apache.org/maillist/modperl.html
                  List etiquette: http://perl.apache.org/maillist/email-etiquette.html
                • Stas Bekman
                  ... Thanks Gisle, committed. -- __________________________________________________________________ Stas Bekman JAm_pH ------ Just Another mod_perl
                  Message 8 of 8 , Dec 8, 2004
                  • 0 Attachment
                    Gisle Aas wrote:
                    > I had to do tests with an older version of mod_perl_1.99 that still
                    > had the perl/ithreads* tests. I see that these tests was removed from
                    > the distribution in [1], but I think that if you apply the attached
                    > patch you can start distribution these tests again.
                    >
                    > [1] http://cvs.apache.org/viewcvs.cgi/modperl-2.0/lib/ModPerl/Manifest.pm?r1=1.9&r2=1.10
                    >
                    > Regards,
                    > Gisle
                    >
                    >
                    > Index: t/response/TestPerl/ithreads.pm
                    > --- t/response/TestPerl/ithreads.pm.~1~ Wed Dec 8 03:43:55 2004
                    > +++ t/response/TestPerl/ithreads.pm Wed Dec 8 03:43:55 2004
                    > @@ -57,7 +57,10 @@
                    > $counter_shar += $counter_shar for 1..10;
                    > });
                    > $counter_priv += $counter_priv for 1..10;
                    > - $counter_shar += $counter_shar for 1..10;
                    > + {
                    > + lock $counter_shar;
                    > + $counter_shar += $counter_shar for 1..10;
                    > + }
                    > $thr->join;
                    > ok t_cmp(2**20, $counter_shar, "shared counter");
                    > ok t_cmp(2**10, $counter_priv, "private counter");
                    > End of Patch.

                    Thanks Gisle, committed.

                    --
                    __________________________________________________________________
                    Stas Bekman JAm_pH ------> Just Another mod_perl Hacker
                    http://stason.org/ mod_perl Guide ---> http://perl.apache.org
                    mailto:stas@... http://use.perl.org http://apacheweek.com
                    http://modperlbook.org http://apache.org http://ticketmaster.com

                    --
                    Report problems: http://perl.apache.org/bugs/
                    Mail list info: http://perl.apache.org/maillist/modperl.html
                    List etiquette: http://perl.apache.org/maillist/email-etiquette.html
                  Your message has been successfully submitted and would be delivered to recipients shortly.