[prev in list] [next in list] [prev in thread] [next in thread] 

List:       hpux-cxx-dev
Subject:    Re:  CXX-DEV: atexit shared library mutexes already deallocated
From:       Dennis Handly <dhandly () hpcllmx ! cup ! hp ! com>
Date:       1999-05-13 1:37:13
[Download RAW message or body]

>have a continuing problem with shutdown of our threaded 1.15 aCC pprogram.
>Purify reports many freeing unallocated memory messages around the
>HPMutexWrapper.

You didn't go back far enough in the stack.  It is a problem with
null_string_ref_rep being done twice.

>The problem is that shared library "unlink" is also is registered
>via atexit, but executes after the mutuxes have been deallocated.

string::null_ref is being destroyed twice.  These are static destructors
and only very very indirectly related to atexit.

This is SR 5003431072  CLLbs15458.

>(i.e. RWCString)

This has nothing to do with it.  It is string.

>Sometimes our application exits normally, but many times it core dumps
>because of problems like this.
    free           [rtlib.o]
    _p_mutex_free  [libc.1]
    HPMutexWrapper::~HPMutexWrapper() [libstd.1]
    RWSTDMutex::~RWSTDMutex() [stdmutex.h:177]
    string_ref_rep<allocator>::~string_ref_rep() [DeleteCursor.o]
    null_string_ref_rep<char,...>::~null_string_ref_rep()[DeleteCursor.o]
    __shlTerm [libCsup.1]
Philip Walden

This is a documented limitation of +inst_compiletime.
You must use +inst_auto.

Note that this "workaround" will no longer work for libstd A.01.18 since
the assigner info has been removed.  And it has a fix for your particular
problem.

Note the above fix for SR 5003431072 has a new memory leak problem:
SR 4701409995  CLLbs16792

This is fixed in the A.01.21 versions of string and string.cc.
This later issue has been discussed here and the workaround was mentioned.
 _________________________________________________________________
 To leave this mailing list, send mail to majordomo@cxx.cup.hp.com
    with the message UNSUBSCRIBE cxx-dev
 _________________________________________________________________

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic