Named locales do not work on the main line

Peter Schmid schmid@snake.iap.physik.tu-darmstadt.de
Mon Oct 15 10:17:00 GMT 2001


Named locales do not work for the current gcc 3.1 compiler. For
example, the following code tl.C generates a core dump when run.

Named locales used to work when I last tryed this facility about two
weeks ago. 

My system setup is: Glibc 2.2, Linux 2.4.10, i686-pc-linux-gnu, SuSE 7.1.

Hope this helps,

Peter Schmid

source code tl.C
#include <iostream>
#include <locale>
using namespace std;

int main()
{
    cout.imbue(locale("de_DE"));
}

Compiling tl.C
g++ -v -o tl tl.C -W -Wall -g
Reading specs from /usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.1/specs
Configured with: ../gcc/configure --enable-shared --enable-threads=posix --enable-languages=c,c++,f77,objc --disable-nls --enable-clocale=gnu
Thread model: posix
gcc version 3.1 20011013 (experimental)
 /usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.1/cc1plus -v -D__GNUC__=3 -D__GNUC_MINOR__=1 -D__GNUC_PATCHLEVEL__=0 -D__ELF__ -Dunix -Dlinux -D__ELF__ -D__unix__ -D__linux__ -D__unix -D__linux -Asystem=posix -D__NO_INLINE__ -D__STDC_HOSTED__=1 -W -Wall -D_GNU_SOURCE -Acpu=i386 -Amachine=i386 -Di386 -D__i386 -D__i386__ -D__tune_i686__ -D__tune_pentiumpro__ tl.C -D__GNUG__=3 -D__DEPRECATED -D__EXCEPTIONS -D__GXX_ABI_VERSION=100 -quiet -dumpbase tl.C -g -W -Wall -version -o /tmp/ccYrQ8un.s
GNU CPP version 3.1 20011013 (experimental) (cpplib) (i386 Linux/ELF)
GNU C++ version 3.1 20011013 (experimental) (i686-pc-linux-gnu)
	compiled by GNU C version 3.1 20011013 (experimental).
ignoring nonexistent directory "NONE/include"
ignoring nonexistent directory "/usr/local/i686-pc-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/include/g++-v3
 /usr/local/include/g++-v3/i686-pc-linux-gnu
 /usr/local/include/g++-v3/backward
 /usr/local/include
 /usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.1/include
 /usr/include
End of search list.
 /usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.1/../../../../i686-pc-linux-gnu/bin/as -V -Qy -o /tmp/ccsJUeNH.o /tmp/ccYrQ8un.s
GNU assembler version 2.11.90.0.23 (i686-pc-linux-gnu) using BFD version 2.11.90.0.23
 /usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.1/collect2 -m elf_i386 -dynamic-linker /lib/ld-linux.so.2 -o tl /usr/lib/crt1.o /usr/lib/crti.o /usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.1/crtbegin.o -L/usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.1 -L/usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.1/../../../../i686-pc-linux-gnu/lib -L/usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.1/../../.. /tmp/ccsJUeNH.o -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.1/crtend.o /usr/lib/crtn.o

Running tl
./tl
Aborted (core dumped)

GNU gdb 5.0
Copyright 2001 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i686-pc-linux-gnu"...
(gdb) r
Starting program: /home/peter/tl 

Program received signal SIGABRT, Aborted.
0x40113bc1 in __kill () from /lib/libc.so.6
(gdb) bt
#0  0x40113bc1 in __kill () from /lib/libc.so.6
#1  0x401139c5 in raise () from /lib/libc.so.6
#2  0x40114fe1 in abort () from /lib/libc.so.6
#3  0x40068247 in __cxxabiv1::__terminate(void (*)()) (
    handler=0x40114f10 <abort>)
    at ../../../../gcc/libstdc++-v3/libsupc++/eh_terminate.cc:47
#4  0x40068284 in std::terminate() ()
    at ../../../../gcc/libstdc++-v3/libsupc++/eh_terminate.cc:57
#5  0x4006845d in __cxa_rethrow ()
    at ../../../../gcc/libstdc++-v3/libsupc++/eh_throw.cc:101
#6  0x4005fe5a in std::locale::_Impl::_Impl(std::string, unsigned) (
    this=0x804bb80, __str=0xbffff730, __refs=1)
    at ../../../../gcc/libstdc++-v3/src/localename.cc:85
#7  0x4005aa0b in std::locale::locale(char const*) (this=0xbffff784, 
    __s=0x804986c "de_DE")
    at /mnt/egcs/build/i686-pc-linux-gnu/libstdc++-v3/include/bits/stl_alloc.h:600
#8  0x0804917b in main () at tl.C:7
#9  0x40103baf in __libc_start_main () from /lib/libc.so.6




More information about the Libstdc++ mailing list