This is the mail archive of the
gcc-prs@gcc.gnu.org
mailing list for the GCC project.
libstdc++/10564: Statically linked C++ program cannot be transferred from RHL 9 to RHL 7.3
- From: peter dot klotz at aon dot at
- To: gcc-gnats at gcc dot gnu dot org
- Date: 30 Apr 2003 12:09:59 -0000
- Subject: libstdc++/10564: Statically linked C++ program cannot be transferred from RHL 9 to RHL 7.3
- Reply-to: peter dot klotz at aon dot at
>Number: 10564
>Category: libstdc++
>Synopsis: Statically linked C++ program cannot be transferred from RHL 9 to RHL 7.3
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Wed Apr 30 12:16:01 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator: peter.klotz@aon.at
>Release: unknown-1.0
>Organization:
>Environment:
Red Hat Linux 9, gcc 3.2.2, glibc 2.3.2
Red Hat Linux 7.3, glibc 2.2.4
>Description:
A statically linked program using a static C++ locale object like in the example below cannot be transferred from RHL 9 to RHL 7.3.
The program works on RHL 9 but crashes at static cleanup under RHL 7.3.
Here is the backtrace from RHL 7.3:
(gdb) bt
#0 0x00000004 in ?? ()
#1 0x080ab7b1 in _nl_cleanup_ctype ()
#2 0x0808b056 in _nl_unload_locale ()
#3 0x0808c089 in freelocale ()
#4 0x0805d5bd in std::messages<wchar_t>::~messages() ()
#5 0x08049a5c in std::locale::facet::_M_remove_reference() ()
#6 0x08060c58 in std::locale::_Impl::~_Impl() ()
#7 0x0804920d in std::locale::~locale() ()
#8 0x0804823f in __tcf_0 ()
#9 0x08090ab2 in exit ()
#10 0x08089d6b in __libc_start_main ()
Is it my fault because of the two different glibc versions?
Shouldn't statically linking avoid such problems?
When the locale "de_AT@euro" is replaced with "C" the program works as expected. Nevertheless the locale "de_AT@euro" is present on the RHL 7.3 system (according to locale -a).
>How-To-Repeat:
* Compile program on RHL 9:
g++ -static locale.cpp -o locale
* Copy it to a RHL 7.3 installation and run it
./locale
Segmentation fault (core dumped)
>Fix:
#include <locale>
class String { static std::locale m_locale; };
std::locale String::m_locale("de_AT@euro");
int main(void)
{ return 0; }
>Release-Note:
>Audit-Trail:
>Unformatted: