AIX Open Source

AIX Open Source

 View Only
  • 1.  /usr/lib/rpm/rpmdeps invalid range expression

    Posted Mon October 12, 2020 10:24 AM
    During building an RPM package, I got today a strange error:

    warning: Recognition of file "/var/tmp/../rsyslog/rsyslog.conf" failed: mode 100644 line 156: regex error 11 for `^[!-?A-~]{1,255}( [^ ]+){11}', (invalid range expression)

    The error was thrown with different files, which don't have something in common, but not with all of the files in the package. I took the file rsyslog.conf to trace the error:

    $MaxMessageSize 700000
    $IncludeConfig /etc/rsyslog/conf.d/*.conf
    module(load="imuxsock" SysSock.Use="off")
    input(type="imuxsock" Socket="/var/run/rsyslog/rsyslog.sock" unlink="on")
    action(type="omfile" file="/dev/null")

    The error is produced by rpmdeps command:

    # /usr/lib/rpm/rpmdeps rsyslog.conf
    warning: Recognition of file "rsyslog.conf" failed: mode 000000 line 156: regex error 11 for `^[!-?A-~]{1,255}( [^ ]+){11}', (invalid range expression)
    warning: Deprecated external dependency generator is used!
    Finding Provides: /usr/opt/rpm/lib/rpm/find-provides
    Finding Requires(interp):
    Finding Requires(rpmlib):
    Finding Requires(verify):
    Finding Requires(pre):
    Finding Requires(post):
    Finding Requires(preun):
    Finding Requires(postun):
    Finding Requires(pretrans):
    Finding Requires(posttrans):
    Finding Requires: /usr/opt/rpm/lib/rpm/find-requires
    Finding Conflicts:
    Finding Obsoletes:
    Finding Recommends:
    Finding Suggests:
    Finding Supplements:
    Finding Enhances:

    Tracing further I found that the problem line lays in /usr/opt/rpm/share/misc/magic:

    5001:0 regex =^[!-?A-~]{1,255}(\t[^\t]+){11}

    Because I didn't the error earlier, I checked the elder versions of rpm.rte. The last version which didn't produce the error was 4.13.0.8:

    # lslpp -Lqc rpm.rte
    rpm.rte:rpm.rte:4.13.0.8: : :C: :RPM Package Manager: : : : : : :0:0:/:
    # rpm --version
    RPM version 4.13.0.1
    # /usr/lib/rpm/rpmdeps rsyslog.conf
    Finding Provides: /usr/opt/rpm/lib/rpm/find-provides
    Finding Requires(interp):
    Finding Requires(rpmlib):
    Finding Requires(verify):
    Finding Requires(pre):
    Finding Requires(post):
    Finding Requires(preun):
    Finding Requires(postun):
    Finding Requires(pretrans):
    Finding Requires(posttrans):
    Finding Requires: /usr/opt/rpm/lib/rpm/find-requires​​​
    The newer versions have the updated magic file and the error:

    # lslpp -Lqc rpm.rte
    rpm.rte:rpm.rte:4.13.0.9: : :C: :RPM Package Manager: : : : : : :0:0:/:
    # rpm --version
    RPM version 4.13.0.1
    # /usr/lib/rpm/rpmdeps rsyslog.conf
    warning: Recognition of file "rsyslog.conf" failed: mode 000000 line 156: regex error 11 for `^[!-?A-~]{1,255}( [^ ]+){11}', (invalid range expression)
    Finding Provides: /usr/opt/rpm/lib/rpm/find-provides
    Finding Requires(interp):
    Finding Requires(rpmlib):
    Finding Requires(verify):
    Finding Requires(pre):
    Finding Requires(post):
    Finding Requires(preun):
    Finding Requires(postun):
    Finding Requires(pretrans):
    Finding Requires(posttrans):
    Finding Requires: /usr/opt/rpm/lib/rpm/find-requires

    The problem occurs if I use UTF-8 encoding, which is standard on my build system. If I swith to C, everything work OK even with newer version:

    $ LANG=C /usr/lib/rpm/rpmdeps rsyslog.conf
    Finding Provides: /usr/opt/rpm/lib/rpm/find-provides
    Finding Requires(interp):
    Finding Requires(rpmlib):
    Finding Requires(verify):
    Finding Requires(pre):
    Finding Requires(post):
    Finding Requires(preun):
    Finding Requires(postun):
    Finding Requires(pretrans):
    Finding Requires(posttrans):
    Finding Requires: /usr/opt/rpm/lib/rpm/find-requires

    $ LANG=en_US.UTF-8 /usr/lib/rpm/rpmdeps rsyslog.conf
    warning: Recognition of file "rsyslog.conf" failed: mode 000000 line 156: regex error 11 for `^[!-?A-~]{1,255}( [^ ]+){11}', (invalid range expression)
    Finding Provides: /usr/opt/rpm/lib/rpm/find-provides
    Finding Requires(interp):
    Finding Requires(rpmlib):
    Finding Requires(verify):
    Finding Requires(pre):
    Finding Requires(post):
    Finding Requires(preun):
    Finding Requires(postun):
    Finding Requires(pretrans):
    Finding Requires(posttrans):
    Finding Requires: /usr/opt/rpm/lib/rpm/find-requires




    ​​​​​​​

    ------------------------------
    Andrey Klyachkin

    https://www.power-devops.com
    ------------------------------


  • 2.  RE: /usr/lib/rpm/rpmdeps invalid range expression

    Posted Mon October 12, 2020 03:09 PM
    Thanks Andrey for the detailed analysis.
    There were some changes related to one of the dependency package file from rpm.rte-4.13.0.9 which rpmbuild uses.
    Will look into the issue and update the same.

    ------------------------------
    SANGAMESH
    ------------------------------



  • 3.  RE: /usr/lib/rpm/rpmdeps invalid range expression

    Posted Fri November 19, 2021 09:08 AM
    FYI This issue was raised in a case today. I did some quick testing, and had success if I used the legacy EN_US.UTF-8 instead of the CLDR sourced locale en_US.UTF-8.

    https://www.ibm.com/support/pages/node/5692220

    ------------------------------
    Jan Harris
    ------------------------------



  • 4.  RE: /usr/lib/rpm/rpmdeps invalid range expression

    Posted Wed November 24, 2021 11:59 PM
    We did some analysis and here are some of the observations
    1. This error doesn't appear if we use EN_US.UTF-8 as you mentioned.
    2. This seems to happen if there is a tilde (~) in the pattern.
    3. regcomp call is the one which is returning the wrong value.
    #include <stdio.h>
    #include <regex.h>
    #include <locale.h>
    int main()
    {
        regex_t rx;
        char *pat = "^[!-?A-~]{1,255}(\t[^\t]+){11}";
        int flags = REG_EXTENDED|REG_NEWLINE;
        int rc = 0;
        setlocale(LC_ALL, "en_US.UTF-8");
        printf("rc:%d\n", regcomp(&rx, pat, flags));
        setlocale(LC_ALL, "EN_US.UTF-8");
        printf("rc:%d\n", regcomp(&rx, pat, flags));
    }
    # gcc -o regcomp_v regcomp_v.c
    # ./regcomp_v
    rc:11
    rc:0

    We raised a defect against regcomp.


    ------------------------------
    SANGAMESH
    ------------------------------



  • 5.  RE: /usr/lib/rpm/rpmdeps invalid range expression

    Posted Thu February 23, 2023 05:53 AM

    Could somebody please explain what is the status here? I was just trapped by this error on an AIX 7300-01-01-2246 machine.



    ------------------------------
    Sven Willenbücher
    ------------------------------