Re: [pcre-dev] Release candidate for 10.10

Page principale
Supprimer ce message
Auteur: Petr Pisar
Date:  
À: pcre-dev
Sujet: Re: [pcre-dev] Release candidate for 10.10
On Fri, Feb 20, 2015 at 12:26:21PM +0000, ph10@??? wrote:
> I have put a release candidate for PCRE2 release 10.10 on the FTP site:
>

I'm giving a try to this release for the first time of PCRE2, and I experience
a test failure on 32-bit PowerPC:

FAIL: RunTest
=============
PCRE2 C library tests using test data from ./testdata
PCRE2 version 10.10-RC1 2015-02-20
---- Testing 8-bit library ----
Test 0: Unchecked pcre2test argument tests (to improve coverage)
OK
Test 1: Main non-UTF, non-UCP functionality (compatible with Perl >= 5.10)
OK
OK with JIT
Test 2: API, errors, internals, and non-Perl stuff (excluding UTF-8)
pcre2test: setrlimit() failed with error -1

I have not yet got interractive access the PPC machine to investigate what's
wrong, but the pcre2test.c code looks suspicous to me:

  else if (strcmp(arg, "-S") == 0 && argc > 2 &&
      ((stack_size = get_value(argv[op+1], &endptr)), *endptr == 0))
    {
#if defined(_WIN32) || defined(WIN32) || defined(__minix) || defined(NATIVE_ZOS) || defined(__VMS)
    fprintf(stderr, "pcre2test: -S is not supported on this OS\n");
    exit(1);
#else
    int rc;
    struct rlimit rlim;
    getrlimit(RLIMIT_STACK, &rlim);
    rlim.rlim_cur = stack_size * 1024 * 1024;
    rc = setrlimit(RLIMIT_STACK, &rlim);
    if (rc != 0)
      {
      fprintf(stderr, "pcre2test: setrlimit() failed with error %d\n", rc);
      exit(1);
      }
    op++;
    argc--;
#endif
    }


First, it should report strerror(errno) on failure. It would help more than
-1 return value.

Second, the issue maybe is that I set hard limit to 10 MB (on some platform
like PPC), while the RunTest script can call pcre2test wiht -S 16 arguments
leading to requsting 16 MB of soft limit which is bigger than my 10-MB hard
limit and that could cause the failure (setrlimit(2) returns EINVAL in this
case).

I will do some test and post my findings.

-- Petr