Issue Details (XML | Word | Printable)

Key: STDCXX-263
Type: Bug Bug
Status: In Progress In Progress
Priority: Critical Critical
Assignee: Martin Sebor
Reporter: Martin Sebor
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
C++ Standard Library

SIGABRT in locale("") after setting LC_ALL to pathname of own locale

Created: 27/Jul/06 08:18 PM   Updated: 12/Nov/08 03:18 AM
Return to search
Component/s: 22. Localization
Affects Version/s: 4.1.2, 4.1.3, 4.1.4, 4.2.0
Fix Version/s: 4.2.2

Time Tracking:
Original Estimate: 4h
Original Estimate - 4h
Remaining Estimate: 4h
Remaining Estimate - 4h
Time Spent: Not Specified
Remaining Estimate - 4h

Environment: all
Issue Links:
Reference
 

Severity: Incorrect Behavior


 Description  « Hide
$ ../bin/localedef -w -f /nfs/devco/sebor/dev/stdlib/etc/nls/charmaps/ISO-8859-1 -i /nfs/devco/sebor/dev/stdlib/etc/nls/src/de_DE de_DE.ISO-8859 && cat t.cpp && make t && LC_ALL=./de_DE.ISO-8859 ./t
#include <cassert>
#include <cstdio>
#include <cstring>
#include <exception>
#include <ios>
#include <locale>

int main ()
{
    try {
        std::locale::global (std::locale (""));

        typedef std::num_put<char, char*> NumPut;

        std::ios strm (0);

        NumPut np;

        char buf [40] = "";

        np.put (buf, strm, ' ', 123.456);
        std::printf ("%s\n", buf);
        assert (0 == std::strcmp ("123,456", buf));
    }
    catch (std::exception &ex) {
        std::fprintf (stderr, "%s\n", ex.what ());
        return 1;
    }
}

xlc_r -c -I/amd/devco/sebor/dev/stdlib/include/ansi -D_RWSTDDEBUG    -D_RWSTD_USE_CONFIG -I/amd/devco/sebor/dev/stdlib/include -I/build/sebor/xlc-8.0-15S/include -I/amd/devco/sebor/dev/stdlib/examples/include  -F/package/1/ppc64/compilers/ibm/va80/vac.cfg -g  -q64  -qtemplateregistry=t.ti   t.cpp
xlc_r t.o -o t -F/package/1/ppc64/compilers/ibm/va80/vac.cfg -I/amd/devco/sebor/dev/stdlib/include/ansi -D_RWSTDDEBUG    -D_RWSTD_USE_CONFIG   -q64  -I/amd/devco/sebor/dev/stdlib/include/ansi -D_RWSTDDEBUG    -D_RWSTD_USE_CONFIG -I/amd/devco/sebor/dev/stdlib/include -I/build/sebor/xlc-8.0-15S/include -I/amd/devco/sebor/dev/stdlib/examples/include  -qtemplateregistry=t.ti -L/build/sebor/xlc-8.0-15S/lib -lstd15S  -lxlopt -lxl -libmc++ -lsupc++ -lgcc -lc -qnostaticlink=libgcc -lm
/usr/bin/ld: /build/sebor/xlc-8.0-15S/lib/libstd15S.a(exception.o)(.debug_info+0xcd99): R_PPC64_ADDR64 used with TLS symbol __rw_what_refcnt
/usr/bin/ld: /build/sebor/xlc-8.0-15S/lib/libstd15S.a(exception.o)(.debug_info+0xcdc0): R_PPC64_ADDR64 used with TLS symbol __rw_what_buf
/amd/devco/sebor/dev/stdlib/src/locale_combine.cpp:639: std::locale::locale: bad locale name: ""


 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Farid Zaripov added a comment - 08/Oct/07 03:19 PM
Could not reproduce this bug on RH Enterprise Linux 4 / GCC 4.1.2.

Martin Sebor added a comment - 12/Apr/08 10:33 PM
Setting a process-wide locale by means of the LANG and LC_XXX environment variables is the primary means for localizing an internationalized program. Bumped up Severity to Critical.
Added 4.1.4 and 4.2.0 to the list of Affected Versions.
Disabled formatting in Description.
Set initial time estimate.

Martin Sebor added a comment - 12/Apr/08 10:34 PM
Corrected a typo (missing space) in Summary.

Martin Sebor added a comment - 12/Apr/08 10:39 PM
Readily reproducible on Fedora 8:
$    cat /etc/redhat-release \
  && ../bin/localedef -w -f ~/stdcxx/etc/nls/charmaps/ISO-8859-1 -i ~/stdcxx/etc/nls/src/de_DE de_DE.ISO-8859 \
  && make t && env LC_ALL=./de_DE.ISO-8859 ./t
Fedora release 8 (Werewolf)
gcc -c -I/home/sebor/stdcxx/include/ansi -D_RWSTDDEBUG   -pthread -I/home/sebor/stdcxx/include -I/build/sebor/stdcxx-gcc-4.1.2-15D/include -I/home/sebor/stdcxx/examples/include  -pedantic -nostdinc++ -g   -W -Wall -Wcast-qual -Winline -Wshadow -Wwrite-strings -Wno-long-long -Wcast-align   t.cpp
gcc t.o -o t -pthread  -L/build/sebor/stdcxx-gcc-4.1.2-15D/lib  -Wl,-R/build/sebor/stdcxx-gcc-4.1.2-15D/lib -lstd15D -lsupc++ -lm 
/home/sebor/stdcxx/src/locale_combine.cpp:644: std::locale::locale(const char*): bad locale name: ""

Martin Sebor added a comment - 15/May/08 08:16 PM
See also STDCXX-342 for a similar problem.