This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/33937] New: static variables destruction results in a segmentation fault (Coredumps)


My application crashes when shutting down on RH4.  We did a lot of
investigation and found that the crash occurs when the system tries to destruct
static variables.  

Our OS is Red Hat Enterprise Linux AS release 4 (Nahant Update 5).  I am using
the following compiler - gcc version 3.4.6 20060404 (Red Hat 3.4.6-8).

Ours is a complex application using a lot of shared libraries.  Below is the
explanation of the problem.

We have a shared library libXYZ.so which uses static variables as well as
classes containing static members. 
Our program loads this library libXYZ.so using dlopen function. 
The program runs fine. 
But on shut down, it crashes at the point where it tries to destruct the static
variables.  The library has been unloaded long back. 
All the static variables have been cleaned properly from within the application 
If we change the static variables to non-static, the crash does not occur. 
The crash does not occur on SUN SOLARIS platform 


I would like to know:

Have you heard of any such problem with static variables on shutdown on linux
with gcc? 
Why would such a crash occur only on linux and not on Solaris? 
Older gcc versions had this problem, but ours is quite new.  Is there any patch
that needs to be applied on Linux. 

A very similar problem has already been reported to gcc -
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27319



Any input on this will be helpful.


-- 
           Summary: static variables destruction results in a segmentation
                    fault (Coredumps)
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: ssharma at thegoldensource dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33937


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]