After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 619445 - starting gives crash with message "locale::facet::_S_create_c_locale name not valid"
starting gives crash with message "locale::facet::_S_create_c_locale name not...
Status: RESOLVED OBSOLETE
Product: glom
Classification: Other
Component: general
1.13.x
Other All
: Normal normal
: ---
Assigned To: Murray Cumming
Murray Cumming
Depends on:
Blocks:
 
 
Reported: 2010-05-23 17:05 UTC by Kiri
Modified: 2011-12-19 17:06 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix locale problem (7.34 KB, patch)
2011-01-08 15:32 UTC, Koop Mast (kwm)
none Details | Review
exception backtrace (3.85 KB, text/plain)
2011-10-03 10:48 UTC, Antoine Jacoutot
  Details

Description Kiri 2010-05-23 17:05:11 UTC
On Ubuntu Lucid Lynx 10.4,
starting glom in any way gives the error:

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

even running
glom --version
gives this error.
Version is 1.13.2.

When the error is understood, the severity may be able to be set more appropriately.
If it is an error in Ubuntu packaging, then I suggest setting this report to severity=enhancement as an enhancement request for more robust handling of this error.
Comment 1 Murray Cumming 2010-06-17 15:49:59 UTC
What locale are you using? For instance, what does "echo $LANG" say in the terminal? Does it work if you do "export LANG=en_US.UTF-8" before starting Glom from the terminal?

Is there anything else unusual about your system? Is it a 64-bit installation?
Comment 2 Murray Cumming 2010-06-17 15:50:31 UTC
By the way, not that Ubuntu's package is old, and of an unstable Glom version, but this is still an unexpected error.
Comment 3 Murray Cumming 2010-06-19 14:04:50 UTC
Also, could you try to get a gdb backtrace for this, if you know how?
Comment 4 Murray Cumming 2010-06-22 15:29:52 UTC
You should also the package of the stable Glom 1.14.x that I have uploaded to our PPA:
https://launchpad.net/~openismus-team/+archive/ppa
Comment 5 Kiri 2010-06-26 12:56:03 UTC
Upgrading using PPA produced this error:

dpkg: dependency problems prevent configuration of glom:
 glom depends on libglom-1.14-0 (= 1.14.3-0ubuntu1openismus9); however:
  Package libglom-1.14-0 is not installed.
dpkg: error processing glom (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 glom

Other packaging errors (not glom) currently prevent me from manually installing.

LANG is and was en_US.UTF-8 .
Comment 6 Murray Cumming 2010-06-27 09:47:35 UTC
(In reply to comment #5)
> Upgrading using PPA produced this error:
> 
> dpkg: dependency problems prevent configuration of glom:
>  glom depends on libglom-1.14-0 (= 1.14.3-0ubuntu1openismus9); however:
>   Package libglom-1.14-0 is not installed.

Someone else had this problem, but I don't understand why yet. Could you give me some more clues:

Wat does it say when you try this?
  sudo apt-get install libglom-1.14-0

And if that asks for another package could you try that too, and give me
that error message too, please?

Maybe my libglom-1.14 package just needs to state that it replaces the libglom-1.12 package.
Comment 7 Kiri 2010-06-28 07:42:04 UTC
1.14.3-0ubuntu1openismus9 has the same error.  I do not find debug symbols for it.  Perhaps I will build glom for debug some time.  It may depend on what i need for build dependencies.
Comment 8 Murray Cumming 2010-06-28 07:52:30 UTC
But could you answer my questions in #6. I'd really like to fix that packaging problem.

And yes, it would be really helpful if you could build Glom to get a backtrace. I'd like to find where this exception is first thrown so I can give a more helpful clue about the problem. "apt-get source Glom" might help. And I'd welcome any change to the packaging to add a dbg package.

This is very odd to me though if en_US.UTF-8 is your normal locale. If it's not your normal locale then I can imagine that it is not installed properly somehow. Googling found things like this:
http://ubuntuforums.org/showthread.php?t=287887
Comment 9 Murray Cumming 2010-07-20 20:34:19 UTC
> Upgrading using PPA produced this error:
> 
> dpkg: dependency problems prevent configuration of glom:
>  glom depends on libglom-1.14-0 (= 1.14.3-0ubuntu1openismus9); however:
>   Package libglom-1.14-0 is not installed.

That should be fixed now.

I still have no idea what is causing your main problem. I will try to add debug packages for Glom to help you get a backtrace.
Comment 10 Murray Cumming 2010-07-21 19:01:55 UTC
I have added glom-dbg and libglom-1.14-0-dbg packages which might help you to get a backtrace. You probably want to install the glibmm and gtkmm debug packages too, and maybe others.
Comment 11 Murray Cumming 2010-08-03 14:52:36 UTC
Could you try, please?
Comment 12 Murray Cumming 2010-08-06 13:41:12 UTC
Please? I really want to fix this problem.
Comment 13 Kiri 2010-08-10 11:54:30 UTC
glom:
  Installed: 1.14.5-0ubuntu1openismus2
libglom-1.14-0:
  Installed: 1.14.5-0ubuntu1openismus2

Program received signal SIGABRT, Aborted.
0x0012d422 in __kernel_vsyscall ()
(gdb) bt
  • #0 __kernel_vsyscall
  • #1 raise
    from /lib/tls/i686/cmov/libc.so.6
  • #2 abort
    from /lib/tls/i686/cmov/libc.so.6
  • #3 __gnu_cxx::__verbose_terminate_handler()
    from /usr/local/lib/libstdc++.so.6
  • #4 __cxxabiv1::__terminate(void (*)())
    from /usr/local/lib/libstdc++.so.6
  • #5 std::terminate()
    from /usr/local/lib/libstdc++.so.6
  • #6 __cxa_throw
    from /usr/local/lib/libstdc++.so.6
  • #7 std::__throw_runtime_error(char const*)
    from /usr/local/lib/libstdc++.so.6
  • #8 std::locale::facet::_S_create_c_locale(int*&, char const*, int*)
    from /usr/local/lib/libstdc++.so.6
  • #9 std::locale::_Impl::_Impl(char const*, unsigned int)
    from /usr/local/lib/libstdc++.so.6
  • #10 std::locale::locale(char const*)
    from /usr/local/lib/libstdc++.so.6
  • #11 main
    at glom/main.cc line 439

Comment 14 Murray Cumming 2010-08-10 13:48:37 UTC
Thanks. I've added a try/catch around that to give us a clue. When I've done a tarball release and Ubuntu package with that, I'll mention it here so you can try again.
Comment 15 Murray Cumming 2010-08-10 19:48:28 UTC
That's in the PPA now:
https://launchpad.net/~openismus-team/+archive/ppa

It should now print the exception message to stderr and continue. Please copy/paste that message here.
Comment 16 Kiri 2010-08-11 10:30:25 UTC
int main(int, char**): exception from std::locale::global(std::locale("")): locale::facet::_S_create_c_locale name not valid
Glom: exception: 
  locale::facet::_S_create_c_locale name not valid
Comment 17 Murray Cumming 2010-08-11 10:57:23 UTC
Thanks. I notice that you see the exception twice, probably from different parts of the code. Does Glom still crash, or do anything unusual?

Does the problem go away if you do this on the command line?
  sudo dpkg-reconfigure locales
Comment 18 Kiri 2010-08-11 13:08:49 UTC
glom without paramers crashes as before.

Running
glom --version
int main(int, char**): exception from std::locale::global(std::locale("")): locale::facet::_S_create_c_locale name not valid
Glom 1.14.6

which did not function (tell the version) before.

These tests are after running 
sudo dpkg-reconfigure locales
Comment 19 Murray Cumming 2010-09-09 10:30:30 UTC
Could you get a backtrace for that new crash, please?
Comment 20 Murray Cumming 2010-09-19 11:04:26 UTC
Please?
Comment 21 Kiri 2010-09-20 14:10:10 UTC
There are unresolved dependencies in the PPA.
Comment 22 Murray Cumming 2010-09-20 14:25:30 UTC
(In reply to comment #21)
> There are unresolved dependencies in the PPA.

Can you give me a clue what they are please?
Comment 23 Kiri 2010-09-20 18:39:00 UTC
    --- libgconfmm-2.6-1c2 (>= 2.24.0) (UNAVAILABLE)
    --- libgda-4.0-4 (UNAVAILABLE)
    --- python-gda (UNAVAILABLE)

'aptitude' does not show the packages

for libgconfmm,
Ubuntu web server shows the packages.
Packages file has an entry.
Package server does not:
http://archive.ubuntu.com/ubuntu/pool/main/libg/
Comment 24 Murray Cumming 2010-09-20 19:32:20 UTC
Maybe you want to file a bug with launchpad. These are normal packages. For instance, I just tested a reinstall of libgconfmm, and checked that it's here:
http://us.archive.ubuntu.com/ubuntu/pool/main/g/gconfmm2.6/

You might also want to paste your whole /etc/apt/souces.list, though I'm unlikely to be able to help with general issues.
Comment 25 Kiri 2010-09-28 08:14:31 UTC
$ apt-cache policy glom-dbg
glom-dbg:
  Installed: 1.14.6-0ubuntu1openismus1

(gdb) r
Starting program: /usr/bin/glom 
[Thread debugging using libthread_db enabled]
Catchpoint 1 (exception thrown), 0x0178ea23 in __cxa_throw () from /usr/local/lib/libstdc++.so.6
(gdb) bt
  • #0 __cxa_throw
    from /usr/local/lib/libstdc++.so.6
  • #1 std::__throw_runtime_error(char const*)
    from /usr/local/lib/libstdc++.so.6
  • #2 std::locale::facet::_S_create_c_locale(int*&, char const*, int*)
    from /usr/local/lib/libstdc++.so.6
  • #3 std::locale::_Impl::_Impl(char const*, unsigned int)
    from /usr/local/lib/libstdc++.so.6
  • #4 std::locale::locale(char const*)
    from /usr/local/lib/libstdc++.so.6
  • #5 main
    at glom/main.cc line 441

When I run with --version, I see that the version is emitted after the exception is thrown.
Comment 26 Murray Cumming 2010-10-05 08:15:29 UTC
(In reply to comment #18)
> glom without paramers crashes as before.
> 
> Running
> glom --version
> int main(int, char**): exception from std::locale::global(std::locale("")):
> locale::facet::_S_create_c_locale name not valid
> Glom 1.14.6

Is that an actual crash? Your backtrace seems to be catching the throw, though it is caught in main(). The code looks like this:

  try
  {
    std::locale::global(std::locale("")); //line 441 (seen in your backtrace)
  }
  catch(const std::runtime_error& ex)
  {
    //This has been known to throw an exception at least once:
    //https://bugzilla.gnome.org/show_bug.cgi?id=619445
    //This should tell us what the problem is:
    std::cerr << G_STRFUNC << ": exception from std::locale::global(std::locale(\"\")): " << ex.what() << std::endl;
  }
Comment 27 Kiri 2010-10-06 13:37:39 UTC
The output posted for 'glom --version' was the actual terminal output.

The back trace was when running without parameters.

I'm running Ubuntu MM 10.10 now with Gnome as Desktop. The error does not reproduce. On LL 10.04, I had last used XFCE. I do not recall whether I had tried it under Gnome.
Comment 28 Murray Cumming 2010-10-21 07:33:59 UTC
OK. Thanks for the effort. I don't think I can do much more with this until someone else can reproduce it. I still think that your environment was broken somehow, but I don't know exactly how.

I'll close this bug eventually if nobody can reproduce it.
Comment 29 Murray Cumming 2010-11-09 08:55:57 UTC
Closing for now as we can't reproduce it. Someone please reopen it if you have the same problem.
Comment 30 Koop Mast (kwm) 2010-12-01 13:42:34 UTC
On FreeBSD, trying to update Glom to 1.16.x. With GDM_LANG=en_GB.UTF-8 LANG=en_GB.UTF-8 set in the enviroment. It fails with:

--------------------------------
int main(int, char**): exception from std::locale::global(std::locale("")): locale::facet::_S_create_c_locale name not valid
Glom: exception: 
  locale::facet::_S_create_c_locale name not valid
--------------------------------

How ever if I set LANG=C, I still get some ERROR's and DEBUG message. But glom works.
Comment 31 Koop Mast (kwm) 2010-12-01 13:44:03 UTC
And I'm not able to reopen this bug, for some reason.
Comment 32 Murray Cumming 2010-12-01 13:49:33 UTC
Thanks, Koop. Can you get a gdb backtrace of the actual crash, please? That output is probably not exactly where it crashes.

I will also try to create a simple test case for this. I think it's a problem in your installation, or the distro in general, but I'll need to prove that.

I'd be interested in those other error messages if they seem related.
Comment 33 Koop Mast (kwm) 2010-12-15 20:41:14 UTC
If I run glom from gdb it tells me the application has exited normaly.

Some help would be nice of what I should do, I only have experience with gdb and programs that segfault. Should I comment out some code or set a breakpoint somewhere?
Comment 34 Koop Mast (kwm) 2011-01-08 15:32:28 UTC
Created attachment 177836 [details] [review]
Fix locale problem

This fix was added to our boost port. And if I apply it to glom I don't get the locale problem anymore.
https://svn.boost.org/trac/boost/ticket/4688
Comment 35 Murray Cumming 2011-01-08 16:05:46 UTC
I don't believe that locale("") and locale() mean the same thing. I think one is the classic locale and one is the current locale.
Comment 36 Murray Cumming 2011-01-08 21:17:32 UTC
If I could find out what line of code is throwing the exception then I could cope with it more intelligently. Unfortunately, I can't reproduce it on any of my systems, and nobody has a backtrace so far.

Using "catch throw" in gdb might help someone to get a backtrace, though it's only the last exception that's interesting. It will also show you some exceptions that are handled without problems.
Comment 37 Murray Cumming 2011-07-06 12:15:54 UTC
Can anyone get a gdb backtrace for me?
Comment 38 Murray Cumming 2011-09-13 07:31:42 UTC
Can anyone get a gdb backtrace for me, please?
Comment 39 Murray Cumming 2011-09-27 11:23:07 UTC
Please reopen if you have a backtrace.
Comment 40 Antoine Jacoutot 2011-10-03 10:48:15 UTC
Created attachment 198068 [details]
exception backtrace

Hi.

I'm seeing the exact same issue under OpenBSD.
Backtrace attached.
Comment 41 Murray Cumming 2011-10-07 08:13:19 UTC
Antoine, what version are you using to get that backtrace? What do you have on this line, mentioned in the backtrace?
  glom/main.cc:445

The current code has a try/catch around that line, so I am confused that the exception is not caught:

  try
  {
    std::locale::global(std::locale(""));
  }
  catch(const std::runtime_error& ex)
  {
    //This has been known to throw an exception at least once:
    //https://bugzilla.gnome.org/show_bug.cgi?id=619445
    //This should tell us what the problem is:
    std::cerr << G_STRFUNC << ": exception from std::locale::global(std::locale(\"\")): " << ex.what() << std::endl;
  }
Comment 42 Murray Cumming 2011-10-09 12:57:47 UTC
I guess that the exeception is being caught there, but I am most interested in the later exception that is apparently not being caught.
Comment 43 Murray Cumming 2011-10-18 11:21:48 UTC
I could reproduce this by defining LANG to a locale that I have not installed (in Ubuntu Oneiric). For instance:

$ export LANG=hu_HU.UTF-8
$ glom

So I have added try/catch blocks to prevent later crashes:
http://git.gnome.org/browse/glom/commit/?id=9158ae51d6d5a60a862b274b296e3a4a80cebc11

However, I will probably just prevent glom from starting if this happens, because this cripples Glom's functionality. For instance, you sometimes will not see any data in the list or details views.
Comment 44 Murray Cumming 2011-10-18 11:33:36 UTC
Apparently this should list your installed locales:
$ locale -a
Comment 45 Murray Cumming 2011-10-18 11:35:54 UTC
And on debian/Ubuntu, I would like to know if this solves the problem:
$ sudo dpkg-reconfigure locales
Comment 46 Murray Cumming 2011-11-06 21:37:53 UTC
Please respond.
Comment 47 Murray Cumming 2011-12-19 17:06:38 UTC
Please reopen if you can answer these questions, please.

Otherwise, I still don't consider this a bug on normal systems, and I object to the suggested fix in comment #34.