IV31921: PDF FILE NOT WRITTEN IF _EXIT() IS CALLED

Subscribe

You can track all active APARs for this component.

APAR status

  • Closed as user error.

Error description

  • When a program compiled with -qpdf1 exits using the _exit()
    function instead of the exit() function, the profiling data
    generated is not written out to a PDF profiling data file.
    
    
         ===== TEST CASE =====
    
    $ cat test2.c
    int main(int argc, char *argv[])
    {
       if ( argc == 2 ) {
            if ( atoi(argv[1]) == 1 )
               exit(0);
            else
               _exit(0);
       }
       return 0;
    }
    $ $cdir11com/xlc -qpdf1=pdfname=mypdf -qipa test2.c
    $ ./a.out 1
    $ ls | grep mypdf
    mypdf
    $ rm mypdf
    $ ./a.out 2
    $ ls | grep mypdf
    $
    

Local fix

  • Exit using exit() instead of _exit().
    

Problem summary

Problem conclusion

Temporary fix

Comments

  • The design of the PDF feature requires that the program exits
    via the exit() function because a 'fini' function
    (-binitfini::__pdfexit) must be invoked to write out the PDF
    data output file.  If a program exits via _exit(), this function
    does not get called, and no PDF profiling file is created.
    
    Replace calls to _exit() with exit() to solve the issue.
    

APAR Information

  • APAR number

    IV31921

  • Reported component name

    XL C/C++ AIX

  • Reported component ID

    5724X1300

  • Reported release

    B10

  • Status

    CLOSED USE

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2012-11-12

  • Closed date

    2012-12-03

  • Last modified date

    2012-12-03

  • APAR is sysrouted FROM one or more of the following:

  • APAR is sysrouted TO one or more of the following:

Fix information

Applicable component levels



Rate this page:

(0 users)Average rating

Add comments

Document information


More support for:

XL C/C++ for AIX

Software version:

11.1

Reference #:

IV31921

Modified date:

2012-12-03

Translate my page

Machine Translation

Content navigation