From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 625 invoked by alias); 30 Apr 2003 12:16:01 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 606 invoked by uid 71); 30 Apr 2003 12:16:01 -0000 Resent-Date: 30 Apr 2003 12:16:01 -0000 Resent-Message-ID: <20030430121601.605.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, peter.klotz@aon.at Received: (qmail 29795 invoked by uid 48); 30 Apr 2003 12:09:59 -0000 Message-Id: <20030430120959.29794.qmail@sources.redhat.com> Date: Wed, 30 Apr 2003 12:16:00 -0000 From: peter.klotz@aon.at Reply-To: peter.klotz@aon.at To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version: gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: libstdc++/10564: Statically linked C++ program cannot be transferred from RHL 9 to RHL 7.3 X-SW-Source: 2003-04/txt/msg01442.txt.bz2 List-Id: >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::~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 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: