Re: Need some help for troubles with the chain of destructors called for static (global) objects in g++ 2.95.3 for solaris

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Ogheri,

My bet is that this is an order-of-destruction problem.  They usually occur when one static or global object refers to and relies upon another static or global object during its destruction (as the program is shutting down), but the other object has already been destructed.

If that is the problem, to solve order-of-destruction problems, interrelationships between global objects needs to be scrutinized.  Keep in mind, order of construction and order of destruction is not something to rely upon in C or C++!  One way that worked for me to get rid of all order-of-destruction problems was to eliminate ALL global objects (global "plain old data" types are usually okay... but I got rid of them too).  Another way to help track down order-of-destruction issues is to make sure each object sets all it's data members to some known garbage value (don't use memset ... set each field explicitly).

Of course, you'll need the source code to effect these kinds of changes.

HTH,
--Eljay



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux