Download Reference Manual
The Developer's Library for D
About Wiki Forums Source Search Contact

Ticket #425 (closed defect: wontfix)

Opened 1 year ago

Last modified 1 year ago

"object.Exception: Culture is not supported." when LANG not set

Reported by: mandel Assigned to: larsivi
Priority: normal Milestone: 0.99.1 RC4
Component: Core Functionality Version: 0.97 RC1
Keywords: Cc:

Description

On my system the following code line in a program causes it to abort with the exception message in the title. - Even whne the piece of code never get called.

auto x = new Print!(char) (new Layout!(char), res_buf);

The program executes when the LANG variable in the environment is set, but fails with an exception when not.

Kris pointed out my system env is borked and it shouldn't even compile. Nevertheless, maybe it can provide some useful information.

Environment: Gentoo Linux dmd-1.0.13 Tango 0.97 RC1 libtango/libphobos from the binary (linux/dmd) package to /usr/lib/ object.di, std/ and tango/ went to /usr/include/ $ gcc -v Using built-in specs. Target: i686-pc-linux-gnu Configured with: /var/tmp/portage/sys-devel/gcc-4.1.2/work/gcc-4.1.2/configure --prefix=/usr --bindir=/usr/i686-pc-linux-gnu/gcc-bin/4.1.2 --includedir=/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/include --datadir=/usr/share/gcc-data/i686-pc-linux-gnu/4.1.2 --mandir=/usr/share/gcc-data/i686-pc-linux-gnu/4.1.2/man --infodir=/usr/share/gcc-data/i686-pc-linux-gnu/4.1.2/info --with-gxx-include-dir=/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/include/g++-v4 --host=i686-pc-linux-gnu --build=i686-pc-linux-gnu --disable-altivec --enable-nls --without-included-gettext --with-system-zlib --disable-checking --disable-werror --enable-secureplt --disable-libunwind-exceptions --disable-multilib --disable-libmudflap --disable-libssp --disable-libgcj --enable-languages=c,c++,fortran --enable-shared --enable-threads=posix --enable-cxa_atexit --enable-clocale=gnu Thread model: posix gcc version 4.1.2 (Gentoo 4.1.2)

Additional libs linked by gcc are "-m32 -Xlinker /usr/lib/libtango.a -Xlinker /usr/lib/libphobos.a -lphobos -lpthread -lm"

Change History

04/20/07 23:50:06 changed by mandel

  • priority changed from major to normal.

04/21/07 06:16:13 changed by larsivi

  • status changed from new to assigned.
  • milestone set to 0.98 RC 2.

Will look at this along some other locale stuff.

04/22/07 07:42:23 changed by larsivi

My first tests on this indicates that it works as it should, that is, no locale code is linked in. There is probably still an issue with how the LANG env variable is handled though, so that will be looked into.

05/10/07 15:02:46 changed by larsivi

  • milestone changed from 0.98 RC 2 to 0.99 RC3.

07/03/07 16:12:51 changed by larsivi

  • milestone changed from 0.99 RC3 to 1.0.

08/16/07 10:39:08 changed by flithm

This also happens to me. The program dies even before any code starts executing if LANG is not set and I attempt to use Stdout.layout.convert (so I can't even use setenv in the code to fix this).

08/17/07 15:11:35 changed by larsivi

(In [2493]) Throwing a more telling exception if LANG or LC_ALL is not set. refs #425

08/17/07 15:13:27 changed by larsivi

  • status changed from assigned to closed.
  • resolution set to wontfix.

I am going to close this now, as it is not an easy fix with the current codebase. The issue is noted in the rewrite ticket though, such that it should not be an issue then.

08/17/07 15:13:36 changed by larsivi

  • milestone changed from 1.0 to 0.99.1 RC4.

08/26/07 15:12:19 changed by flithm

Would it be possible to provide a hook so that this can be intercepted by the program at run time? I'd like to be able to provide a default LANG setting as a fallback.

08/28/07 08:59:50 changed by larsivi

The lack of a simple way to do this, is the reason for the resolution that was made (the throwing of an Exception saying the exact problem). What you want should be part of the rewrite.