HomeAbout Us A-Z IndexSearch * Contact Us Register LoginPress Shop

The Open Brand -- Problem Reporting and Interpretations System


Problem Report 2731 Details

Help Show help | Quick Search | Submit a Test Suite Support Request | Click here to view your privileges

This page provides all information on Problem Report 2731.


Report 2731 Actions


    Problem Report Number 2731
    Submitter's Classification Specification problem
    State Resolved
    Resolution Permanent Interpretation (PIN)
    Problem Resolution ID PIN.X.0297
    Raised 2021-05-08 16:21
    Updated 2021-05-10 11:04
    Published 2021-05-10 11:04
    Product Standard Internationalised System Calls and Libraries Extended (UNIX 95)
    Certification Program The Open Brand certification program
    Test Suite VSU version 5.3.19
    Test Identification CAPI.os/procenv/setrlimit/T.setrlimit{12,13,14}
    Specification System Interfaces and Libraries Issue 4 Version 2
    Location in Spec page 269 of C435
    Linked Problem Reports 2728
    Problem Summary VSU /tset/CAPI.os/procenv/setrlimit/T.setrlimit{12,13,14}
    Problem Text 1. This is an extension of Problem Report 2728. More details in
    Support Request #1197.
    2. I got failures for vsu5.3.19 test
    /tset/CAPI.os/procenv/setrlimit/T.setrlimit{12,13,14}in our test env.
    Just pasted the log of the first variation is as below,
    ================================================
    10|0 /tset/CAPI.os/procenv/setrlimit/T.setrlimit 03:10:34|TC Start,
    scenario ref 1-0, ICs: {12}
    15|0 3.8-lite 1|TCM Start
    400|0 12 1 03:10:34|IC Start
    200|0 12 03:10:34|TP Start
    520|0 12 00016844000 1 1|PREP: Get current limits
    520|0 12 00016844000 1 2|ERROR: The test must be run with the soft limit
    for RLIMIT_FSIZE not equal to RLIM_INFINITY
    220|0 12 2 03:10:34|UNRESOLVED
    410|0 12 1 03:10:34|IC End
    =======================================

    3. The test suite expects a non-infinite initial limit. I wrote a test
    case to try to use setrlimit to set a non-infinite initial limit, then
    executes tcc by calling execvp(). See the test case below
    ==========================================
    /*
    ** System include files.
    */
    #define _XOPEN_SOURCE 500
    #include <stdlib.h>
    #include <sys/resource.h>
    #include <sys/types.h>
    #include <sys/stat.h>
    #include <fcntl.h>
    #include <unistd.h>
    #include <signal.h>
    #include <setjmp.h>
    #include <sys/wait.h>

    /*
    ** declarations.
    */

    struct res {
    char name[15];
    int resource;
    };

    struct res vsu_res_list[] = {
    { "RLIMIT_CORE", RLIMIT_CORE },
    { "RLIMIT_CPU", RLIMIT_CPU },
    { "RLIMIT_DATA", RLIMIT_DATA },
    { "RLIMIT_FSIZE", RLIMIT_FSIZE },
    { "RLIMIT_NOFILE", RLIMIT_NOFILE },
    { "RLIMIT_STACK", RLIMIT_STACK },
    { "RLIMIT_AS", RLIMIT_AS },
    { "", 0 }
    };

    /*
    ** Function: int vsu_get_limit_name(int resource, struct res *rs)
    **
    ** Description:
    **
    ** This function searches the resource list for the
    ** resource type "resource". Once a match is found it
    ** copies the other data into "rs" and returns an integer
    ** to indicate success or failure.
    **
    ** Inputs:
    ** int resource -> Resource type
    ** struct res *rs -> Resource being returned
    **
    ** Returns:
    ** int -> 0 - Success
    ** 1 - Failure
    **
    */

    int
    vsu_get_limit_name(int resource, struct res *rs)
    {
    struct res *ptr;

    ptr = &vsu_res_list[0];
    while (strlen(ptr->name) != (size_t)0)
    {
    if (ptr->resource == resource)
    {
    strcpy(rs->name, ptr->name);
    rs->resource = resource;
    return (0);
    }
    ptr++;
    }
    return (1);
    }

    static int
    check_setrlimit(int resource)
    {
    struct rlimit setrlp;
    struct rlimit save;
    rlim_t soft;
    struct res rs;


    if (vsu_get_limit_name(resource, &rs))
    return (-1);

    printf("PREP: Obtain the limits for %s
    ", rs.name);
    if (getrlimit(resource, &save) != 0)
    {
    printf("error to getrlimit
    ");
    return (-1);
    }

    if (save.rlim_cur == RLIM_INFINITY)
    {
    printf("INFO: Limits for %s are not enforced on this
    system
    ", rs.name);
    }

    printf("Now try to use setrlimit to make the test run with soft
    limit not eaqual to RLIM_INFINITY
    ");
    /* in our system, RLIM_INFINITY is 2147483647L */

    /* save.rlim_cur = 2000000000; */
    save.rlim_cur = 2000000000;
    save.rlim_max = RLIM_INFINITY;


    setrlp.rlim_cur = save.rlim_cur;
    setrlp.rlim_max = setrlp.rlim_cur +1;



    if (setrlimit(resource, &setrlp) == -1)
    {
    printf("setrlimit failed to a value less than
    RLIM_INFINITY
    ");
    return (-1);
    }
    else
    printf("setrlimit success
    ");

    if (getrlimit(resource, &save) != 0)
    {
    printf("getrlimit failed after setrlimit
    ");
    return (-1);
    }
    else
    printf("getrlimit success after setrlimit
    ");

    if (setrlp.rlim_cur != save.rlim_cur)
    {
    printf("setrlimit() did not set the correct soft
    limit
    ");
    return (-1);
    }
    else
    printf("setrlimit() set the correct soft limit
    ");

    return (0);
    }

    int main()
    {
    char* command = "tcc";
    char* argument_list[] = {"tcc", "-e", "-l",
    "/tset/CAPI.os/procenv/setrlimit/T.setrlimit{1,2,3,4,5,8,10,11,12,13,14,
    18,19,20,21,28,29}","vsu", NULL};
    /* tcc -e -l /tset/CAPI.os/procenv/setrlimit/T.setrlimit{1} vsu
    */

    if (check_setrlimit(RLIMIT_CPU))
    printf("ERROR: check RLIMIT_CPU
    ");
    else
    printf("In main, check setrlimit RLIMIT_CPU
    OK
    ");

    if (check_setrlimit(RLIMIT_DATA))
    printf("ERROR: check RLIMIT_DATA
    ");
    else
    printf("In main, check setrlimit RLIMIT_DATA
    OK
    ");

    if (check_setrlimit(RLIMIT_FSIZE))
    printf("ERROR: check RLIMIT_FSIZE
    ");
    else
    printf("In main, check setrlimit RLIMIT_FSIZE
    OK
    ");

    if (check_setrlimit(RLIMIT_STACK))
    printf("ERROR: check RLIMIT_STACK
    ");
    else
    printf("In main, check setrlimit RLIMIT_STACK
    OK
    ");

    printf("Before calling execvp()
    ");

    /* Calling the execvp() system call */
    int status_code = execvp(command, argument_list);

    return (0);
    }
    ==============================================



    , then I got the result as below,
    =============================================
    PREP: Obtain the limits for RLIMIT_CPU
    INFO: Limits for RLIMIT_CPU are not enforced on this system;
    Now try to use setrlimit to make the test run with soft limit not eaqual
    to RLIM_INFINITY
    setrlimit success
    getrlimit success after setrlimit
    setrlimit() set the correct soft limit
    In main, check setrlimit RLIMIT_CPU OK
    PREP: Obtain the limits for RLIMIT_DATA
    INFO: Limits for RLIMIT_DATA are not enforced on this system
    Now try to use setrlimit to make the test run with soft limit not eaqual
    to RLIM_INFINITY
    setrlimit failed to a value less than RLIM_INFINITY
    ERROR: check RLIMIT_DATA
    PREP: Obtain the limits for RLIMIT_FSIZE
    INFO: Limits for RLIMIT_FSIZE are not enforced on this system
    Now try to use setrlimit to make the test run with soft limit not eaqual
    to RLIM_INFINITY
    setrlimit success
    getrlimit success after setrlimit
    setrlimit() set the correct soft limit
    In main, check setrlimit RLIMIT_FSIZE OK
    PREP: Obtain the limits for RLIMIT_STACK
    INFO: Limits for RLIMIT_STACK are not enforced on this system
    Now try to use setrlimit to make the test run with soft limit not eaqual
    to RLIM_INFINITY
    setrlimit failed to a value less than RLIM_INFINITY
    ERROR: check RLIMIT_STACK
    Before calling execvp()
    tcc: journal file is /vsu5319/usr/TET/vsu/results/0029e/journal
    ============================

    From the result, we can see that, in our system, we can change the soft
    limit to a lower value using setrlimit() for RLIMIT_FSIZE. Then var 12,
    13 and 14 could be passed. But we need to run the whole test suite from
    a wrapper program like the above one which is boring. May I apply a PIN
    to cover these three failures? Thanks so much for your help!
    Test Output 200|279 12 05:41:32|TP Start
    520|279 12 00016843276 1 1|PREP: Get current limits
    520|279 12 00016843276 1 2|ERROR: The test must be run with the soft
    limit for RLIMIT_FSIZE not equal to RLIM_INFINITY
    220|279 12 2 05:41:32|UNRESOLVED
    410|279 12 1 05:41:32|IC End
    400|279 13 1 05:41:32|IC Start
    200|279 13 05:41:32|TP Start
    520|279 13 00033620492 1 1|PREP: Obtain the current limits
    520|279 13 00033620492 1 2|ERROR: The test must be run with the soft
    limit for RLIMIT_FSIZE not equal to RLIM_INFINITY
    220|279 13 2 05:41:32|UNRESOLVED
    410|279 13 1 05:41:32|IC End
    400|279 14 1 05:41:32|IC Start
    200|279 14 05:41:32|TP Start
    520|279 14 00065989 1 1|PREP: Obtain the current limits
    520|279 14 00065989 1 2|ERROR: The test must be run with the soft limit
    for RLIMIT_FSIZE not equal to RLIM_INFINITY
    220|279 14 2 05:41:32|UNRESOLVED
    410|279 14 1 05:41:32|IC End

    Review Information

    Review Type SA Review
    Start Date 2021-05-08 16:21
    Last Updated 2021-05-10 11:04
    Completed 2021-05-10 11:04
    Status Complete
    Review Resolution Permanent Interpretation (PIN)
    Review Conclusion A permanent interpretation is granted (this is the same issue as PIN.X.0296)

    Problem Reporting System Options:

     

    Back   


Contact the Certification Authority