IBM Support

PI70770: INCORRECT OUTPUT AND SEGV WITH BINARY COMPILED USING ARITH(FULL)

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • The resulting binary segfaults and produces the incorrect output
    with compiled with -q"arith(full)"
    
    ===== TESTCASE:
    $ cat test2.cbl
    ksh: No space left on device
          *************************
           IDENTIFICATION DIVISION.
          *************************
    
           PROGRAM-ID.  "TEST2"
    
          **********************
           ENVIRONMENT DIVISION.
          **********************
    
          ***************
           DATA DIVISION.
          ***************
    
           WORKING-STORAGE SECTION.
    
           01  WS-LENGTH                 PIC 9(02) VALUE 02.
           01  WS-PREC                   PIC 9(02) VALUE 00.
           01  WS-MAX-VAL                PIC S9(18).
          *
           PROCEDURE DIVISION.
          *--------------
           0000-MAINLINE.
          *--------------
    
               DISPLAY "WS-LENGTH : " WS-LENGTH.
               DISPLAY "WS-PREC : " WS-PREC.
               COMPUTE WS-MAX-VAL = 10 ** (WS-LENGTH + WS-PREC) - 1.
               DISPLAY WS-MAX-VAL.
    
               STOP RUN.
           0000-MAINLINE-X.
               EXIT.
    $
    
    
    ===== ACTUAL OUTPUT:
    $ ./a.out
    
    WS-LENGTH : 02
    WS-PREC : 00
    <Thread 1>
    <Thread 1>  Traceback:
    <Thread 1>    Offset 0x0000058c in procedure writeERRmsg
    <Thread 1>    Offset 0x00000044 in procedure iwzWriteERRmsg
    <Thread 1>    Offset 0x0000129c in procedure _iwzcExpFixedPt
    <Thread 1>    Offset 0x00000370 in procedure TEST2
    <Thread 1>    --- End of call chain ---
    IWZ059W  An exponent with more than nine digits was truncated.
    
    000000000000000000
    $
    
    
    ===== EXPECTED OUTPUT:
    $ ./a.out
    
    WS-LENGTH : 02
    WS-PREC : 00
    000000000000000099
    $
    

Local fix

  • N/A
    

Problem summary

  • USERS AFFECTED:
    Users who use the ARITH(FULL) option maybe affected by this
    issue.
    
    PROBLEM DESCRIPTION:
    The ARITH(FULL) compiler option was incorrectly processing
    certain arithmetic operations leading to a segfaul at runtime
    

Problem conclusion

  • The ARITH(FULL) option has been corrected to handle the scenario
    mentioned in this APAR.
    

Temporary fix

Comments

APAR Information

  • APAR number

    PI70770

  • Reported component name

    COBOL FOR AIX

  • Reported component ID

    5724Z8700

  • Reported release

    510

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt / Xsystem

  • Submitted date

    2016-10-17

  • Closed date

    2017-10-04

  • Last modified date

    2017-10-04

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

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

Fix information

  • Fixed component name

    COBOL AIX RUNTI

  • Fixed component ID

    5724Z8702

Applicable component levels

  • R510 PSY

       UP

[{"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SS6SGM","label":"COBOL for AIX"},"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"510","Line of Business":{"code":"LOB35","label":"Mainframe SW"}}]

Document Information

Modified date:
19 October 2021