public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: peter.klotz@aon.at
To: gcc-gnats@gcc.gnu.org
Subject: libstdc++/10564: Statically linked C++ program cannot be transferred from RHL 9 to RHL 7.3
Date: Wed, 30 Apr 2003 12:16:00 -0000	[thread overview]
Message-ID: <20030430120959.29794.qmail@sources.redhat.com> (raw)


>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:


             reply	other threads:[~2003-04-30 12:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-04-30 12:16 peter.klotz [this message]
2003-05-16 21:11 bkoz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030430120959.29794.qmail@sources.redhat.com \
    --to=peter.klotz@aon.at \
    --cc=gcc-gnats@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).