IBM Support

IV64454: HANG UNDER SOME CIRCUMSTANCES WHEN A C++ DTOR UNLOADS LIBRARIES.APPLIES TO AIX 6100-08

A fix is available

Subscribe

You can track all active APARs for this component.

APAR status

  • Closed as program error.

Error description

  • Error Description:
    Two threads could enter a deadlock  and prevent process
    exit when:
    
    Thread A:
      Calls exit()-> which in turn calls DTOR of a
      static object-> which in turn notifies threadB  that
      unloads yet another library.
      Then threadA waits for a semaphore notification from
      threadB.
    
    Two threads will be seen deadlocked with the
    following stack trace( these are actual stack traces
    from a test case that recreates the problem)
    
    First thread(B)
    ==========
    _global_lock_common(??, ??, ??) at 0x90000000053c83c
    _rec_mutex_lock(m = 0x09001000a0f32130), line 399 in
    "rec_mutex.c"
    terminateAndUnload(??) at 0x90000000168ad90
    dlclose(handle = 0x0000000000000003), line 650 in
    "dlfcn.c"
    func(x_void_ptr = (nil)), line 34 in "CPlusPlusClass.C"
    
    Another thread ( A)
    ==========
    _event_sleep(??, ??, ??, ??, ??, ??) at 0x900000000550844
    _event_wait(??, ??) at 0x900000000551344
    _cond_wait_local(??, ??, ??) at 0x90000000055f81c
    _cond_wait(??, ??, ??) at 0x90000000055fe08
    pthread_cond_wait(??, ??) at 0x900000000560a5c
    waitForResponse(), line 27 in "responder.c"
    CPlusPlusClass::~CPlusPlusClass()(this =
    0x09001000a1099658, __dtorFlags = 2), line 62 in
    "CPlusPlusClass.C"
    __srterm__0()(), line 78 in "CPlusPlusClass.C"
    __sterm80000000_x_2fhome_2fanandd_2ftester_2fCPlusPlusCla
    ss_2eC()(), line 55 in "CPlusPlusClass.C"
    __catchThrownException() at 0x9000000005d5a80
    terminate_one_library(??, ??) at 0x900000001689630
    __run_final_dtors() at 0x90000000168722c
    __C_runtime_termination() at 0x10000064c
    exit(??) at 0x900000001582a80
    CPlusPlusClass::foo()(this = 0x09001000a1099658), line
    117 in "CPlusPlusClass.C"
    main(), line 5 in "Main.C"
    

Local fix

Problem summary

  • Customer may see deadlock if registration order of
     run_final_dtors()" as an atexit() function has changed.
    

Problem conclusion

  • Solution is to avoid deadlock even if the registration order of
    run_final_dtors()" as an atexit() function is changed by
    running real run_final_dtors only at the end.
    

Temporary fix

Comments

  • 6100-08 - use AIX APAR IV64454
    6100-09 - use AIX APAR IV63322
    7100-02 - use AIX APAR IV64248
    7100-03 - use AIX APAR IV63130
    

APAR Information

  • APAR number

    IV64454

  • Reported component name

    AIX 610 STD EDI

  • Reported component ID

    5765G6200

  • Reported release

    610

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Submitted date

    2014-09-02

  • Closed date

    2014-09-02

  • Last modified date

    2016-05-11

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

    IV63130

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

Fix information

  • Fixed component name

    AIX 610 STD EDI

  • Fixed component ID

    5765G6200

Applicable component levels

  • R610 PSY U868587

       UP15/01/18 I 1000



Document information

More support for: AIX Standard Edition

Software version: 610

Operating system(s): AIX

Reference #: IV64454

Modified date: 11 May 2016