IBM Support

IT27001: POSSIBLE TRAPS AND/OR EBADF (ERRNO 9) ERRORS WHEN USING UTL_MAIL.SEND() AND THE ROUTINES FAILS

Subscribe to this APAR

By subscribing, you receive periodic emails alerting you to the status of the APAR, along with a link to the fix after it becomes available. You can track this item individually or track all items by product.

Notify me when this APAR changes.

Notify me when an APAR for this component changes.

 

APAR status

  • Closed as program error.

Error description

  • Db2 might crash with errors like the following in the
    db2diag.log, pointing to a possible Disk issue, although there
    is no relevant disk problem.
    
    FUNCTION: DB2 UDB, oper system services, sqloSystemErrorHandler,
    probe:10
    MESSAGE : ZRC=0x860F000A=-2045837302=SQLO_FNEX "File not found."
    DIA8411C A file "" could not be found.
    CALLED : OS, -, fstat64
    OSERR  : EBADF (9) "Bad file number"
    
    The problem is due to calling UTL_MAIL.SEND() (not limited to
    just this routine)
    When such a routine fails it will attempt to close the 'file
    descriptor' to the
    SMTP server 3 times in a row instead of 1. If something else
    opened a file and got the same  file descriptor in between then
    results can end up in trap or
    errors (EBADF - errno 9) for any system call dealing with a file
    descriptor.
    
    One way to check for this issue is to use traces:
    
      cat > trcmask <<SdS
      add sqlriInvokerTrusted
      add sqleml_utl_tcp_open_connection
      add sqleml_utl_tcp_close_connection
      SdS
    
      db2trc on -f trc.raw -Mfile trcmask
    
    After the problem occurs you should see in the traces 1 call to
    sqleml_utl_tcp_open_connection()
    but 3 calls to sqleml_utl_tcp_close_connection() for the same
    procedure. In the formatted (.fmt)
    trace file you should see that the value of the file descriptor
    in sqleml_utl_tcp_close_connection()
    is the same for all 3 calls.
    
    
    Additional symptoms could include intermittent problem with
    DB2's listener (db2tcpcm) going down and applications receive
    SQL30081 and "Connection Refused".
    
    PID    : 1123456            TID : 1234         PROC : db2sysc 0
    INSTANCE: db2inst1            NODE : 000
    HOSTNAME: TEST
    EDUID  : 3085                EDUNAME: db2tcpcm 0
    FUNCTION: DB2 UDB, common communication, sqlcctcpconnmgr_child,
    probe:2393
    MESSAGE : DIA3202C The TCP/IP call "ioctl(FIONBIO)" returned an
    errno="9".
    
    
    PID    : 1123456            TID : 3342          PROC : db2sysc 0
    INSTANCE: db2inst1            NODE : 000
    HOSTNAME: TEST
    EDUID  : 3342                EDUNAME: db2tcpcm 0
    FUNCTION: DB2 UDB, common communication, sqlcctcpconnmgr_child,
    probe:75
    MESSAGE : DIA3202C The TCP/IP call "select" returned an
    errno="9".
    

Local fix

Problem summary

  • ****************************************************************
    * USERS AFFECTED:                                              *
    * ALL                                                          *
    ****************************************************************
    * PROBLEM DESCRIPTION:                                         *
    * See Error Description                                        *
    ****************************************************************
    * RECOMMENDATION:                                              *
    * Upgrade to Db2 11.1 Mod 4 Fixpack 5 or higher                *
    ****************************************************************
    

Problem conclusion

  • First fixed in Db2 11.1 Mod 4 Fixpack 5
    

Temporary fix

Comments

APAR Information

  • APAR number

    IT27001

  • Reported component name

    DB2 FOR LUW

  • Reported component ID

    DB2FORLUW

  • Reported release

    B10

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt / Xsystem

  • Submitted date

    2018-11-16

  • Closed date

    2020-01-16

  • Last modified date

    2020-03-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

    DB2 FOR LUW

  • Fixed component ID

    DB2FORLUW

Applicable component levels

[{"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Product":{"code":"SSEPGG","label":"Db2 for Linux, UNIX and Windows"},"Component":"","ARM Category":[],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"11.1","Edition":"","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

Document Information

Modified date:
04 March 2020