public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/15467] New: std::locale("") throws exception
@ 2004-05-16 19:42 bryan at reigndropsfall dot net
  2004-05-16 20:00 ` [Bug c++/15467] " bryan at reigndropsfall dot net
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: bryan at reigndropsfall dot net @ 2004-05-16 19:42 UTC (permalink / raw)
  To: gcc-bugs

running the attached test case throws an exception when my environment variable
LC_ALL is set to anything other than "C" or "POSIX".  This should not be the
case.  std::locale() should accept the same names as setlocale().

-- 
           Summary: std::locale("") throws exception
           Product: gcc
           Version: 3.4.0
            Status: UNCONFIRMED
          Severity: critical
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: bryan at reigndropsfall dot net
                CC: gcc-bugs at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15467


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug c++/15467] std::locale("") throws exception
  2004-05-16 19:42 [Bug c++/15467] New: std::locale("") throws exception bryan at reigndropsfall dot net
@ 2004-05-16 20:00 ` bryan at reigndropsfall dot net
  2004-05-16 20:18 ` [Bug libstdc++/15467] " pinskia at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: bryan at reigndropsfall dot net @ 2004-05-16 20:00 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From bryan at reigndropsfall dot net  2004-05-15 17:21 -------
Created an attachment (id=6307)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=6307&action=view)
this test case throws exception

exception thrown:
terminate called after throwing an instance of 'std::runtime_error'
  what():  locale::facet::_S_create_c_locale name not valid
Aborted

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15467


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug libstdc++/15467] std::locale("") throws exception
  2004-05-16 19:42 [Bug c++/15467] New: std::locale("") throws exception bryan at reigndropsfall dot net
  2004-05-16 20:00 ` [Bug c++/15467] " bryan at reigndropsfall dot net
@ 2004-05-16 20:18 ` pinskia at gcc dot gnu dot org
  2004-05-16 20:19 ` pinskia at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-05-16 20:18 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|c++                         |libstdc++


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15467


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug libstdc++/15467] std::locale("") throws exception
  2004-05-16 19:42 [Bug c++/15467] New: std::locale("") throws exception bryan at reigndropsfall dot net
  2004-05-16 20:00 ` [Bug c++/15467] " bryan at reigndropsfall dot net
  2004-05-16 20:18 ` [Bug libstdc++/15467] " pinskia at gcc dot gnu dot org
@ 2004-05-16 20:19 ` pinskia at gcc dot gnu dot org
  2004-05-17 19:10 ` bangerth at dealii dot org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-05-16 20:19 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-05-15 17:29 -------
This is a bug in glibc.
As libstdc++ just calls:
    __cloc = __newlocale(1 << LC_ALL, __s, __old);

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15467


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug libstdc++/15467] std::locale("") throws exception
  2004-05-16 19:42 [Bug c++/15467] New: std::locale("") throws exception bryan at reigndropsfall dot net
                   ` (2 preceding siblings ...)
  2004-05-16 20:19 ` pinskia at gcc dot gnu dot org
@ 2004-05-17 19:10 ` bangerth at dealii dot org
  2004-05-17 19:14 ` pinskia at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: bangerth at dealii dot org @ 2004-05-17 19:10 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From bangerth at dealii dot org  2004-05-17 02:35 -------
Is glibc supposed to throw C++-style exceptions at all? I'd like to 
hear from the libstdc++ maintainers about this issue. 
 
W. 

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |UNCONFIRMED
         Resolution|INVALID                     |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15467


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug libstdc++/15467] std::locale("") throws exception
  2004-05-16 19:42 [Bug c++/15467] New: std::locale("") throws exception bryan at reigndropsfall dot net
                   ` (3 preceding siblings ...)
  2004-05-17 19:10 ` bangerth at dealii dot org
@ 2004-05-17 19:14 ` pinskia at gcc dot gnu dot org
  2004-05-17 20:01 ` pcarlini at suse dot de
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-05-17 19:14 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-05-17 02:43 -------
Note I asked the person to file a glibc bug, see <http://sources.redhat.com/bugzilla/show_bug.cgi?
id=165>, the reason why I said this is not a libstdc++ bug as glibc returns NULL which causes 
libstdc++ to throw the exception.  I should have said that in the bug when I had marked it as invalid.

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15467


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug libstdc++/15467] std::locale("") throws exception
  2004-05-16 19:42 [Bug c++/15467] New: std::locale("") throws exception bryan at reigndropsfall dot net
                   ` (4 preceding siblings ...)
  2004-05-17 19:14 ` pinskia at gcc dot gnu dot org
@ 2004-05-17 20:01 ` pcarlini at suse dot de
  2004-05-17 20:12 ` pcarlini at suse dot de
  2004-05-18 11:51 ` pinskia at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: pcarlini at suse dot de @ 2004-05-17 20:01 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pcarlini at suse dot de  2004-05-17 09:28 -------
Probably, the issue is simpler: for some reason, submitter doesn't have
installed any localedata.

Are you on a glibc platform? Could you please provide the output of
'localedef --list-archive' ??

In general, are those named locales otherwise available? I.e., what happens
if you compile and run a simple C test program like the below (in the named
locale of your choice, of course):

#define _GNU_SOURCE 1
#include <locale.h>
#include <langinfo.h>
#include <stdio.h>
#include <time.h>

int main()
{
  locale_t    loc;

  const char* pp;
  const char*   __s = "fr_FR";
 
  loc = newlocale(1 << LC_ALL, __s, 0);

  pp = nl_langinfo_l(ABDAY_1, loc);
  printf("ABDAY_1 = %s\n", pp);

  freelocale(loc);

  return 0;
}

???

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|critical                    |normal
             Status|UNCONFIRMED                 |WAITING


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15467


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug libstdc++/15467] std::locale("") throws exception
  2004-05-16 19:42 [Bug c++/15467] New: std::locale("") throws exception bryan at reigndropsfall dot net
                   ` (5 preceding siblings ...)
  2004-05-17 20:01 ` pcarlini at suse dot de
@ 2004-05-17 20:12 ` pcarlini at suse dot de
  2004-05-18 11:51 ` pinskia at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: pcarlini at suse dot de @ 2004-05-17 20:12 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pcarlini at suse dot de  2004-05-17 10:01 -------
... or perhaps the glibc is too old and the thread-local locale support is
missing/broken (that would be the case if the named locales are actually
available only via setlocale). Is your glibc at least 2.2.5, better 2.3.x?

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15467


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug libstdc++/15467] std::locale("") throws exception
  2004-05-16 19:42 [Bug c++/15467] New: std::locale("") throws exception bryan at reigndropsfall dot net
                   ` (6 preceding siblings ...)
  2004-05-17 20:12 ` pcarlini at suse dot de
@ 2004-05-18 11:51 ` pinskia at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-05-18 11:51 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-05-17 19:45 -------
Not a bug in either glibc or libstdc++, see the glibc bug
<http://sources.redhat.com/bugzilla/show_bug.cgi?id=165>, it works if you have the locales installed.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |RESOLVED
         Resolution|                            |INVALID


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15467


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2004-05-17 19:45 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-05-16 19:42 [Bug c++/15467] New: std::locale("") throws exception bryan at reigndropsfall dot net
2004-05-16 20:00 ` [Bug c++/15467] " bryan at reigndropsfall dot net
2004-05-16 20:18 ` [Bug libstdc++/15467] " pinskia at gcc dot gnu dot org
2004-05-16 20:19 ` pinskia at gcc dot gnu dot org
2004-05-17 19:10 ` bangerth at dealii dot org
2004-05-17 19:14 ` pinskia at gcc dot gnu dot org
2004-05-17 20:01 ` pcarlini at suse dot de
2004-05-17 20:12 ` pcarlini at suse dot de
2004-05-18 11:51 ` pinskia at gcc dot gnu dot org

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).